summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets/qlinecontrol_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets/qlinecontrol_p.h')
-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)