summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets/qlineedit.cpp
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2009-09-15 23:43:45 (GMT)
committerAlan Alpert <alan.alpert@nokia.com>2009-09-15 23:43:45 (GMT)
commitadfb5c6160b37a917f20b301366567c208ae52a0 (patch)
treec74ef9bb4b0fa56ab44b8ce7ff4762da886ac725 /src/gui/widgets/qlineedit.cpp
parentd94f6a35202d2d62671072b4ba78e75b07d630bd (diff)
downloadQt-adfb5c6160b37a917f20b301366567c208ae52a0.zip
Qt-adfb5c6160b37a917f20b301366567c208ae52a0.tar.gz
Qt-adfb5c6160b37a917f20b301366567c208ae52a0.tar.bz2
Fix QLineEdit::setPalette
QLineControl has a separate palette that wasn't getting updated. Task-number: 261239 Reviewed-by: mbm
Diffstat (limited to 'src/gui/widgets/qlineedit.cpp')
-rw-r--r--src/gui/widgets/qlineedit.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gui/widgets/qlineedit.cpp b/src/gui/widgets/qlineedit.cpp
index a55ca8e..b4cea1b 100644
--- a/src/gui/widgets/qlineedit.cpp
+++ b/src/gui/widgets/qlineedit.cpp
@@ -1851,8 +1851,12 @@ void QLineEdit::paintEvent(QPaintEvent *)
#ifdef QT_KEYPAD_NAVIGATION
if (!QApplication::keypadNavigationEnabled() || hasEditFocus())
#endif
- if (d->control->hasSelectedText() || (d->cursorVisible && !d->control->inputMask().isEmpty() && !d->control->isReadOnly()))
+ 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)
+ d->control->setPalette(pal);
+ }
// Asian users see an IM selection text as cursor on candidate
// selection phase of input method, so the ordinary cursor should be