diff options
author | Thierry Bastian <thierry.bastian@nokia.com> | 2009-08-04 09:16:01 (GMT) |
---|---|---|
committer | Thierry Bastian <thierry.bastian@nokia.com> | 2009-08-04 09:17:30 (GMT) |
commit | baf3ec81ca5d5cd38b54dc853c12109956a98cb9 (patch) | |
tree | 6d33abb0ef49ce8a761a6a85a88e378de616c701 /tests/auto | |
parent | 549736341a2268e33159949e076e0629abeb838a (diff) | |
download | Qt-baf3ec81ca5d5cd38b54dc853c12109956a98cb9.zip Qt-baf3ec81ca5d5cd38b54dc853c12109956a98cb9.tar.gz Qt-baf3ec81ca5d5cd38b54dc853c12109956a98cb9.tar.bz2 |
QMenu now takes minimum width into account for the action rects
The action now try to take advantage of the space given by a minimum
width. Patch proposed initially by Aron Seigo and improved later on.
Reviewed-by: Trustme
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/qmenu/tst_qmenu.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/auto/qmenu/tst_qmenu.cpp b/tests/auto/qmenu/tst_qmenu.cpp index ec9c7b4..6ba6466 100644 --- a/tests/auto/qmenu/tst_qmenu.cpp +++ b/tests/auto/qmenu/tst_qmenu.cpp @@ -96,6 +96,7 @@ private slots: void task256918_setFont(); void menuSizeHint(); void task258920_mouseBorder(); + void setFixedWidth(); protected slots: void onActivated(QAction*); void onHighlighted(QAction*); @@ -798,6 +799,17 @@ void tst_QMenu::task258920_mouseBorder() QVERIFY(menu.painted); } +void tst_QMenu::setFixedWidth() +{ + QMenu menu; + menu.addAction("action"); + menu.setFixedWidth(300); + //the sizehint should reflect the minimumwidth because the action will try to + //get as much space as possible + QCOMPARE(menu.sizeHint().width(), menu.minimumWidth()); +} + + QTEST_MAIN(tst_QMenu) #include "tst_qmenu.moc" |