diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2017-07-24 15:15:18 +0200 |
---|---|---|
committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2017-08-23 14:16:51 +0000 |
commit | 460925b3f1dd9d2301b9c69558bd68843cd5f978 (patch) | |
tree | 69169f8b3f35a4e6a2e124c62e416336b779ae06 /src/quick/items/qquicktext.cpp | |
parent | 51763b1b191c0839ea05c75855b9e09b65b80546 (diff) |
Add a way to set the default render type of text-like elements
f3446071da8357620d0c8593a04e3b4fbba88f21 introduced a build-time
way to select the default render type of text-like elements.
This patch adds also a way to select it at runtime, via a setter
on QQuickWindow. (QQuickWindow has been chosen as convenience,
rather than adding another namespace/class to just have this
setter.)
Given that QT_QUICK_DEFAULT_TEXT_RENDER_TYPE was never documented,
I've taken the liberty of changing the accepted values for it
(to match the new enumerator names in QQuickWindow, rather than
the ones in QQuickText/QQuickTextEdit/etc.).
[ChangeLog][QtQuick][QQuickWindow] It is now possible to set the
default render type of text-like elements globally via the
QQuickWindow::setTextRenderType() function. If you were using
the (undocumented) QT_QUICK_DEFAULT_TEXT_RENDER_TYPE macro
when building Qt Quick for the same purpose, note that the
macro value needs now to be set to the "NativeTextRendering"
value, instead of "NativeRendering".
Change-Id: Id4b2dc3ec823971486e445ca4173b8be848fb4e3
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'src/quick/items/qquicktext.cpp')
-rw-r--r-- | src/quick/items/qquicktext.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/quick/items/qquicktext.cpp b/src/quick/items/qquicktext.cpp index 5ca0bb5f79..07cc1ff76e 100644 --- a/src/quick/items/qquicktext.cpp +++ b/src/quick/items/qquicktext.cpp @@ -80,11 +80,7 @@ QQuickTextPrivate::QQuickTextPrivate() , elideMode(QQuickText::ElideNone), hAlign(QQuickText::AlignLeft), vAlign(QQuickText::AlignTop) , format(QQuickText::AutoText), wrapMode(QQuickText::NoWrap) , style(QQuickText::Normal) -#if defined(QT_QUICK_DEFAULT_TEXT_RENDER_TYPE) - , renderType(QQuickText::QT_QUICK_DEFAULT_TEXT_RENDER_TYPE) -#else - , renderType(QQuickText::QtRendering) -#endif + , renderType(QQuickTextUtil::textRenderType<QQuickText>()) , updateType(UpdatePaintNode) , maximumLineCountValid(false), updateOnComponentComplete(true), richText(false) , styledText(false), widthExceeded(false), heightExceeded(false), internalWidthUpdate(false) @@ -2827,7 +2823,7 @@ void QQuickText::hoverLeaveEvent(QHoverEvent *event) Supported render types are: \list - \li Text.QtRendering - the default + \li Text.QtRendering \li Text.NativeRendering \endlist @@ -2835,6 +2831,8 @@ void QQuickText::hoverLeaveEvent(QHoverEvent *event) not require advanced features such as transformation of the text. Using such features in combination with the NativeRendering render type will lend poor and sometimes pixelated results. + + The default rendering type is determined by \l QQuickWindow::textRenderType(). */ QQuickText::RenderType QQuickText::renderType() const { |