diff options
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativetextinput.cpp | 1 | ||||
-rw-r--r-- | src/gui/widgets/qlinecontrol_p.h | 5 |
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) |