summaryrefslogtreecommitdiffstats
path: root/tests/auto/qmenu
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-06-25 14:41:26 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2009-06-25 14:42:44 (GMT)
commitb393abc9ce2e2a5396e655895fe653f9e06e355f (patch)
tree18d7097c936f6db6fb71eb9fbefe96c124a7acc3 /tests/auto/qmenu
parent3e36b311710009039e8ffdfa46702e012f25785b (diff)
downloadQt-b393abc9ce2e2a5396e655895fe653f9e06e355f.zip
Qt-b393abc9ce2e2a5396e655895fe653f9e06e355f.tar.gz
Qt-b393abc9ce2e2a5396e655895fe653f9e06e355f.tar.bz2
QMenu: Fixed geometry for actions with specific font
Task-number: 256918
Diffstat (limited to 'tests/auto/qmenu')
-rw-r--r--tests/auto/qmenu/tst_qmenu.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/qmenu/tst_qmenu.cpp b/tests/auto/qmenu/tst_qmenu.cpp
index 2fb9b8b..e431961 100644
--- a/tests/auto/qmenu/tst_qmenu.cpp
+++ b/tests/auto/qmenu/tst_qmenu.cpp
@@ -93,6 +93,7 @@ private slots:
void task242454_sizeHint();
void task176201_clear();
void task250673_activeMutliColumnSubMenuPosition();
+ void task256918_setFont();
protected slots:
void onActivated(QAction*);
void onHighlighted(QAction*);
@@ -713,5 +714,19 @@ void tst_QMenu::task250673_activeMutliColumnSubMenuPosition()
const int subMenuOffset = main.style()->pixelMetric(QStyle::PM_SubMenuOverlap, 0, &main);
QVERIFY((sub.geometry().left() - subMenuOffset + 5) < main.geometry().right());
}
+
+
+void tst_QMenu::task256918_setFont()
+{
+ QMenu menu;
+ QAction *action = menu.addAction("foo");
+ QFont f;
+ f.setPointSize(30);
+ action->setFont(f);
+ menu.show(); //ensures that the actiongeometry are calculated
+ QVERIFY(menu.actionGeometry(action).height() > f.pointSize());
+}
+
+
QTEST_MAIN(tst_QMenu)
#include "tst_qmenu.moc"