diff --git a/src/widgets/widgets/qwidgetlinecontrol_p.h b/src/widgets/widgets/qwidgetlinecontrol_p.h index a8fffd23dc4..357b5413629 100644 --- a/src/widgets/widgets/qwidgetlinecontrol_p.h +++ b/src/widgets/widgets/qwidgetlinecontrol_p.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtWidgets module of the Qt Toolkit. @@ -354,11 +354,8 @@ public: void setPasswordMaskDelay(int delay) { m_passwordMaskDelay = delay; } Qt::LayoutDirection layoutDirection() const { - if (m_layoutDirection == Qt::LayoutDirectionAuto) { - if (m_text.isEmpty()) - return QGuiApplication::inputMethod()->inputDirection(); + if (m_layoutDirection == Qt::LayoutDirectionAuto && !m_text.isEmpty()) return m_text.isRightToLeft() ? Qt::RightToLeft : Qt::LeftToRight; - } return m_layoutDirection; } void setLayoutDirection(Qt::LayoutDirection direction)