diff options
author | Andrew den Exter <andrew.den-exter@nokia.com> | 2011-11-04 18:07:04 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-11-07 01:11:30 +0100 |
commit | db34625eaef8eec373a0427f81e91a414dbd05da (patch) | |
tree | 31bb7191d367765b416e8a93e29bb9a0addfd22d /src/gui/text | |
parent | 9602887db1008d85887a9a96a8b5e0487a0542bc (diff) |
Fix QQuickTextInput implicit width.
QQuickTextInput tries to set the UseDesignMetrics text option on its
QLineControl but this is overridden by the options set in
updateDisplayText(). Apply the new options in updateDisplayText to
the existing options.
Change-Id: I6789c3c2d6e496c1594d586bd075473983978f77
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'src/gui/text')
-rw-r--r-- | src/gui/text/qlinecontrol.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/text/qlinecontrol.cpp b/src/gui/text/qlinecontrol.cpp index 40452a94c2..438300d3bc 100644 --- a/src/gui/text/qlinecontrol.cpp +++ b/src/gui/text/qlinecontrol.cpp @@ -92,7 +92,7 @@ void QLineControl::updateDisplayText(bool forceUpdate) m_textLayout.setText(str); - QTextOption option; + QTextOption option = m_textLayout.textOption(); option.setTextDirection(m_layoutDirection); option.setFlags(QTextOption::IncludeTrailingSpaces); m_textLayout.setTextOption(option); @@ -297,6 +297,7 @@ void QLineControl::_q_deleteSelected() void QLineControl::init(const QString &txt) { m_text = txt; + updateDisplayText(); m_cursor = m_text.length(); } |