diff options
author | Richard Dale <richard.dale@codethink.co.uk> | 2013-07-04 09:56:52 +0100 |
---|---|---|
committer | Richard Dale <richard.dale@codethink.co.uk> | 2013-07-04 09:56:52 +0100 |
commit | acf9e50d52c4d09a1aed9490bb2f3c5de7dce9bb (patch) | |
tree | 5b05df5a9e67f397bc7629f0921bc30c64bcc03e /examples/quick/controls/text/src/documenthandler.h | |
parent | a7e874ddf3496766903fc88e52fb61573c3d3f74 (diff) | |
parent | aa4ddfd8443f07badc0899d835027e46c6e0dfd8 (diff) | |
download | qtquickcontrols-baserock/morph.tar.gz |
Merge v5.1.0 releasebaserock/morph
Diffstat (limited to 'examples/quick/controls/text/src/documenthandler.h')
-rw-r--r-- | examples/quick/controls/text/src/documenthandler.h | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/examples/quick/controls/text/src/documenthandler.h b/examples/quick/controls/text/src/documenthandler.h index c60bc1d5..a759c403 100644 --- a/examples/quick/controls/text/src/documenthandler.h +++ b/examples/quick/controls/text/src/documenthandler.h @@ -63,7 +63,8 @@ class DocumentHandler : public QObject Q_PROPERTY(int selectionStart READ selectionStart WRITE setSelectionStart NOTIFY selectionStartChanged) Q_PROPERTY(int selectionEnd READ selectionEnd WRITE setSelectionEnd NOTIFY selectionEndChanged) - Q_PROPERTY(QFont currentFont READ currentFont NOTIFY currentFontChanged) + Q_PROPERTY(QColor textColor READ textColor WRITE setTextColor NOTIFY textColorChanged) + Q_PROPERTY(QString fontFamily READ fontFamily WRITE setFontFamily NOTIFY fontFamilyChanged) Q_PROPERTY(Qt::Alignment alignment READ alignment WRITE setAlignment NOTIFY alignmentChanged) Q_PROPERTY(bool bold READ bold WRITE setBold NOTIFY boldChanged) @@ -93,7 +94,9 @@ public: int selectionStart() const { return m_selectionStart; } int selectionEnd() const { return m_selectionEnd; } - QFont currentFont() const; + QString fontFamily() const; + + QColor textColor() const; Qt::Alignment alignment() const; void setAlignment(Qt::Alignment a); @@ -114,6 +117,8 @@ public Q_SLOTS: void setItalic(bool arg); void setUnderline(bool arg); void setFontSize(int arg); + void setTextColor(const QColor &arg); + void setFontFamily(const QString &arg); void setFileUrl(const QUrl &arg); void setText(const QString &arg); @@ -126,7 +131,8 @@ Q_SIGNALS: void selectionStartChanged(); void selectionEndChanged(); - void currentFontChanged(); + void fontFamilyChanged(); + void textColorChanged(); void alignmentChanged(); void boldChanged(); @@ -142,6 +148,7 @@ Q_SIGNALS: void documentTitleChanged(); private: + void reset(); QTextCursor textCursor() const; void mergeFormatOnWordOrSelection(const QTextCharFormat &format); @@ -153,9 +160,6 @@ private: int m_selectionEnd; QFont m_font; - bool m_bold; - bool m_italic; - bool m_underline; int m_fontSize; QUrl m_fileUrl; QString m_text; |