diff options
author | Pierre Rossi <pierre.rossi@nokia.com> | 2010-07-23 12:53:58 (GMT) |
---|---|---|
committer | Toby Tomkins <toby.tomkins@nokia.com> | 2010-07-27 00:10:00 (GMT) |
commit | a38bfb1807cb36240e0102935b23fe1ac474d035 (patch) | |
tree | 4702674ab981e6976140938a80d0952634d46222 /src/gui | |
parent | 18a2e097f09ecd68e9ea2a2a515d9358729188c2 (diff) | |
download | Qt-a38bfb1807cb36240e0102935b23fe1ac474d035.zip Qt-a38bfb1807cb36240e0102935b23fe1ac474d035.tar.gz Qt-a38bfb1807cb36240e0102935b23fe1ac474d035.tar.bz2 |
Fix QLineEdit's Highlight color when inactive.
This commit also updates QPalette's documentation regarding the current
ColorGroup and operator==.
Task-number: QTBUG-697
Reviewed-by: ogoffart
(cherry picked from commit 24cdab32de2abd8669f281dd54c8da1124514915)
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/kernel/qpalette.cpp | 10 | ||||
-rw-r--r-- | src/gui/widgets/qlineedit.cpp | 3 |
2 files changed, 12 insertions, 1 deletions
diff --git a/src/gui/kernel/qpalette.cpp b/src/gui/kernel/qpalette.cpp index 98e8f66..38ec806 100644 --- a/src/gui/kernel/qpalette.cpp +++ b/src/gui/kernel/qpalette.cpp @@ -868,11 +868,21 @@ void QPalette::detach() Returns true (slowly) if this palette is different from \a p; otherwise returns false (usually quickly). + + \note The current ColorGroup is not taken into account when + comparing palettes + + \sa operator== */ /*! Returns true (usually quickly) if this palette is equal to \a p; otherwise returns false (slowly). + + \note The current ColorGroup is not taken into account when + comparing palettes + + \sa operator!= */ bool QPalette::operator==(const QPalette &p) const { diff --git a/src/gui/widgets/qlineedit.cpp b/src/gui/widgets/qlineedit.cpp index 1bffde1..86e56bc 100644 --- a/src/gui/widgets/qlineedit.cpp +++ b/src/gui/widgets/qlineedit.cpp @@ -1946,7 +1946,8 @@ void QLineEdit::paintEvent(QPaintEvent *) if (d->control->hasSelectedText() || (d->cursorVisible && !d->control->inputMask().isEmpty() && !d->control->isReadOnly())){ flags |= QLineControl::DrawSelections; // Palette only used for selections/mask and may not be in sync - if(d->control->palette() != pal) + if (d->control->palette() != pal + || d->control->palette().currentColorGroup() != pal.currentColorGroup()) d->control->setPalette(pal); } |