tst_qcolumnview: Set layout direction on widgets instead of application.

Most of the test is executed in RTL mode since it is never restored.

Task-number: QTBUG-36395
Change-Id: I110966085a5a265f093fc4479eebc1f1bf0614c1
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
bb10
Friedemann Kleint 2014-01-23 16:28:30 +01:00 committed by The Qt Project
parent 4c980d2e9b
commit 0841a5e367
1 changed files with 8 additions and 9 deletions

View File

@ -370,9 +370,9 @@ void tst_QColumnView::scrollContentsBy_data()
void tst_QColumnView::scrollContentsBy()
{
QFETCH(bool, reverse);
if (reverse)
qApp->setLayoutDirection(Qt::RightToLeft);
ColumnView view;
if (reverse)
view.setLayoutDirection(Qt::RightToLeft);
view.ScrollContentsBy(-1, -1);
view.ScrollContentsBy(0, 0);
@ -405,9 +405,9 @@ void tst_QColumnView::scrollTo()
{
QFETCH(bool, reverse);
QFETCH(bool, giveFocus);
if (reverse)
qApp->setLayoutDirection(Qt::RightToLeft);
QWidget topLevel;
if (reverse)
topLevel.setLayoutDirection(Qt::RightToLeft);
ColumnView view(&topLevel);
view.resize(200, 200);
topLevel.show();
@ -514,10 +514,9 @@ void tst_QColumnView::moveCursor_data()
void tst_QColumnView::moveCursor()
{
QFETCH(bool, reverse);
if (reverse)
qApp->setLayoutDirection(Qt::RightToLeft);
ColumnView view;
if (reverse)
view.setLayoutDirection(Qt::RightToLeft);
// don't crash
view.MoveCursor(ColumnView::MoveUp, Qt::NoModifier);
@ -722,9 +721,9 @@ void tst_QColumnView::moveGrip_data()
void tst_QColumnView::moveGrip()
{
QFETCH(bool, reverse);
if (reverse)
qApp->setLayoutDirection(Qt::RightToLeft);
QWidget topLevel;
if (reverse)
topLevel.setLayoutDirection(Qt::RightToLeft);
ColumnView view(&topLevel);
TreeModel model;
view.setModel(&model);