diff options
Diffstat (limited to 'src/quick/items/qquicktextutil_p.h')
-rw-r--r-- | src/quick/items/qquicktextutil_p.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/quick/items/qquicktextutil_p.h b/src/quick/items/qquicktextutil_p.h index 01055c95ec..bad5e738a8 100644 --- a/src/quick/items/qquicktextutil_p.h +++ b/src/quick/items/qquicktextutil_p.h @@ -54,6 +54,7 @@ #include <QtQml/qqml.h> #include <QtQml/qqmlincubator.h> #include <QtQuick/qquickitem.h> +#include <QtQuick/qquickwindow.h> QT_BEGIN_NAMESPACE @@ -64,6 +65,7 @@ public: template <typename Private> static void setCursorDelegate(Private *d, QQmlComponent *delegate); template <typename Private> static void createCursor(Private *d); + template <typename T> static typename T::RenderType textRenderType(); static qreal alignedX(qreal textWidth, qreal itemWidth, int alignment); static qreal alignedY(qreal textHeight, qreal itemHeight, int alignment); @@ -124,6 +126,20 @@ void QQuickTextUtil::createCursor(Private *d) parent->update(); } +template <typename T> +typename T::RenderType QQuickTextUtil::textRenderType() +{ + switch (QQuickWindow::textRenderType()) { + case QQuickWindow::QtTextRendering: + return T::QtRendering; + case QQuickWindow::NativeTextRendering: + return T::NativeRendering; + } + + Q_UNREACHABLE(); + return T::QtRendering; +} + QT_END_NAMESPACE #endif |