aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquicktext_p.h
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2012-07-04 14:56:38 +0200
committerQt by Nokia <qt-info@nokia.com>2012-07-10 14:22:34 +0200
commitb0b4869440fc6e5af42797cbcaa64ec30238be73 (patch)
tree208f5f90c9ee6c3a71cc9e751a9374addede67d0 /src/quick/items/qquicktext_p.h
parentc66d00a7f53d6a6a847bc7171529273f4d089923 (diff)
Add option to use native rasterizer for SceneGraph text
For old-style (desktop components) apps using QML 2 on regular density displays, distance field text will look out of place. We introduce an option to use the native rasterizer instead if you would rather have native look and feel than scalable text items. Change-Id: Idb38e3c89f2deab9ae1963357c6c5fb235ddeab8 Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
Diffstat (limited to 'src/quick/items/qquicktext_p.h')
-rw-r--r--src/quick/items/qquicktext_p.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/quick/items/qquicktext_p.h b/src/quick/items/qquicktext_p.h
index b6aefd7ee2..733cba8061 100644
--- a/src/quick/items/qquicktext_p.h
+++ b/src/quick/items/qquicktext_p.h
@@ -63,6 +63,7 @@ class Q_QUICK_PRIVATE_EXPORT QQuickText : public QQuickImplicitSizeItem
Q_ENUMS(WrapMode)
Q_ENUMS(LineHeightMode)
Q_ENUMS(FontSizeMode)
+ Q_ENUMS(RenderType)
Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged)
Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY fontChanged)
@@ -90,6 +91,7 @@ class Q_QUICK_PRIVATE_EXPORT QQuickText : public QQuickImplicitSizeItem
Q_PROPERTY(int minimumPixelSize READ minimumPixelSize WRITE setMinimumPixelSize NOTIFY minimumPixelSizeChanged)
Q_PROPERTY(int minimumPointSize READ minimumPointSize WRITE setMinimumPointSize NOTIFY minimumPointSizeChanged)
Q_PROPERTY(FontSizeMode fontSizeMode READ fontSizeMode WRITE setFontSizeMode NOTIFY fontSizeModeChanged)
+ Q_PROPERTY(RenderType renderType READ renderType WRITE setRenderType NOTIFY renderTypeChanged)
public:
QQuickText(QQuickItem *parent=0);
@@ -122,6 +124,10 @@ public:
Wrap = QTextOption::WrapAtWordBoundaryOrAnywhere
};
+ enum RenderType { QtRendering,
+ NativeRendering
+ };
+
enum LineHeightMode { ProportionalHeight, FixedHeight };
enum FontSizeMode { FixedSize = 0x0, HorizontalFit = 0x01, VerticalFit = 0x02,
@@ -200,6 +206,9 @@ public:
QRectF clipRect() const;
Q_INVOKABLE void doLayout();
+ RenderType renderType() const;
+ void setRenderType(RenderType renderType);
+
Q_SIGNALS:
void textChanged(const QString &text);
void linkActivated(const QString &link);
@@ -225,6 +234,7 @@ Q_SIGNALS:
void effectiveHorizontalAlignmentChanged();
void lineLaidOut(QQuickTextLine *line);
void baseUrlChanged();
+ void renderTypeChanged();
protected:
void mousePressEvent(QMouseEvent *event);