aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quickcontrols2/texteditor/documenthandler.h
diff options
context:
space:
mode:
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;