summaryrefslogtreecommitdiff
path: root/src/gui/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/qlabel.cpp2
-rw-r--r--src/gui/widgets/qmenu.cpp5
2 files changed, 6 insertions, 1 deletions
diff --git a/src/gui/widgets/qlabel.cpp b/src/gui/widgets/qlabel.cpp
index 42be03b59a..011b07a8b4 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 4bea6de0e2..74c2a9e2b8 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;