Don't use design metrics with NativeRendering on TextInput
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
Thu, 8 Nov 2012 14:04:22 +0000 (15:04 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Thu, 8 Nov 2012 23:16:09 +0000 (00:16 +0100)
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 <jens.bache-wiig@digia.com>
src/quick/items/qquicktextinput.cpp

index 22551c9..88e6d75 100644 (file)
@@ -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);