diff options
author | Alan Alpert <alan.alpert@nokia.com> | 2009-07-08 05:13:32 (GMT) |
---|---|---|
committer | Alan Alpert <alan.alpert@nokia.com> | 2009-07-08 05:13:32 (GMT) |
commit | 6259c9fbc4719994bd491271eba5c47143df67c6 (patch) | |
tree | 531ce3f4bdd6829c74f1021626a9d79236c45cfd /src/declarative/fx/qfxtextedit.cpp | |
parent | 07976c867308754f971f6196c155621667e05a54 (diff) | |
download | Qt-6259c9fbc4719994bd491271eba5c47143df67c6.zip Qt-6259c9fbc4719994bd491271eba5c47143df67c6.tar.gz Qt-6259c9fbc4719994bd491271eba5c47143df67c6.tar.bz2 |
Add highlightedTextColor property to the QFxTextEdit sophisticate
Diffstat (limited to 'src/declarative/fx/qfxtextedit.cpp')
-rw-r--r-- | src/declarative/fx/qfxtextedit.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/declarative/fx/qfxtextedit.cpp b/src/declarative/fx/qfxtextedit.cpp index bfcc17f..9854906 100644 --- a/src/declarative/fx/qfxtextedit.cpp +++ b/src/declarative/fx/qfxtextedit.cpp @@ -324,6 +324,36 @@ void QFxTextEdit::setHighlightColor(const QColor &color) } /*! + \qmlproperty color TextEdit::highlightedTextColor + + The highlighted text color, used in selections. +*/ + +/*! + \property QFxTextEdit::highlightedTextColor + \brief the text edit's default highlighted text color +*/ +QColor QFxTextEdit::highlightedTextColor() const +{ + Q_D(const QFxTextEdit); + return d->highlightColor; +} + +void QFxTextEdit::setHighlightedTextColor(const QColor &color) +{ + Q_D(QFxTextEdit); + if (d->highlightedTextColor == color) + return; + + clearCache(); + d->highlightedTextColor = color; + QPalette pal = d->control->palette(); + pal.setColor(QPalette::HighlightedText, color); + d->control->setPalette(pal); + update(); +} + +/*! \qmlproperty enumeration TextEdit::hAlign \qmlproperty enumeration TextEdit::vAlign |