diff options
author | Pierre Rossi <pierre.rossi@nokia.com> | 2010-07-22 15:53:59 (GMT) |
---|---|---|
committer | Pierre Rossi <pierre.rossi@nokia.com> | 2010-07-22 16:52:39 (GMT) |
commit | d9d877326b13c55dc33b1cac13f3ee70e8de62bf (patch) | |
tree | 64c798037a1d343280068619a1c9009f0f745594 /src | |
parent | c8bb76ec0b19da9e24512852dc8b00461e1a1b7b (diff) | |
download | Qt-d9d877326b13c55dc33b1cac13f3ee70e8de62bf.zip Qt-d9d877326b13c55dc33b1cac13f3ee70e8de62bf.tar.gz Qt-d9d877326b13c55dc33b1cac13f3ee70e8de62bf.tar.bz2 |
Make QPalette::operator== return false if the currentColorGroup differs
This was affecting QLineEdit's selected text color when the window is
inactive.
Task-number: QTBUG-697
Reviewed-by: ogoffart
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/kernel/qpalette.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/qlineedit.cpp | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/kernel/qpalette.cpp b/src/gui/kernel/qpalette.cpp index 98e8f66..910dfa9 100644 --- a/src/gui/kernel/qpalette.cpp +++ b/src/gui/kernel/qpalette.cpp @@ -876,6 +876,8 @@ void QPalette::detach() */ bool QPalette::operator==(const QPalette &p) const { + if (p.currentColorGroup() != current_group) + return false; if (isCopyOf(p)) return true; for(int grp = 0; grp < (int)NColorGroups; grp++) { diff --git a/src/gui/widgets/qlineedit.cpp b/src/gui/widgets/qlineedit.cpp index 1bffde1..98f0f44 100644 --- a/src/gui/widgets/qlineedit.cpp +++ b/src/gui/widgets/qlineedit.cpp @@ -1946,7 +1946,7 @@ 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->setPalette(pal); } |