aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quickcontrols2/texteditor/documenthandler.h
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2019-10-15 13:51:20 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2019-10-15 13:55:22 +0200
commit6f617349cf865ca3a7befc0dd472b7c2510fc431 (patch)
tree37e70da54a7f3101b82551ccd98508f8d9d64330 /examples/quickcontrols2/texteditor/documenthandler.h
parent718e08392f34dc478ea010c08a4b9c77bb665dfc (diff)
parent8e2d1b1efe736760d27af17160f662454546b054 (diff)
Merge remote-tracking branch 'origin/dev' into wip/cmake
Removed dependencies.yaml. Change-Id: I1e2b3f486e9ace4bc8dc0419a64848990b3a6b39
Diffstat (limited to 'examples/quickcontrols2/texteditor/documenthandler.h')
-rw-r--r--examples/quickcontrols2/texteditor/documenthandler.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/examples/quickcontrols2/texteditor/documenthandler.h b/examples/quickcontrols2/texteditor/documenthandler.h
index a6125bc3..97e55658 100644
--- a/examples/quickcontrols2/texteditor/documenthandler.h
+++ b/examples/quickcontrols2/texteditor/documenthandler.h
@@ -84,6 +84,8 @@ class DocumentHandler : public QObject
Q_PROPERTY(QString fileType READ fileType NOTIFY fileUrlChanged)
Q_PROPERTY(QUrl fileUrl READ fileUrl NOTIFY fileUrlChanged)
+ Q_PROPERTY(bool modified READ modified WRITE setModified NOTIFY modifiedChanged)
+
public:
explicit DocumentHandler(QObject *parent = nullptr);
@@ -124,6 +126,9 @@ public:
QString fileType() const;
QUrl fileUrl() const;
+ bool modified() const;
+ void setModified(bool m);
+
public Q_SLOTS:
void load(const QUrl &fileUrl);
void saveAs(const QUrl &fileUrl);
@@ -150,6 +155,8 @@ Q_SIGNALS:
void loaded(const QString &text);
void error(const QString &message);
+ void modifiedChanged();
+
private:
void reset();
QTextCursor textCursor() const;