aboutsummaryrefslogtreecommitdiffstats
path: root/examples/webenginewidgets/markdowneditor/document.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/webenginewidgets/markdowneditor/document.py')
-rw-r--r--examples/webenginewidgets/markdowneditor/document.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/examples/webenginewidgets/markdowneditor/document.py b/examples/webenginewidgets/markdowneditor/document.py
new file mode 100644
index 000000000..331fbc0ca
--- /dev/null
+++ b/examples/webenginewidgets/markdowneditor/document.py
@@ -0,0 +1,24 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+
+from PySide6.QtCore import QObject, Property, Signal
+
+
+class Document(QObject):
+
+ textChanged = Signal(str)
+
+ def __init__(self, parent=None):
+ super().__init__(parent)
+ self._text = ''
+
+ def text(self):
+ return self._text
+
+ def setText(self, t):
+ if t != self._text:
+ self._text = t
+ self.textChanged.emit(t)
+
+ text = Property(str, text, setText, notify=textChanged)