diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2009-05-08 03:09:56 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2009-05-08 03:09:56 (GMT) |
commit | beab75abef7dfb221418ca3b3e04e918f175d32f (patch) | |
tree | ba879816151b44791822aa8840f0451b3e5fad67 /src/declarative/fx/qfxtextedit.cpp | |
parent | 6597cb980c484c11554314d8db63c6dd4edcd887 (diff) | |
download | Qt-beab75abef7dfb221418ca3b3e04e918f175d32f.zip Qt-beab75abef7dfb221418ca3b3e04e918f175d32f.tar.gz Qt-beab75abef7dfb221418ca3b3e04e918f175d32f.tar.bz2 |
highlight color property
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 3bc9696..fb46a0e 100644 --- a/src/declarative/fx/qfxtextedit.cpp +++ b/src/declarative/fx/qfxtextedit.cpp @@ -292,6 +292,36 @@ void QFxTextEdit::setColor(const QColor &color) } /*! + \qmlproperty color TextEdit::highlightColor + + The text highlight color, used behind selections. +*/ + +/*! + \property QFxTextEdit::highlightColor + \brief the text edit's default text highlight color +*/ +QColor QFxTextEdit::highlightColor() const +{ + Q_D(const QFxTextEdit); + return d->highlightColor; +} + +void QFxTextEdit::setHighlightColor(const QColor &color) +{ + Q_D(QFxTextEdit); + if (d->highlightColor == color) + return; + + clearCache(); + d->highlightColor = color; + QPalette pal = d->control->palette(); + pal.setColor(QPalette::Highlight, color); + d->control->setPalette(pal); + update(); +} + +/*! \qmlproperty enumeration TextEdit::hAlign \qmlproperty enumeration TextEdit::vAlign |