aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quickcontrols2/texteditor/documenthandler.h
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2016-08-11 22:41:11 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2016-08-12 10:51:30 +0000
commit9a6bdf52a387b9266f78f2576dfee9bbf7285730 (patch)
tree0d9ec6240c03ef8f2274d86423890c868cf7367d /examples/quickcontrols2/texteditor/documenthandler.h
parent90842fdc865c3b7e9937bbd75f3fd5d74ec588ef (diff)
texteditor: replace setFileUrl() with load()
This allows to remove the text property to avoid storing the whole document's initial content for no real purpose. Change-Id: Iad59576b5304be9739c1dfb0a7d4c263323b0edb Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'examples/quickcontrols2/texteditor/documenthandler.h')
-rw-r--r--examples/quickcontrols2/texteditor/documenthandler.h11
1 files changed, 3 insertions, 8 deletions
diff --git a/examples/quickcontrols2/texteditor/documenthandler.h b/examples/quickcontrols2/texteditor/documenthandler.h
index 671bb5f3..dd3c3988 100644
--- a/examples/quickcontrols2/texteditor/documenthandler.h
+++ b/examples/quickcontrols2/texteditor/documenthandler.h
@@ -80,10 +80,9 @@ class DocumentHandler : public QObject
Q_PROPERTY(int fontSize READ fontSize WRITE setFontSize NOTIFY fontSizeChanged)
- Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged)
Q_PROPERTY(QString fileName READ fileName NOTIFY fileUrlChanged)
Q_PROPERTY(QString fileType READ fileType NOTIFY fileUrlChanged)
- Q_PROPERTY(QUrl fileUrl READ fileUrl WRITE setFileUrl NOTIFY fileUrlChanged)
+ Q_PROPERTY(QUrl fileUrl READ fileUrl NOTIFY fileUrlChanged)
public:
explicit DocumentHandler(QObject *parent = nullptr);
@@ -121,16 +120,12 @@ public:
int fontSize() const;
void setFontSize(int size);
- QString text() const;
- void setText(const QString &text);
-
QString fileName() const;
QString fileType() const;
-
QUrl fileUrl() const;
- void setFileUrl(const QUrl &fileUrl);
public Q_SLOTS:
+ void load(const QUrl &fileUrl);
void saveAs(const QUrl &fileUrl);
Q_SIGNALS:
@@ -152,6 +147,7 @@ Q_SIGNALS:
void textChanged();
void fileUrlChanged();
+ void loaded(const QString &text);
void error(const QString &message);
private:
@@ -168,7 +164,6 @@ private:
QFont m_font;
int m_fontSize;
- QString m_text;
QUrl m_fileUrl;
};