diff options
author | Pekka Vuorela <pekka.ta.vuorela@nokia.com> | 2012-01-09 13:41:36 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-01-17 13:15:30 +0100 |
commit | 6a5b9cb96434b5e36646fdbe66b23d0c6a1bdcd1 (patch) | |
tree | e9f7543f6423862f9a688f5d82a0c6b03711ed2f /tests/auto/shared | |
parent | dc7aecd0886db44f7729f16b42ea4a6be622f3ba (diff) |
Made QQuickTextInput follow input direction changes
Cursor of empty field should align based on input method
direction. Now input method allowed to change direction
on run time.
Also earlier cursor wasn't properly drawn on correct alignment
at all.
Change-Id: I4601f10e6b5dde09591bd484b05f001add6c1573
Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
Diffstat (limited to 'tests/auto/shared')
-rw-r--r-- | tests/auto/shared/platforminputcontext.h | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/tests/auto/shared/platforminputcontext.h b/tests/auto/shared/platforminputcontext.h index db5083725b..0c23db4dd9 100644 --- a/tests/auto/shared/platforminputcontext.h +++ b/tests/auto/shared/platforminputcontext.h @@ -48,7 +48,7 @@ public: PlatformInputContext() : m_visible(false), m_action(QInputPanel::Click), m_cursorPosition(0), m_invokeActionCallCount(0), m_showInputPanelCallCount(0), m_hideInputPanelCallCount(0), - m_updateCallCount(0) + m_updateCallCount(0), m_direction(Qt::LeftToRight) { } @@ -77,6 +77,25 @@ public: m_updateCallCount++; } + virtual QLocale locale() const + { + if (m_direction == Qt::RightToLeft) + return QLocale(QLocale::Arabic); + else + return QLocale(QLocale::English); + } + + virtual Qt::LayoutDirection inputDirection() const + { + return m_direction; + } + + void setInputDirection(Qt::LayoutDirection direction) { + m_direction = direction; + emitLocaleChanged(); + emitInputDirectionChanged(inputDirection()); + } + void clear() { m_cursorPosition = 0; m_invokeActionCallCount = 0; @@ -93,4 +112,5 @@ public: int m_showInputPanelCallCount; int m_hideInputPanelCallCount; int m_updateCallCount; + Qt::LayoutDirection m_direction; }; |