summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@nokia.com>2010-06-05 21:21:59 (GMT)
committerLars Knoll <lars.knoll@nokia.com>2010-06-09 22:08:10 (GMT)
commitb69e592b2b8fb3eae75c112e491e3ed90fc0248a (patch)
treeaa4dbf568608d50c3cb1535982c41f031194af24 /src/gui/widgets
parent2ae3d17883c0b24f7f4a5a1ea763105a2c8a7342 (diff)
downloadQt-b69e592b2b8fb3eae75c112e491e3ed90fc0248a.zip
Qt-b69e592b2b8fb3eae75c112e491e3ed90fc0248a.tar.gz
Qt-b69e592b2b8fb3eae75c112e491e3ed90fc0248a.tar.bz2
For an empty line edit the cursor position is depending on input language
Ensure the cursor is on the right if the keyboard layout is for a right to left language. Task-number: Part of Qt-3292 Reviewed-by: Simon Hausmann
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/qlinecontrol_p.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/widgets/qlinecontrol_p.h b/src/gui/widgets/qlinecontrol_p.h
index b419adf..7068f62 100644
--- a/src/gui/widgets/qlinecontrol_p.h
+++ b/src/gui/widgets/qlinecontrol_p.h
@@ -273,8 +273,11 @@ public:
void setPasswordCharacter(const QChar &character) { m_passwordCharacter = character; updateDisplayText(); }
Qt::LayoutDirection layoutDirection() const {
- if (m_layoutDirection == Qt::LayoutDirectionAuto)
+ if (m_layoutDirection == Qt::LayoutDirectionAuto) {
+ if (m_text.isEmpty())
+ return QApplication::keyboardInputDirection();
return m_text.isRightToLeft() ? Qt::RightToLeft : Qt::LeftToRight;
+ }
return m_layoutDirection;
}
void setLayoutDirection(Qt::LayoutDirection direction)