diff options
author | A-Team <ateam@pad.test.qt.nokia.com> | 2010-12-09 23:00:17 (GMT) |
---|---|---|
committer | A-Team <ateam@pad.test.qt.nokia.com> | 2010-12-09 23:00:17 (GMT) |
commit | a18714105029a54b4a3814d8e2e5ac2d45c233e9 (patch) | |
tree | ca4955ea1b56c1d9c3cf8ed0805c66405cd384b3 /src/gui/widgets | |
parent | 3b20e58b9494549713b492e35af6531b4bc179c9 (diff) | |
parent | 460d52bfa85318610576d1ab75eae4799865e064 (diff) | |
download | Qt-a18714105029a54b4a3814d8e2e5ac2d45c233e9.zip Qt-a18714105029a54b4a3814d8e2e5ac2d45c233e9.tar.gz Qt-a18714105029a54b4a3814d8e2e5ac2d45c233e9.tar.bz2 |
Merge branch '4.7-upstream' into 4.7-doc
Diffstat (limited to 'src/gui/widgets')
-rw-r--r-- | src/gui/widgets/qlabel.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/qmenu.cpp | 5 |
2 files changed, 6 insertions, 1 deletions
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/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; |