From ffab396a1d3a6054fca6c2727cd685ea89dada0e Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Thu, 8 Nov 2012 15:04:22 +0100 Subject: Don't use design metrics with NativeRendering on TextInput We only set the design metrics property in init(), before the renderType has been set. Since updateLayout() is called every time the renderType changes, it should be sufficient to set it there. Change-Id: If5b2cb3738e8135195848857a30f4e646bdf1d0b Reviewed-by: Jens Bache-Wiig --- src/quick/items/qquicktextinput.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/quick/items/qquicktextinput.cpp b/src/quick/items/qquicktextinput.cpp index 22551c9d4c..88e6d750eb 100644 --- a/src/quick/items/qquicktextinput.cpp +++ b/src/quick/items/qquicktextinput.cpp @@ -2698,6 +2698,9 @@ void QQuickTextInputPrivate::updateLayout() option.setTextDirection(layoutDirection()); option.setWrapMode(QTextOption::WrapMode(wrapMode)); option.setAlignment(Qt::Alignment(q->effectiveHAlign())); + if (!qmlDisableDistanceField()) + option.setUseDesignMetrics(renderType != QQuickTextInput::NativeRendering); + m_textLayout.setTextOption(option); m_textLayout.setFont(font); -- cgit v1.2.3