forked from qt-creator/qt-creator
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 <tim.jenssen@theqtcompany.com>
This commit is contained in:
committed by
Thomas Hartmann
parent
e3ae038387
commit
e28fa8406c
@@ -36,6 +36,7 @@
|
|||||||
#include <QQuickView>
|
#include <QQuickView>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
||||||
|
#include <private/qquicktext_p.h>
|
||||||
#include <private/qquicktextinput_p.h>
|
#include <private/qquicktextinput_p.h>
|
||||||
#include <private/qquicktextedit_p.h>
|
#include <private/qquicktextedit_p.h>
|
||||||
|
|
||||||
@@ -191,6 +192,21 @@ bool QuickItemNodeInstance::hasContent() const
|
|||||||
return childItemsHaveContent(quickItem());
|
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)
|
static void disableTextCursor(QQuickItem *item)
|
||||||
{
|
{
|
||||||
foreach (QQuickItem *childItem, item->childItems())
|
foreach (QQuickItem *childItem, item->childItems())
|
||||||
@@ -464,6 +480,7 @@ void QuickItemNodeInstance::updateDirtyNodesRecursive(QQuickItem *parentItem) co
|
|||||||
updateDirtyNodesRecursive(childItem);
|
updateDirtyNodesRecursive(childItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
disableNativeTextRendering(parentItem);
|
||||||
DesignerSupport::updateDirtyNode(parentItem);
|
DesignerSupport::updateDirtyNode(parentItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user