summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems/qdeclarativetextlayout_p.h
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2010-10-01 00:36:34 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2010-10-01 00:39:22 (GMT)
commit394651a222b9b200b793dbf86fadc52b5a546915 (patch)
treebb91a38e1a3785ab969276afafc1c83dd3004b2e /src/declarative/graphicsitems/qdeclarativetextlayout_p.h
parent1e2958e7a12de7cba30b02657c02320945bb1e3d (diff)
downloadQt-394651a222b9b200b793dbf86fadc52b5a546915.zip
Qt-394651a222b9b200b793dbf86fadc52b5a546915.tar.gz
Qt-394651a222b9b200b793dbf86fadc52b5a546915.tar.bz2
Apply the QStaticText text-caching strategy for QML
QML cannot use QStaticText directly as it doesn't support caching a QTextLayout. QDeclarativeTextLayout is basically a copy of QStaticText that adds this support. Currently this feature is disabled by default (enable with QML_DISABLE_IMAGE_CACHE=1) while we double check the perf consequences of this change. Task-number: QTBUG-14050
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativetextlayout_p.h')
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextlayout_p.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativetextlayout_p.h b/src/declarative/graphicsitems/qdeclarativetextlayout_p.h
new file mode 100644
index 0000000..1a4473d
--- /dev/null
+++ b/src/declarative/graphicsitems/qdeclarativetextlayout_p.h
@@ -0,0 +1,23 @@
+#ifndef QDECLARATIVETEXTLAYOUT_P_H
+#define QDECLARATIVETEXTLAYOUT_P_H
+
+#include <QtGui/qtextlayout.h>
+
+class QDeclarativeTextLayoutPrivate;
+class QDeclarativeTextLayout : public QTextLayout
+{
+public:
+ QDeclarativeTextLayout();
+ QDeclarativeTextLayout(const QString &);
+ ~QDeclarativeTextLayout();
+
+ void beginLayout();
+
+ void prepare();
+ void draw(QPainter *, const QPointF & = QPointF());
+
+private:
+ QDeclarativeTextLayoutPrivate *d;
+};
+
+#endif // QDECLARATIVETEXTLAYOUT_P_H