diff options
author | Alan Alpert <alan.alpert@nokia.com> | 2009-09-15 23:57:55 (GMT) |
---|---|---|
committer | Alan Alpert <alan.alpert@nokia.com> | 2009-09-15 23:57:55 (GMT) |
commit | f380892b03fbb4cefc18b9ecc4edf27e88340b97 (patch) | |
tree | d36e9e11d495a6ca280310bf94c77eda30741295 /src/gui | |
parent | 21ecd608105ed576fd0c76b48c25e599cb160f32 (diff) | |
parent | c878fde1d0ddd54c8dff485e7c7146b3d8962fb9 (diff) | |
download | Qt-f380892b03fbb4cefc18b9ecc4edf27e88340b97.zip Qt-f380892b03fbb4cefc18b9ecc4edf27e88340b97.tar.gz Qt-f380892b03fbb4cefc18b9ecc4edf27e88340b97.tar.bz2 |
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into kinetic-declarativeui
Diffstat (limited to 'src/gui')
-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 |