diff options
Diffstat (limited to 'tests/auto')
3 files changed, 11 insertions, 23 deletions
diff --git a/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp b/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp index 6c9998e..2aeb425 100644 --- a/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp +++ b/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp @@ -547,15 +547,11 @@ void tst_qdeclarativetext::horizontalAlignment_RightToLeft() QCOMPARE(text->hAlign(), QDeclarativeText::AlignLeft); QVERIFY(textPrivate->layout.lineAt(0).x() < canvas->width()/2); - // empty text should implicitly follow the layout direction - QApplication::setLayoutDirection(Qt::RightToLeft); + // empty text is also implicitly left aligned text->setText(""); - QCOMPARE(text->hAlign(), QDeclarativeText::AlignRight); - text->setHAlign(QDeclarativeText::AlignLeft); QCOMPARE(text->hAlign(), QDeclarativeText::AlignLeft); - - // set layout direction back to LTR to avoid affecting other autotests - QApplication::setLayoutDirection(Qt::LeftToRight); + text->setHAlign(QDeclarativeText::AlignRight); + QCOMPARE(text->hAlign(), QDeclarativeText::AlignRight); delete canvas; } diff --git a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp index 6d5750f..ff52167 100644 --- a/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp +++ b/tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp @@ -474,17 +474,13 @@ void tst_qdeclarativetextedit::hAlign_RightToLeft() QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignLeft); QVERIFY(textEdit->positionToRectangle(0).x() < canvas->width()/2); - // empty text should implicitly follow the layout direction - QApplication::setLayoutDirection(Qt::RightToLeft); + // empty text is also implicitly left aligned textEdit->setText(""); - QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignRight); - QVERIFY(textEdit->positionToRectangle(0).x() > canvas->width()/2); - textEdit->setHAlign(QDeclarativeTextEdit::AlignLeft); QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignLeft); QVERIFY(textEdit->positionToRectangle(0).x() < canvas->width()/2); - - // set layout direction back to LTR to avoid affecting other autotests - QApplication::setLayoutDirection(Qt::LeftToRight); + textEdit->setHAlign(QDeclarativeTextEdit::AlignRight); + QCOMPARE(textEdit->hAlign(), QDeclarativeTextEdit::AlignRight); + QVERIFY(textEdit->positionToRectangle(0).x() > canvas->width()/2); delete canvas; } diff --git a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp index 72e8b11..666bbc8 100644 --- a/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp +++ b/tests/auto/declarative/qdeclarativetextinput/tst_qdeclarativetextinput.cpp @@ -1078,17 +1078,13 @@ void tst_qdeclarativetextinput::horizontalAlignment_RightToLeft() QCOMPARE(textInput->hAlign(), QDeclarativeTextInput::AlignLeft); QVERIFY(-textInputPrivate->hscroll < canvas->width()/2); - // empty text should implicitly follow the layout direction - QApplication::setLayoutDirection(Qt::RightToLeft); + // empty text is also implicitly left aligned textInput->setText(""); - QCOMPARE(textInput->hAlign(), QDeclarativeTextInput::AlignRight); - QVERIFY(-textInputPrivate->hscroll > canvas->width()/2); - textInput->setHAlign(QDeclarativeTextInput::AlignLeft); QCOMPARE(textInput->hAlign(), QDeclarativeTextInput::AlignLeft); QVERIFY(-textInputPrivate->hscroll < canvas->width()/2); - - // set layout direction back to LTR to avoid affecting other autotests - QApplication::setLayoutDirection(Qt::LeftToRight); + textInput->setHAlign(QDeclarativeTextInput::AlignRight); + QCOMPARE(textInput->hAlign(), QDeclarativeTextInput::AlignRight); + QVERIFY(-textInputPrivate->hscroll > canvas->width()/2); delete canvas; } |