Commit e28fa840 authored by Thomas Hartmann's avatar Thomas Hartmann Committed by Thomas Hartmann
Browse files

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: default avatarTim Jenssen <tim.jenssen@theqtcompany.com>
parent e3ae0383
......@@ -36,6 +36,7 @@
#include <QQuickView>
#include <cmath>
#include <private/qquicktext_p.h>
#include <private/qquicktextinput_p.h>
#include <private/qquicktextedit_p.h>
......@@ -191,6 +192,21 @@ bool QuickItemNodeInstance::hasContent() const
return childItemsHaveContent(quickItem());
}
static void disableNativeTextRendering(QQuickItem *item)
{
QQuickText *text = qobject_cast<QQuickText*>(item);
if (text)
text->setRenderType(QQuickText::QtRendering);
QQuickTextInput *textInput = qobject_cast<QQuickTextInput*>(item);
if (textInput)
textInput->setRenderType(QQuickTextInput::QtRendering);
QQuickTextEdit *textEdit = qobject_cast<QQuickTextEdit*>(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);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment