From e28fa8406c8b1bdcef0aa3c068495677bd0cd2b7 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Wed, 19 Nov 2014 11:39:19 +0100 Subject: [PATCH] QmlDesigner.instances: Always use distance field text rendering This avoids sub pixel antialias artefacts. We call disableNativeTextRendering() in updateDirtyNodesRecursive(), because items might be created or change the property after component complete. Change-Id: Icd9c87b69434a910c9555540ba7bafdc874afc5a Reviewed-by: Tim Jenssen --- .../instances/quickitemnodeinstance.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.cpp index 71a0893fc9a..503ab9f5561 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.cpp @@ -36,6 +36,7 @@ #include #include +#include #include #include @@ -191,6 +192,21 @@ bool QuickItemNodeInstance::hasContent() const return childItemsHaveContent(quickItem()); } +static void disableNativeTextRendering(QQuickItem *item) +{ + QQuickText *text = qobject_cast(item); + if (text) + text->setRenderType(QQuickText::QtRendering); + + QQuickTextInput *textInput = qobject_cast(item); + if (textInput) + textInput->setRenderType(QQuickTextInput::QtRendering); + + QQuickTextEdit *textEdit = qobject_cast(item); + if (textEdit) + textEdit->setRenderType(QQuickTextEdit::QtRendering); +} + static void disableTextCursor(QQuickItem *item) { foreach (QQuickItem *childItem, item->childItems()) @@ -464,6 +480,7 @@ void QuickItemNodeInstance::updateDirtyNodesRecursive(QQuickItem *parentItem) co updateDirtyNodesRecursive(childItem); } + disableNativeTextRendering(parentItem); DesignerSupport::updateDirtyNode(parentItem); }