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>
This commit is contained in:
Andrew den Exter 2011-11-04 18:07:04 +10:00 committed by Qt by Nokia
parent 9602887db1
commit db34625eae

View File

@ -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();
}