From 39f9b5def185337b2087cadeb3e137dfbeb85fa4 Mon Sep 17 00:00:00 2001 From: Pekka Vuorela Date: Thu, 5 Jan 2012 16:33:56 +0200 Subject: Adapt to QInputPanel::inputDirection() API Information moved from QGuiApplication into QInputPanel. Change-Id: Idd80609f4b67bffae7222a1fa27918724ebf60f6 Reviewed-by: Joona Petrell --- tests/auto/qtquick2/qquicktextinput/tst_qquicktextinput.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests/auto/qtquick2/qquicktextinput/tst_qquicktextinput.cpp') diff --git a/tests/auto/qtquick2/qquicktextinput/tst_qquicktextinput.cpp b/tests/auto/qtquick2/qquicktextinput/tst_qquicktextinput.cpp index ac60ad30f9..fa81781404 100644 --- a/tests/auto/qtquick2/qquicktextinput/tst_qquicktextinput.cpp +++ b/tests/auto/qtquick2/qquicktextinput/tst_qquicktextinput.cpp @@ -1312,11 +1312,11 @@ void tst_qquicktextinput::horizontalAlignment_RightToLeft() { QInputMethodEvent ev; QGuiApplication::sendEvent(qGuiApp->inputPanel()->inputItem(), &ev); } // empty text with implicit alignment follows the system locale-based - // keyboard input direction from QGuiApplication::keyboardInputDirection + // keyboard input direction from QInputPanel::inputDirection() textInput->setText(""); - QCOMPARE(textInput->hAlign(), QGuiApplication::keyboardInputDirection() == Qt::LeftToRight ? + QCOMPARE(textInput->hAlign(), qApp->inputPanel()->inputDirection() == Qt::LeftToRight ? QQuickTextInput::AlignLeft : QQuickTextInput::AlignRight); - if (QGuiApplication::keyboardInputDirection() == Qt::LeftToRight) { + if (qApp->inputPanel()->inputDirection() == Qt::LeftToRight) { QCOMPARE(textInputPrivate->boundingRect.left() - textInputPrivate->hscroll, qreal(0)); } else { QVERIFY(textInputPrivate->boundingRect.right() - textInputPrivate->hscroll >= textInput->width() - 1); @@ -1331,7 +1331,7 @@ void tst_qquicktextinput::horizontalAlignment_RightToLeft() QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); QQuickTextInput *textObject = qobject_cast(textComponent.create()); - QCOMPARE(textObject->hAlign(), QGuiApplication::keyboardInputDirection() == Qt::LeftToRight ? + QCOMPARE(textObject->hAlign(), qApp->inputPanel()->inputDirection() == Qt::LeftToRight ? QQuickTextInput::AlignLeft : QQuickTextInput::AlignRight); delete textObject; } -- cgit v1.2.3