diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2012-07-04 14:56:38 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-07-10 14:22:34 +0200 |
commit | b0b4869440fc6e5af42797cbcaa64ec30238be73 (patch) | |
tree | 208f5f90c9ee6c3a71cc9e751a9374addede67d0 /src/quick/items/qquicktextinput_p.h | |
parent | c66d00a7f53d6a6a847bc7171529273f4d089923 (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/qquicktextinput_p.h')
-rw-r--r-- | src/quick/items/qquicktextinput_p.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/quick/items/qquicktextinput_p.h b/src/quick/items/qquicktextinput_p.h index 16faa01fc8..3af2cdcd81 100644 --- a/src/quick/items/qquicktextinput_p.h +++ b/src/quick/items/qquicktextinput_p.h @@ -61,6 +61,7 @@ class Q_AUTOTEST_EXPORT QQuickTextInput : public QQuickImplicitSizeItem Q_ENUMS(EchoMode) Q_ENUMS(SelectionMode) Q_ENUMS(CursorPosition) + Q_ENUMS(RenderType) Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged) Q_PROPERTY(int length READ length NOTIFY textChanged) @@ -106,6 +107,7 @@ class Q_AUTOTEST_EXPORT QQuickTextInput : public QQuickImplicitSizeItem Q_PROPERTY(bool inputMethodComposing READ isInputMethodComposing NOTIFY inputMethodComposingChanged) Q_PROPERTY(qreal contentWidth READ contentWidth NOTIFY contentSizeChanged) Q_PROPERTY(qreal contentHeight READ contentHeight NOTIFY contentSizeChanged) + Q_PROPERTY(RenderType renderType READ renderType WRITE setRenderType NOTIFY renderTypeChanged) public: QQuickTextInput(QQuickItem * parent=0); @@ -150,6 +152,9 @@ public: CursorOnCharacter }; + enum RenderType { QtRendering, + NativeRendering + }; //Auxilliary functions needed to control the TextInput from QML Q_INVOKABLE void positionAt(QQmlV8Function *args) const; @@ -157,6 +162,9 @@ public: Q_INVOKABLE void moveCursorSelection(int pos); Q_INVOKABLE void moveCursorSelection(int pos, SelectionMode mode); + RenderType renderType() const; + void setRenderType(RenderType renderType); + QString text() const; void setText(const QString &); @@ -298,6 +306,7 @@ Q_SIGNALS: void effectiveHorizontalAlignmentChanged(); void contentSizeChanged(); void inputMethodHintsChanged(); + void renderTypeChanged(); protected: virtual void geometryChanged(const QRectF &newGeometry, |