summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@digia.com>2013-04-17 13:54:10 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-04-18 09:18:43 +0200
commitacfccd048368ccbd8466c4332db62807712dd288 (patch)
treefedc9bbadb6b84c17a253714e5e8d209b819dd2e /tests
parent4c7881396edbb513b15f7f46af9553a3d7478dab (diff)
Fusion & GTK styles need to check direction from style option not qapp
An RTL menu containing a menu item which opens a submenu was showing the wrong arrow if the application's direction was not also RTL. So now the test for QTBUG-30595 can be simplified: no need to set the application direction, and therefore less chance of failure. Change-Id: Id140656206c6fefea3649289477dc54c77e2dd5e Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp21
1 files changed, 1 insertions, 20 deletions
diff --git a/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp b/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp
index 9fdb8de4b8..3c32b8a476 100644
--- a/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp
+++ b/tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp
@@ -897,29 +897,10 @@ void tst_QMenu::QTBUG7411_submenus_activate()
QTRY_VERIFY(sub1.isVisible());
}
-class LayoutDirectionSaver
-{
- Q_DISABLE_COPY(LayoutDirectionSaver)
-public:
- explicit LayoutDirectionSaver(Qt::LayoutDirection direction)
- : m_oldDirection(qApp->layoutDirection())
- {
- qApp->setLayoutDirection(direction);
- }
-
- ~LayoutDirectionSaver()
- {
- qApp->setLayoutDirection(m_oldDirection);
- }
-
-private:
- const Qt::LayoutDirection m_oldDirection;
-};
-
void tst_QMenu::QTBUG30595_rtl_submenu()
{
- LayoutDirectionSaver directionSaver(Qt::RightToLeft);
QMenu menu("Test Menu");
+ menu.setLayoutDirection(Qt::RightToLeft);
QMenu sub("&sub");
sub.addAction("bar");
sub.setTitle("&sub");