diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2009-09-17 07:19:14 (GMT) |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2009-09-17 07:19:14 (GMT) |
commit | 8be000bc99de86e0aed57bfb50036eaa695308e9 (patch) | |
tree | 9548b7a179beb2974d352720dab53727404caf91 /src/gui/widgets | |
parent | ebd0823fa2e8b1a19bff32a39c4051ba8535d501 (diff) | |
parent | dfcf988a3f0c88f96e202482e5d363d880b9d6d2 (diff) | |
download | Qt-8be000bc99de86e0aed57bfb50036eaa695308e9.zip Qt-8be000bc99de86e0aed57bfb50036eaa695308e9.tar.gz Qt-8be000bc99de86e0aed57bfb50036eaa695308e9.tar.bz2 |
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt
Diffstat (limited to 'src/gui/widgets')
-rw-r--r-- | src/gui/widgets/qdockwidget.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/qlinecontrol_p.h | 13 | ||||
-rw-r--r-- | src/gui/widgets/qlineedit.cpp | 13 | ||||
-rw-r--r-- | src/gui/widgets/qlineedit_p.cpp | 5 | ||||
-rw-r--r-- | src/gui/widgets/qmenubar.cpp | 4 | ||||
-rw-r--r-- | src/gui/widgets/qmenudata.h | 2 |
6 files changed, 32 insertions, 7 deletions
diff --git a/src/gui/widgets/qdockwidget.cpp b/src/gui/widgets/qdockwidget.cpp index 0e434be..a574262f 100644 --- a/src/gui/widgets/qdockwidget.cpp +++ b/src/gui/widgets/qdockwidget.cpp @@ -1136,7 +1136,7 @@ void QDockWidgetPrivate::setWindowState(bool floating, bool unplug, const QRect /*! \property QDockWidget::windowTitle - \internal + \brief the dock widget title (caption) By default, this property contains an empty string. */ 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 a55ca8e..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 @@ -2047,7 +2050,11 @@ void QLineEdit::changeEvent(QEvent *ev) d->control->setFont(font()); break; case QEvent::StyleChange: - d->control->setPasswordCharacter(style()->styleHint(QStyle::SH_LineEdit_PasswordCharacter)); + { + QStyleOptionFrameV2 opt; + initStyleOption(&opt); + d->control->setPasswordCharacter(style()->styleHint(QStyle::SH_LineEdit_PasswordCharacter, &opt, this)); + } update(); break; case QEvent::LayoutDirectionChange: diff --git a/src/gui/widgets/qlineedit_p.cpp b/src/gui/widgets/qlineedit_p.cpp index 4fe02a2..148da1b 100644 --- a/src/gui/widgets/qlineedit_p.cpp +++ b/src/gui/widgets/qlineedit_p.cpp @@ -159,7 +159,10 @@ void QLineEditPrivate::init(const QString& txt) QObject::connect(control, SIGNAL(updateNeeded(const QRect &)), q, SLOT(update())); - control->setPasswordCharacter(q->style()->styleHint(QStyle::SH_LineEdit_PasswordCharacter)); + + QStyleOptionFrameV2 opt; + q->initStyleOption(&opt); + control->setPasswordCharacter(q->style()->styleHint(QStyle::SH_LineEdit_PasswordCharacter, &opt, q)); #ifndef QT_NO_CURSOR q->setCursor(Qt::IBeamCursor); #endif diff --git a/src/gui/widgets/qmenubar.cpp b/src/gui/widgets/qmenubar.cpp index 8591a77..7b0f37e 100644 --- a/src/gui/widgets/qmenubar.cpp +++ b/src/gui/widgets/qmenubar.cpp @@ -1252,9 +1252,11 @@ void QMenuBar::keyPressEvent(QKeyEvent *e) void QMenuBar::mouseMoveEvent(QMouseEvent *e) { Q_D(QMenuBar); + if (!(e->buttons() & Qt::LeftButton)) + d->mouseDown = false; bool popupState = d->popupState || d->mouseDown; QAction *action = d->actionAt(e->pos()); - if (action && d->isVisible(action)) + if ((action && d->isVisible(action)) || !popupState) d->setCurrentAction(action, popupState); } diff --git a/src/gui/widgets/qmenudata.h b/src/gui/widgets/qmenudata.h index 69f0cbc..c9d8b47 100644 --- a/src/gui/widgets/qmenudata.h +++ b/src/gui/widgets/qmenudata.h @@ -68,7 +68,7 @@ private: void setId(int); void setSignalValue(int); - Q_DISABLE_COPY(QMenuItem); + Q_DISABLE_COPY(QMenuItem) }; QT_END_NAMESPACE |