diff options
author | Rhys Weatherley <rhys.weatherley@nokia.com> | 2009-09-16 01:13:21 (GMT) |
---|---|---|
committer | Rhys Weatherley <rhys.weatherley@nokia.com> | 2009-09-16 01:13:21 (GMT) |
commit | a4571547a38d68d6778bf0ebfa4dc26cc3d865a3 (patch) | |
tree | 47b86720acd0b786e4c78409ded0e2053ec4a6eb /src | |
parent | dd6cf1a26fdf371a2cd394bd282b6190458e961a (diff) | |
parent | c878fde1d0ddd54c8dff485e7c7146b3d8962fb9 (diff) | |
download | Qt-a4571547a38d68d6778bf0ebfa4dc26cc3d865a3.zip Qt-a4571547a38d68d6778bf0ebfa4dc26cc3d865a3.tar.gz Qt-a4571547a38d68d6778bf0ebfa4dc26cc3d865a3.tar.bz2 |
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/widgets/qlinecontrol_p.h | 13 | ||||
-rw-r--r-- | src/gui/widgets/qlineedit.cpp | 7 |
2 files changed, 18 insertions, 2 deletions
diff --git a/src/gui/widgets/qlinecontrol_p.h b/src/gui/widgets/qlinecontrol_p.h index 8ad0452..68898b6 100644 --- a/src/gui/widgets/qlinecontrol_p.h +++ b/src/gui/widgets/qlinecontrol_p.h @@ -220,6 +220,9 @@ public: QString cancelText() const; void setCancelText(const QString &text); + const QPalette &palette() const; + void setPalette(const QPalette &); + enum DrawFlags { DrawText = 0x01, DrawSelections = 0x02, @@ -741,6 +744,16 @@ inline void QLineControl::setCancelText(const QString &text) m_cancelText = text; } +inline const QPalette & QLineControl::palette() const +{ + return m_palette; +} + +inline void QLineControl::setPalette(const QPalette &p) +{ + m_palette = p; +} + QT_END_NAMESPACE QT_END_HEADER diff --git a/src/gui/widgets/qlineedit.cpp b/src/gui/widgets/qlineedit.cpp index 37e57cf..629e839 100644 --- a/src/gui/widgets/qlineedit.cpp +++ b/src/gui/widgets/qlineedit.cpp @@ -1434,7 +1434,6 @@ void QLineEdit::mousePressEvent(QMouseEvent* e) #ifndef QT_NO_DRAGANDDROP if (!mark && d->dragEnabled && d->control->echoMode() == Normal && e->button() == Qt::LeftButton && d->control->inSelection(e->pos().x())) { - d->control->moveCursor(cursor); d->dndPos = e->pos(); if (!d->dndTimer.isActive()) d->dndTimer.start(QApplication::startDragTime(), this); @@ -1851,8 +1850,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 |