diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2011-06-01 09:45:55 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-08-19 15:15:56 +0200 |
commit | 1cc58fdf174656a52603af00cb40478066c5abd4 (patch) | |
tree | 432054d60316a981b17655dc888805e4e5434966 /src/declarative/items/qsgtextedit_p.h | |
parent | 7059861a8b8d48b5187eb46a2678f306ba288320 (diff) |
Make QSGTextNode back-end for QML's TextInput and TextEdit
Use the general QSGTextNode class as back-end for all text
elements in QML to make all text elements look the same and
use the same text rasterization back-end. This requires a
few rewrites in the text node to support e.g. selections.
Crashes seen with threaded renderer in TextEdit and TextInput on
Mac are also fixed by this.
Reviewed-by: Jiang Jiang
Task-number: QTBUG-18019, QTBUG-20017
Change-Id: I4207faf180c83422e5f8b726741321af395bd724
Reviewed-on: http://codereview.qt.nokia.com/2865
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
Diffstat (limited to 'src/declarative/items/qsgtextedit_p.h')
-rw-r--r-- | src/declarative/items/qsgtextedit_p.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/declarative/items/qsgtextedit_p.h b/src/declarative/items/qsgtextedit_p.h index 115b25040d..fa61f03f7f 100644 --- a/src/declarative/items/qsgtextedit_p.h +++ b/src/declarative/items/qsgtextedit_p.h @@ -54,7 +54,7 @@ QT_BEGIN_NAMESPACE QT_MODULE(Declarative) class QSGTextEditPrivate; -class Q_AUTOTEST_EXPORT QSGTextEdit : public QSGImplicitSizePaintedItem +class Q_AUTOTEST_EXPORT QSGTextEdit : public QSGImplicitSizeItem { Q_OBJECT Q_ENUMS(VAlignment) @@ -260,16 +260,18 @@ public Q_SLOTS: #endif private Q_SLOTS: - void updateImgCache(const QRectF &rect); void q_textChanged(); void updateSelectionMarkers(); void moveCursorDelegate(); void loadCursorDelegate(); void q_canPasteChanged(); + void updateDocument(); + void updateCursor(); private: void updateSize(); void updateTotalLines(); + void updateImageCache(const QRectF &rect = QRectF()); protected: virtual void geometryChanged(const QRectF &newGeometry, @@ -288,7 +290,8 @@ protected: void inputMethodEvent(QInputMethodEvent *e); virtual void itemChange(ItemChange, const ItemChangeData &); - void paint(QPainter *); + QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *updatePaintNodeData); + private: Q_DISABLE_COPY(QSGTextEdit) Q_DECLARE_PRIVATE(QSGTextEdit) |