diff options
author | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-08-25 14:19:37 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-08-31 19:55:33 +0000 |
commit | fe1ea010b946518803ca1cec1332945c26be83af (patch) | |
tree | 3babd2aa71817252280ed4011a88ccac14ae407e /examples/widgets/richtext/textedit/textedit.h | |
parent | fb60f225e67db6c548fc2c5dfbe172251993daba (diff) |
Polish rich text example.
- Introduce Qt 5 signals & slot syntax.
- Use mime types in the file dialogs.
- Streamline the code creating the actions.
- Introduce QCommandLineParser.
- Query the available size when determining
the initial size instead of using hard-coded values
for High-DPI screens.
Change-Id: Ifc84a41ed55a4a674b6eafdb6120ac42441405b6
Reviewed-by: Topi Reiniƶ <topi.reinio@digia.com>
Diffstat (limited to 'examples/widgets/richtext/textedit/textedit.h')
-rw-r--r-- | examples/widgets/richtext/textedit/textedit.h | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/examples/widgets/richtext/textedit/textedit.h b/examples/widgets/richtext/textedit/textedit.h index dade2b9edf..b338493d83 100644 --- a/examples/widgets/richtext/textedit/textedit.h +++ b/examples/widgets/richtext/textedit/textedit.h @@ -55,19 +55,15 @@ class TextEdit : public QMainWindow public: TextEdit(QWidget *parent = 0); + bool load(const QString &f); + +public slots: + void fileNew(); + protected: virtual void closeEvent(QCloseEvent *e) Q_DECL_OVERRIDE; -private: - void setupFileActions(); - void setupEditActions(); - void setupTextActions(); - bool load(const QString &f); - bool maybeSave(); - void setCurrentFileName(const QString &fileName); - private slots: - void fileNew(); void fileOpen(); bool fileSave(); bool fileSaveAs(); @@ -92,6 +88,12 @@ private slots: void printPreview(QPrinter *); private: + void setupFileActions(); + void setupEditActions(); + void setupTextActions(); + bool maybeSave(); + void setCurrentFileName(const QString &fileName); + void mergeFormatOnWordOrSelection(const QTextCharFormat &format); void fontChanged(const QFont &f); void colorChanged(const QColor &c); |