diff options
author | Pekka Vuorela <pekka.ta.vuorela@nokia.com> | 2012-01-05 16:33:56 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-01-12 16:21:35 +0100 |
commit | 39f9b5def185337b2087cadeb3e137dfbeb85fa4 (patch) | |
tree | bb401cd8846ad29ecfe0b5f4c4bcfe12c101c3c0 /tests/auto/qtquick1 | |
parent | be1534e5df82561842d1847f90f1cab9462e10ef (diff) |
Adapt to QInputPanel::inputDirection() API
Information moved from QGuiApplication into QInputPanel.
Change-Id: Idd80609f4b67bffae7222a1fa27918724ebf60f6
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
Diffstat (limited to 'tests/auto/qtquick1')
3 files changed, 11 insertions, 11 deletions
diff --git a/tests/auto/qtquick1/qdeclarativetext/tst_qdeclarativetext.cpp b/tests/auto/qtquick1/qdeclarativetext/tst_qdeclarativetext.cpp index 65c1d4e5cb..fa49cd8595 100644 --- a/tests/auto/qtquick1/qdeclarativetext/tst_qdeclarativetext.cpp +++ b/tests/auto/qtquick1/qdeclarativetext/tst_qdeclarativetext.cpp @@ -636,9 +636,9 @@ void tst_qdeclarativetext::horizontalAlignment_RightToLeft() #ifndef Q_OS_MAC // QTBUG-18040 // empty text with implicit alignment follows the system locale-based - // keyboard input direction from QApplication::keyboardInputDirection + // keyboard input direction from QInputpanel::inputDirection text->setText(""); - QCOMPARE(text->hAlign(), QApplication::keyboardInputDirection() == Qt::LeftToRight ? + QCOMPARE(text->hAlign(), qApp->inputPanel()->inputDirection() == Qt::LeftToRight ? QDeclarative1Text::AlignLeft : QDeclarative1Text::AlignRight); text->setHAlign(QDeclarative1Text::AlignRight); QCOMPARE(text->hAlign(), QDeclarative1Text::AlignRight); @@ -652,7 +652,7 @@ void tst_qdeclarativetext::horizontalAlignment_RightToLeft() QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); QDeclarative1Text *textObject = qobject_cast<QDeclarative1Text*>(textComponent.create()); - QCOMPARE(textObject->hAlign(), QApplication::keyboardInputDirection() == Qt::LeftToRight ? + QCOMPARE(textObject->hAlign(), qApp->inputPanel()->inputDirection() == Qt::LeftToRight ? QDeclarative1Text::AlignLeft : QDeclarative1Text::AlignRight); delete textObject; #endif diff --git a/tests/auto/qtquick1/qdeclarativetextedit/tst_qdeclarativetextedit.cpp b/tests/auto/qtquick1/qdeclarativetextedit/tst_qdeclarativetextedit.cpp index 9d9dd89edb..39ca3cf5fd 100644 --- a/tests/auto/qtquick1/qdeclarativetextedit/tst_qdeclarativetextedit.cpp +++ b/tests/auto/qtquick1/qdeclarativetextedit/tst_qdeclarativetextedit.cpp @@ -558,11 +558,11 @@ void tst_qdeclarativetextedit::hAlign_RightToLeft() #ifndef Q_OS_MAC // QTBUG-18040 // empty text with implicit alignment follows the system locale-based - // keyboard input direction from QApplication::keyboardInputDirection + // keyboard input direction from QInputPanel::inputDirection textEdit->setText(""); - QCOMPARE(textEdit->hAlign(), QApplication::keyboardInputDirection() == Qt::LeftToRight ? + QCOMPARE(textEdit->hAlign(), qApp->inputPanel()->inputDirection() == Qt::LeftToRight ? QDeclarative1TextEdit::AlignLeft : QDeclarative1TextEdit::AlignRight); - if (QApplication::keyboardInputDirection() == Qt::LeftToRight) + if (qApp->inputPanel()->inputDirection() == Qt::LeftToRight) QVERIFY(textEdit->positionToRectangle(0).x() < canvas->width()/2); else QVERIFY(textEdit->positionToRectangle(0).x() > canvas->width()/2); @@ -579,7 +579,7 @@ void tst_qdeclarativetextedit::hAlign_RightToLeft() QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); QDeclarative1TextEdit *textObject = qobject_cast<QDeclarative1TextEdit*>(textComponent.create()); - QCOMPARE(textObject->hAlign(), QApplication::keyboardInputDirection() == Qt::LeftToRight ? + QCOMPARE(textObject->hAlign(), qApp->inputPanel()->inputDirection() == Qt::LeftToRight ? QDeclarative1TextEdit::AlignLeft : QDeclarative1TextEdit::AlignRight); delete textObject; #endif diff --git a/tests/auto/qtquick1/qdeclarativetextinput/tst_qdeclarativetextinput.cpp b/tests/auto/qtquick1/qdeclarativetextinput/tst_qdeclarativetextinput.cpp index ee6c0d3c2e..8355525314 100644 --- a/tests/auto/qtquick1/qdeclarativetextinput/tst_qdeclarativetextinput.cpp +++ b/tests/auto/qtquick1/qdeclarativetextinput/tst_qdeclarativetextinput.cpp @@ -1300,11 +1300,11 @@ void tst_qdeclarativetextinput::horizontalAlignment_RightToLeft() #ifndef Q_OS_MAC // QTBUG-18040 // empty text with implicit alignment follows the system locale-based - // keyboard input direction from QApplication::keyboardInputDirection + // keyboard input direction from QInputPanel::inputDirection textInput->setText(""); - QCOMPARE(textInput->hAlign(), QApplication::keyboardInputDirection() == Qt::LeftToRight ? + QCOMPARE(textInput->hAlign(), qApp->inputPanel()->inputDirection() == Qt::LeftToRight ? QDeclarative1TextInput::AlignLeft : QDeclarative1TextInput::AlignRight); - if (QApplication::keyboardInputDirection() == Qt::LeftToRight) + if (qApp->inputPanel()->inputDirection() == Qt::LeftToRight) QVERIFY(-textInputPrivate->hscroll < canvas->width()/2); else QVERIFY(-textInputPrivate->hscroll > canvas->width()/2); @@ -1321,7 +1321,7 @@ void tst_qdeclarativetextinput::horizontalAlignment_RightToLeft() QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); QDeclarative1TextInput *textObject = qobject_cast<QDeclarative1TextInput*>(textComponent.create()); - QCOMPARE(textObject->hAlign(), QApplication::keyboardInputDirection() == Qt::LeftToRight ? + QCOMPARE(textObject->hAlign(), qApp->inputPanel()->inputDirection() == Qt::LeftToRight ? QDeclarative1TextInput::AlignLeft : QDeclarative1TextInput::AlignRight); delete textObject; #endif |