From 96b5c28209f701f34f7d37a1f65d2ad4452b8f9a Mon Sep 17 00:00:00 2001 From: Matthew Woehlke Date: Mon, 12 May 2014 12:52:00 -0400 Subject: [PATCH] Fix QToolButton size glitch after adding menu Invalidate the cached size hint when changing the menu on a QToolButton. This is required because the correct size may be different for a button that has a menu versus one that does not; failure to recompute the size may result in incorrect display if the button's sizeHint() has been previously called. Bug 38949 --- src/gui/widgets/qtoolbutton.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/widgets/qtoolbutton.cpp b/src/gui/widgets/qtoolbutton.cpp index 1370fa8..ef736ef 100644 --- a/src/gui/widgets/qtoolbutton.cpp +++ b/src/gui/widgets/qtoolbutton.cpp @@ -833,6 +833,7 @@ void QToolButton::setMenu(QMenu* menu) } else { d->menuAction = 0; } + d->sizeHint = QSize(); update(); } -- 1.9.0