diff options
author | David Boddie <david.boddie@nokia.com> | 2010-12-15 13:15:13 (GMT) |
---|---|---|
committer | David Boddie <david.boddie@nokia.com> | 2010-12-15 13:15:13 (GMT) |
commit | b5b3e65f6e0392239621a3888d9aa58746f3899e (patch) | |
tree | 5c33473950b22db0a0eb9c230005cd8e7f251538 /src/gui/widgets | |
parent | cace8e6a9f00ee478dfe63a7fa6959056cfe7e8a (diff) | |
parent | 0c6780c39d18a4fd06b9bed94400de365a518c45 (diff) | |
download | Qt-b5b3e65f6e0392239621a3888d9aa58746f3899e.zip Qt-b5b3e65f6e0392239621a3888d9aa58746f3899e.tar.gz Qt-b5b3e65f6e0392239621a3888d9aa58746f3899e.tar.bz2 |
Merge branch '4.7' into qdoc-simplified
Diffstat (limited to 'src/gui/widgets')
-rw-r--r-- | src/gui/widgets/qcombobox.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/qlabel.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/qlinecontrol.cpp | 9 | ||||
-rw-r--r-- | src/gui/widgets/qlinecontrol_p.h | 1 | ||||
-rw-r--r-- | src/gui/widgets/qmenu.cpp | 5 |
5 files changed, 17 insertions, 2 deletions
diff --git a/src/gui/widgets/qcombobox.cpp b/src/gui/widgets/qcombobox.cpp index 7859bdc..5a4e507 100644 --- a/src/gui/widgets/qcombobox.cpp +++ b/src/gui/widgets/qcombobox.cpp @@ -398,7 +398,7 @@ void QComboBoxPrivateContainer::leaveEvent(QEvent *) #ifdef Q_WS_MAC QStyleOptionComboBox opt = comboStyleOption(); if (combo->style()->styleHint(QStyle::SH_ComboBox_Popup, &opt, combo)) - view->clearSelection(); + view->setCurrentIndex(QModelIndex()); #endif } diff --git a/src/gui/widgets/qlabel.cpp b/src/gui/widgets/qlabel.cpp index 42be03b..011b07a 100644 --- a/src/gui/widgets/qlabel.cpp +++ b/src/gui/widgets/qlabel.cpp @@ -682,7 +682,7 @@ QSize QLabelPrivate::sizeForWidth(int w) const bool tryWidth = (w < 0) && (align & Qt::TextWordWrap); if (tryWidth) - w = fm.averageCharWidth() * 80; + w = qMin(fm.averageCharWidth() * 80, q->maximumSize().width()); else if (w < 0) w = 2000; w -= (hextra + contentsMargin.width()); diff --git a/src/gui/widgets/qlinecontrol.cpp b/src/gui/widgets/qlinecontrol.cpp index f338f40..5ea9dc4 100644 --- a/src/gui/widgets/qlinecontrol.cpp +++ b/src/gui/widgets/qlinecontrol.cpp @@ -1308,6 +1308,15 @@ void QLineControl::setCursorBlinkPeriod(int msec) m_blinkPeriod = msec; } +void QLineControl::resetCursorBlinkTimer() +{ + if (m_blinkPeriod == 0 || m_blinkTimer == 0) + return; + killTimer(m_blinkTimer); + m_blinkTimer = startTimer(m_blinkPeriod / 2); + m_blinkStatus = 1; +} + void QLineControl::timerEvent(QTimerEvent *event) { if (event->timerId() == m_blinkTimer) { diff --git a/src/gui/widgets/qlinecontrol_p.h b/src/gui/widgets/qlinecontrol_p.h index 7068f62..d881acf 100644 --- a/src/gui/widgets/qlinecontrol_p.h +++ b/src/gui/widgets/qlinecontrol_p.h @@ -296,6 +296,7 @@ public: int cursorBlinkPeriod() const { return m_blinkPeriod; } void setCursorBlinkPeriod(int msec); + void resetCursorBlinkTimer(); QString cancelText() const { return m_cancelText; } void setCancelText(const QString &text) { m_cancelText = text; } diff --git a/src/gui/widgets/qmenu.cpp b/src/gui/widgets/qmenu.cpp index 4bea6de..74c2a9e 100644 --- a/src/gui/widgets/qmenu.cpp +++ b/src/gui/widgets/qmenu.cpp @@ -1320,6 +1320,9 @@ void QMenu::initStyleOption(QStyleOptionMenuItem *option, const QAction *action) Conversely, actions can be added to widgets with the addAction(), addActions() and insertAction() functions. + \warning To make QMenu visible on the screen, exec() or popup() should be + used instead of show(). + \section1 QMenu on Qt for Windows CE If a menu is integrated into the native menubar on Windows Mobile we @@ -1795,10 +1798,12 @@ QSize QMenu::sizeHint() const void QMenu::popup(const QPoint &p, QAction *atAction) { Q_D(QMenu); +#ifndef Q_OS_SYMBIAN if (d->scroll) { // reset scroll state from last popup d->scroll->scrollOffset = 0; d->scroll->scrollFlags = QMenuPrivate::QMenuScroller::ScrollNone; } +#endif d->tearoffHighlighted = 0; d->motions = 0; d->doChildEffects = true; |