summaryrefslogtreecommitdiffstats
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
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
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextinput.cpp1
-rw-r--r--src/gui/widgets/qlinecontrol_p.h5
2 files changed, 4 insertions, 2 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativetextinput.cpp b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
index 1202101..8d320f4 100644
--- a/src/declarative/graphicsitems/qdeclarativetextinput.cpp
+++ b/src/declarative/graphicsitems/qdeclarativetextinput.cpp
@@ -1356,7 +1356,6 @@ void QDeclarativeTextInputPrivate::init()
Q_Q(QDeclarativeTextInput);
control->setCursorWidth(1);
control->setPasswordCharacter(QLatin1Char('*'));
- control->setLayoutDirection(Qt::LeftToRight);
q->setSmooth(smooth);
q->setAcceptedMouseButtons(Qt::LeftButton);
q->setFlag(QGraphicsItem::ItemHasNoContents, false);
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)