diff options
-rw-r--r-- | demos/declarative/snake/content/Button.qml (renamed from demos/declarative/snake/Button.qml) | 0 | ||||
-rw-r--r-- | demos/declarative/snake/content/Cookie.qml (renamed from demos/declarative/snake/Cookie.qml) | 0 | ||||
-rw-r--r-- | demos/declarative/snake/content/HighScoreModel.qml (renamed from demos/declarative/snake/HighScoreModel.qml) | 0 | ||||
-rw-r--r-- | demos/declarative/snake/content/Link.qml (renamed from demos/declarative/snake/Link.qml) | 0 | ||||
-rw-r--r-- | demos/declarative/snake/content/Skull.qml (renamed from demos/declarative/snake/Skull.qml) | 0 | ||||
-rw-r--r-- | demos/declarative/snake/content/pics/README (renamed from demos/declarative/snake/pics/README) | 0 | ||||
-rw-r--r-- | demos/declarative/snake/content/pics/background.png (renamed from demos/declarative/snake/pics/background.png) | bin | 144508 -> 144508 bytes | |||
-rw-r--r-- | demos/declarative/snake/content/pics/blueStar.png (renamed from demos/declarative/snake/pics/blueStar.png) | bin | 272 -> 272 bytes | |||
-rw-r--r-- | demos/declarative/snake/content/pics/blueStone.png (renamed from demos/declarative/snake/pics/blueStone.png) | bin | 3139 -> 3139 bytes | |||
-rw-r--r-- | demos/declarative/snake/content/pics/cookie.png (renamed from demos/declarative/snake/pics/cookie.png) | bin | 2729 -> 2729 bytes | |||
-rw-r--r-- | demos/declarative/snake/content/pics/eyes.svg (renamed from demos/declarative/snake/pics/eyes.svg) | 0 | ||||
-rw-r--r-- | demos/declarative/snake/content/pics/head.png (renamed from demos/declarative/snake/pics/head.png) | bin | 3473 -> 3473 bytes | |||
-rw-r--r-- | demos/declarative/snake/content/pics/head.svg (renamed from demos/declarative/snake/pics/head.svg) | 0 | ||||
-rw-r--r-- | demos/declarative/snake/content/pics/redStar.png (renamed from demos/declarative/snake/pics/redStar.png) | bin | 273 -> 273 bytes | |||
-rw-r--r-- | demos/declarative/snake/content/pics/redStone.png (renamed from demos/declarative/snake/pics/redStone.png) | bin | 3456 -> 3456 bytes | |||
-rw-r--r-- | demos/declarative/snake/content/pics/skull.png (renamed from demos/declarative/snake/pics/skull.png) | bin | 2543 -> 2543 bytes | |||
-rw-r--r-- | demos/declarative/snake/content/pics/snake.jpg (renamed from demos/declarative/snake/pics/snake.jpg) | bin | 663901 -> 663901 bytes | |||
-rw-r--r-- | demos/declarative/snake/content/pics/star.png (renamed from demos/declarative/snake/pics/star.png) | bin | 262 -> 262 bytes | |||
-rw-r--r-- | demos/declarative/snake/content/pics/stoneShadow.png (renamed from demos/declarative/snake/pics/stoneShadow.png) | bin | 1699 -> 1699 bytes | |||
-rw-r--r-- | demos/declarative/snake/content/pics/yellowStar.png (renamed from demos/declarative/snake/pics/yellowStar.png) | bin | 276 -> 276 bytes | |||
-rw-r--r-- | demos/declarative/snake/content/pics/yellowStone.png (renamed from demos/declarative/snake/pics/yellowStone.png) | bin | 2667 -> 2667 bytes | |||
-rw-r--r-- | demos/declarative/snake/content/snake.js (renamed from demos/declarative/snake/snake.js) | 4 | ||||
-rw-r--r-- | demos/declarative/snake/snake.qml (renamed from demos/declarative/snake/Snake.qml) | 7 | ||||
-rw-r--r-- | src/declarative/graphicsitems/qmlgraphicsanimatedimage.cpp | 1 | ||||
-rw-r--r-- | src/declarative/graphicsitems/qmlgraphicsimagebase.cpp | 2 | ||||
-rw-r--r-- | src/declarative/graphicsitems/qmlgraphicsitem.cpp | 2 | ||||
-rw-r--r-- | src/declarative/graphicsitems/qmlgraphicslistview_p.h | 1 | ||||
-rw-r--r-- | src/declarative/graphicsitems/qmlgraphicspositioners_p.h | 2 | ||||
-rw-r--r-- | src/declarative/qml/qmlmetatype.cpp | 4 | ||||
-rw-r--r-- | src/declarative/util/qmlfontloader.cpp | 1 | ||||
-rw-r--r-- | src/declarative/util/qmlpixmapcache.cpp | 1 | ||||
-rw-r--r-- | src/declarative/util/qmlstate_p.h | 2 | ||||
-rw-r--r-- | src/declarative/util/qmltransition_p.h | 2 | ||||
-rw-r--r-- | tests/auto/declarative/pathview/tst_pathview.cpp | 8 | ||||
-rw-r--r-- | tests/auto/declarative/qmlgraphicslistview/data/listview-sections.qml | 2 | ||||
-rw-r--r-- | tests/auto/declarative/qmlgraphicslistview/tst_qmlgraphicslistview.cpp | 10 | ||||
-rw-r--r-- | tests/auto/declarative/qmlinstruction/tst_qmlinstruction.cpp | 2 | ||||
-rw-r--r-- | tests/benchmarks/declarative/text/tst_text.cpp | 75 | ||||
-rw-r--r-- | tools/qmlviewer/qmlviewer.cpp | 13 |
39 files changed, 107 insertions, 32 deletions
diff --git a/demos/declarative/snake/Button.qml b/demos/declarative/snake/content/Button.qml index 63cd555..63cd555 100644 --- a/demos/declarative/snake/Button.qml +++ b/demos/declarative/snake/content/Button.qml diff --git a/demos/declarative/snake/Cookie.qml b/demos/declarative/snake/content/Cookie.qml index 7f0aadf..7f0aadf 100644 --- a/demos/declarative/snake/Cookie.qml +++ b/demos/declarative/snake/content/Cookie.qml diff --git a/demos/declarative/snake/HighScoreModel.qml b/demos/declarative/snake/content/HighScoreModel.qml index f585ce8..f585ce8 100644 --- a/demos/declarative/snake/HighScoreModel.qml +++ b/demos/declarative/snake/content/HighScoreModel.qml diff --git a/demos/declarative/snake/Link.qml b/demos/declarative/snake/content/Link.qml index 1b3f7bf..1b3f7bf 100644 --- a/demos/declarative/snake/Link.qml +++ b/demos/declarative/snake/content/Link.qml diff --git a/demos/declarative/snake/Skull.qml b/demos/declarative/snake/content/Skull.qml index 585e7d3..585e7d3 100644 --- a/demos/declarative/snake/Skull.qml +++ b/demos/declarative/snake/content/Skull.qml diff --git a/demos/declarative/snake/pics/README b/demos/declarative/snake/content/pics/README index 0215132..0215132 100644 --- a/demos/declarative/snake/pics/README +++ b/demos/declarative/snake/content/pics/README diff --git a/demos/declarative/snake/pics/background.png b/demos/declarative/snake/content/pics/background.png Binary files differindex 72dffaa..72dffaa 100644 --- a/demos/declarative/snake/pics/background.png +++ b/demos/declarative/snake/content/pics/background.png diff --git a/demos/declarative/snake/pics/blueStar.png b/demos/declarative/snake/content/pics/blueStar.png Binary files differindex ba7acab..ba7acab 100644 --- a/demos/declarative/snake/pics/blueStar.png +++ b/demos/declarative/snake/content/pics/blueStar.png diff --git a/demos/declarative/snake/pics/blueStone.png b/demos/declarative/snake/content/pics/blueStone.png Binary files differindex 356affd..356affd 100644 --- a/demos/declarative/snake/pics/blueStone.png +++ b/demos/declarative/snake/content/pics/blueStone.png diff --git a/demos/declarative/snake/pics/cookie.png b/demos/declarative/snake/content/pics/cookie.png Binary files differindex aec2957..aec2957 100644 --- a/demos/declarative/snake/pics/cookie.png +++ b/demos/declarative/snake/content/pics/cookie.png diff --git a/demos/declarative/snake/pics/eyes.svg b/demos/declarative/snake/content/pics/eyes.svg index 1078692..1078692 100644 --- a/demos/declarative/snake/pics/eyes.svg +++ b/demos/declarative/snake/content/pics/eyes.svg diff --git a/demos/declarative/snake/pics/head.png b/demos/declarative/snake/content/pics/head.png Binary files differindex 550e002..550e002 100644 --- a/demos/declarative/snake/pics/head.png +++ b/demos/declarative/snake/content/pics/head.png diff --git a/demos/declarative/snake/pics/head.svg b/demos/declarative/snake/content/pics/head.svg index 3bf0bd2..3bf0bd2 100644 --- a/demos/declarative/snake/pics/head.svg +++ b/demos/declarative/snake/content/pics/head.svg diff --git a/demos/declarative/snake/pics/redStar.png b/demos/declarative/snake/content/pics/redStar.png Binary files differindex cd06854..cd06854 100644 --- a/demos/declarative/snake/pics/redStar.png +++ b/demos/declarative/snake/content/pics/redStar.png diff --git a/demos/declarative/snake/pics/redStone.png b/demos/declarative/snake/content/pics/redStone.png Binary files differindex 9bb7fe4..9bb7fe4 100644 --- a/demos/declarative/snake/pics/redStone.png +++ b/demos/declarative/snake/content/pics/redStone.png diff --git a/demos/declarative/snake/pics/skull.png b/demos/declarative/snake/content/pics/skull.png Binary files differindex 6318616..6318616 100644 --- a/demos/declarative/snake/pics/skull.png +++ b/demos/declarative/snake/content/pics/skull.png diff --git a/demos/declarative/snake/pics/snake.jpg b/demos/declarative/snake/content/pics/snake.jpg Binary files differindex e91a784..e91a784 100644 --- a/demos/declarative/snake/pics/snake.jpg +++ b/demos/declarative/snake/content/pics/snake.jpg diff --git a/demos/declarative/snake/pics/star.png b/demos/declarative/snake/content/pics/star.png Binary files differindex defbde5..defbde5 100644 --- a/demos/declarative/snake/pics/star.png +++ b/demos/declarative/snake/content/pics/star.png diff --git a/demos/declarative/snake/pics/stoneShadow.png b/demos/declarative/snake/content/pics/stoneShadow.png Binary files differindex 1bd56af..1bd56af 100644 --- a/demos/declarative/snake/pics/stoneShadow.png +++ b/demos/declarative/snake/content/pics/stoneShadow.png diff --git a/demos/declarative/snake/pics/yellowStar.png b/demos/declarative/snake/content/pics/yellowStar.png Binary files differindex 52fb9c4..52fb9c4 100644 --- a/demos/declarative/snake/pics/yellowStar.png +++ b/demos/declarative/snake/content/pics/yellowStar.png diff --git a/demos/declarative/snake/pics/yellowStone.png b/demos/declarative/snake/content/pics/yellowStone.png Binary files differindex c56124a..c56124a 100644 --- a/demos/declarative/snake/pics/yellowStone.png +++ b/demos/declarative/snake/content/pics/yellowStone.png diff --git a/demos/declarative/snake/snake.js b/demos/declarative/snake/content/snake.js index 1cea8b7..a65aebc 100644 --- a/demos/declarative/snake/snake.js +++ b/demos/declarative/snake/content/snake.js @@ -5,8 +5,8 @@ var links = new Array; var scheduledDirections = new Array; var numRows = 1; var numColumns = 1; -var linkComponent = createComponent("Link.qml"); -var cookieComponent = createComponent("Cookie.qml"); +var linkComponent = createComponent("content/Link.qml"); // XXX should resolve relative to script, not component +var cookieComponent = createComponent("content/Cookie.qml"); var cookie; var linksToGrow = 0; var linksToDie = 0; diff --git a/demos/declarative/snake/Snake.qml b/demos/declarative/snake/snake.qml index a9835d4..58827a7 100644 --- a/demos/declarative/snake/Snake.qml +++ b/demos/declarative/snake/snake.qml @@ -1,11 +1,12 @@ import Qt 4.6 +import "content" Rectangle { id: screen; SystemPalette { id: activePalette } color: activePalette.window - Script { source: "snake.js" } + Script { source: "content/snake.js" } property int gridSize : 34 property int margin: 4 @@ -59,7 +60,7 @@ Rectangle { Image { Image { id: title - source: "pics/snake.jpg" + source: "content/pics/snake.jpg" fillMode: "PreserveAspectCrop" anchors.fill: parent anchors.horizontalCenter: parent.horizontalCenter @@ -77,7 +78,7 @@ Rectangle { } } - source: "pics/background.png" + source: "content/pics/background.png" fillMode: "PreserveAspectCrop" anchors.left: parent.left diff --git a/src/declarative/graphicsitems/qmlgraphicsanimatedimage.cpp b/src/declarative/graphicsitems/qmlgraphicsanimatedimage.cpp index 670b38b..e01e569 100644 --- a/src/declarative/graphicsitems/qmlgraphicsanimatedimage.cpp +++ b/src/declarative/graphicsitems/qmlgraphicsanimatedimage.cpp @@ -238,6 +238,7 @@ void QmlGraphicsAnimatedImage::setSource(const QUrl &url) #endif d->status = Loading; QNetworkRequest req(d->url); + req.setAttribute(QNetworkRequest::HttpPipeliningAllowedAttribute, true); d->reply = qmlEngine(this)->networkAccessManager()->get(req); QObject::connect(d->reply, SIGNAL(finished()), this, SLOT(movieRequestFinished())); diff --git a/src/declarative/graphicsitems/qmlgraphicsimagebase.cpp b/src/declarative/graphicsitems/qmlgraphicsimagebase.cpp index e3b98aa..08617ac 100644 --- a/src/declarative/graphicsitems/qmlgraphicsimagebase.cpp +++ b/src/declarative/graphicsitems/qmlgraphicsimagebase.cpp @@ -45,8 +45,6 @@ #include <qmlengine.h> #include <qmlpixmapcache_p.h> -#include <QNetworkRequest> -#include <QNetworkReply> #include <QFile> QT_BEGIN_NAMESPACE diff --git a/src/declarative/graphicsitems/qmlgraphicsitem.cpp b/src/declarative/graphicsitems/qmlgraphicsitem.cpp index aa73444..dd685d4 100644 --- a/src/declarative/graphicsitems/qmlgraphicsitem.cpp +++ b/src/declarative/graphicsitems/qmlgraphicsitem.cpp @@ -56,8 +56,6 @@ #include <QPen> #include <QFile> #include <QEvent> -#include <QNetworkReply> -#include <QNetworkRequest> #include <QGraphicsSceneMouseEvent> #include <QtScript/qscriptengine.h> #include <QtGui/qgraphicstransform.h> diff --git a/src/declarative/graphicsitems/qmlgraphicslistview_p.h b/src/declarative/graphicsitems/qmlgraphicslistview_p.h index 2a2ef8a..79d678a 100644 --- a/src/declarative/graphicsitems/qmlgraphicslistview_p.h +++ b/src/declarative/graphicsitems/qmlgraphicslistview_p.h @@ -202,7 +202,6 @@ Q_SIGNALS: void orientationChanged(); void currentIndexChanged(); void currentSectionChanged(); - void sectionExpressionChanged(); void highlightMoveSpeedChanged(); void highlightResizeSpeedChanged(); void highlightChanged(); diff --git a/src/declarative/graphicsitems/qmlgraphicspositioners_p.h b/src/declarative/graphicsitems/qmlgraphicspositioners_p.h index 0e6d134..d6711f6 100644 --- a/src/declarative/graphicsitems/qmlgraphicspositioners_p.h +++ b/src/declarative/graphicsitems/qmlgraphicspositioners_p.h @@ -45,7 +45,7 @@ #include "qmlgraphicsitem.h" #include "../util/qmlstate_p.h" -#include "qpodvector_p.h" +#include <private/qpodvector_p.h> #include <QtCore/QObject> #include <QtCore/QString> diff --git a/src/declarative/qml/qmlmetatype.cpp b/src/declarative/qml/qmlmetatype.cpp index 0b79a21..d9c007d 100644 --- a/src/declarative/qml/qmlmetatype.cpp +++ b/src/declarative/qml/qmlmetatype.cpp @@ -1102,9 +1102,11 @@ bool QmlMetaType::copy(int type, void *data, const void *copy) case QMetaType::QBitmap: *static_cast<NS(QBitmap) *>(data) = *static_cast<const NS(QBitmap)*>(copy); return true; +#ifndef QT_NO_CURSOR case QMetaType::QCursor: *static_cast<NS(QCursor) *>(data) = *static_cast<const NS(QCursor)*>(copy); return true; +#endif case QMetaType::QSizePolicy: *static_cast<NS(QSizePolicy) *>(data) = *static_cast<const NS(QSizePolicy)*>(copy); return true; @@ -1308,9 +1310,11 @@ bool QmlMetaType::copy(int type, void *data, const void *copy) case QMetaType::QBitmap: *static_cast<NS(QBitmap) *>(data) = NS(QBitmap)(); return true; +#ifndef QT_NO_CURSOR case QMetaType::QCursor: *static_cast<NS(QCursor) *>(data) = NS(QCursor)(); return true; +#endif case QMetaType::QSizePolicy: *static_cast<NS(QSizePolicy) *>(data) = NS(QSizePolicy)(); return true; diff --git a/src/declarative/util/qmlfontloader.cpp b/src/declarative/util/qmlfontloader.cpp index 8230b1a..42b34b5 100644 --- a/src/declarative/util/qmlfontloader.cpp +++ b/src/declarative/util/qmlfontloader.cpp @@ -134,6 +134,7 @@ void QmlFontLoader::setSource(const QUrl &url) #endif { QNetworkRequest req(d->url); + req.setAttribute(QNetworkRequest::HttpPipeliningAllowedAttribute, true); d->reply = qmlEngine(this)->networkAccessManager()->get(req); QObject::connect(d->reply, SIGNAL(finished()), this, SLOT(replyFinished())); } diff --git a/src/declarative/util/qmlpixmapcache.cpp b/src/declarative/util/qmlpixmapcache.cpp index 3307ff8..6f36cad 100644 --- a/src/declarative/util/qmlpixmapcache.cpp +++ b/src/declarative/util/qmlpixmapcache.cpp @@ -404,6 +404,7 @@ QmlPixmapReply *QmlPixmapCache::request(QmlEngine *engine, const QUrl &url) QmlPixmapReplyHash::Iterator iter = qmlActivePixmapReplies.find(key); if (iter == qmlActivePixmapReplies.end()) { QNetworkRequest req(url); + req.setAttribute(QNetworkRequest::HttpPipeliningAllowedAttribute, true); QmlPixmapReply *item = new QmlPixmapReply(key, engine->networkAccessManager()->get(req)); iter = qmlActivePixmapReplies.insert(key, item); } else { diff --git a/src/declarative/util/qmlstate_p.h b/src/declarative/util/qmlstate_p.h index 95a6fc5..fdac847 100644 --- a/src/declarative/util/qmlstate_p.h +++ b/src/declarative/util/qmlstate_p.h @@ -133,7 +133,7 @@ class Q_DECLARATIVE_EXPORT QmlState : public QObject Q_PROPERTY(QString extend READ extends WRITE setExtends) Q_PROPERTY(QmlList<QmlStateOperation *>* changes READ changes) Q_CLASSINFO("DefaultProperty", "changes") - Q_CLASSINFO("DeferredPropertyNames", "changes"); + Q_CLASSINFO("DeferredPropertyNames", "changes") public: QmlState(QObject *parent=0); diff --git a/src/declarative/util/qmltransition_p.h b/src/declarative/util/qmltransition_p.h index 0a9b036..c1a6f66 100644 --- a/src/declarative/util/qmltransition_p.h +++ b/src/declarative/util/qmltransition_p.h @@ -67,7 +67,7 @@ class Q_DECLARATIVE_EXPORT QmlTransition : public QObject Q_PROPERTY(bool reversible READ reversible WRITE setReversible) Q_PROPERTY(QmlList<QmlAbstractAnimation *>* animations READ animations) Q_CLASSINFO("DefaultProperty", "animations") - Q_CLASSINFO("DeferredPropertyNames", "animations"); + Q_CLASSINFO("DeferredPropertyNames", "animations") public: QmlTransition(QObject *parent=0); diff --git a/tests/auto/declarative/pathview/tst_pathview.cpp b/tests/auto/declarative/pathview/tst_pathview.cpp index 57ae8c0..360228b 100644 --- a/tests/auto/declarative/pathview/tst_pathview.cpp +++ b/tests/auto/declarative/pathview/tst_pathview.cpp @@ -111,6 +111,14 @@ public: return returnHash; } + QVariant data(int index, int role) const { + if (role == 0) + return list.at(index).first; + if (role == 1) + return list.at(index).second; + return QVariant(); + } + void addItem(const QString &name, const QString &number) { list.append(QPair<QString,QString>(name, number)); emit itemsInserted(list.count()-1, 1); diff --git a/tests/auto/declarative/qmlgraphicslistview/data/listview-sections.qml b/tests/auto/declarative/qmlgraphicslistview/data/listview-sections.qml index 2edc0bd..4b5bea6 100644 --- a/tests/auto/declarative/qmlgraphicslistview/data/listview-sections.qml +++ b/tests/auto/declarative/qmlgraphicslistview/data/listview-sections.qml @@ -54,6 +54,6 @@ Rectangle { height: 320 model: testModel delegate: myDelegate - sectionExpression: "Math.floor(number/5)" + section.property: "number" } } diff --git a/tests/auto/declarative/qmlgraphicslistview/tst_qmlgraphicslistview.cpp b/tests/auto/declarative/qmlgraphicslistview/tst_qmlgraphicslistview.cpp index 7b5cfc0..87d4649 100644 --- a/tests/auto/declarative/qmlgraphicslistview/tst_qmlgraphicslistview.cpp +++ b/tests/auto/declarative/qmlgraphicslistview/tst_qmlgraphicslistview.cpp @@ -160,6 +160,14 @@ public: } } + QVariant data(int index, int role) const + { + if (role==0) + return list.at(index).first; + if (role==1) + return list.at(index).second; + return QVariant(); + } QHash<int, QVariant> data(int index, const QList<int> &roles) const { QHash<int,QVariant> returnHash; @@ -892,8 +900,6 @@ void tst_QmlGraphicsListView::sections() QmlGraphicsItem *viewport = listview->viewport(); QVERIFY(viewport != 0); - QCOMPARE(listview->sectionExpression(), QLatin1String("Math.floor(number/5)")); - // Confirm items positioned correctly int itemCount = findItems<QmlGraphicsItem>(viewport, "wrapper").count(); for (int i = 0; i < model.count() && i < itemCount; ++i) { diff --git a/tests/auto/declarative/qmlinstruction/tst_qmlinstruction.cpp b/tests/auto/declarative/qmlinstruction/tst_qmlinstruction.cpp index bfffc43..43c64cd 100644 --- a/tests/auto/declarative/qmlinstruction/tst_qmlinstruction.cpp +++ b/tests/auto/declarative/qmlinstruction/tst_qmlinstruction.cpp @@ -388,7 +388,7 @@ void tst_qmlinstruction::dump() { QmlInstruction i; i.line = 34; - i.type = QmlInstruction::StoreObjPropBinding; + //i.type = QmlInstruction::StoreObjPropBinding; // removed! i.assignObjPropBinding.property = 28; i.assignObjPropBinding.contextIdx = 3; i.assignObjPropBinding.context = 7; diff --git a/tests/benchmarks/declarative/text/tst_text.cpp b/tests/benchmarks/declarative/text/tst_text.cpp index e69ecd8..c7ea884 100644 --- a/tests/benchmarks/declarative/text/tst_text.cpp +++ b/tests/benchmarks/declarative/text/tst_text.cpp @@ -62,6 +62,11 @@ private slots: void document(); void paintDocToPixmap(); void paintDocToPixmap_painterFill(); + void control(); + void paintControlToPixmap(); + void paintControlToPixmap_painterFill(); + void constructControl(); + void constructDocument(); private: QString m_text; @@ -144,6 +149,48 @@ void tst_text::paintLayoutToPixmap_painterFill() void tst_text::document() { + QTextDocument *doc = new QTextDocument; + + QBENCHMARK { + QTextDocument *doc = new QTextDocument; + doc->setHtml(m_text); + } +} + +void tst_text::paintDocToPixmap() +{ + QTextDocument *doc = new QTextDocument; + doc->setHtml(m_text); + doc->setTextWidth(300); + QSize size = doc->size().toSize(); + + QBENCHMARK { + QPixmap img(size); + img.fill(Qt::transparent); + QPainter p(&img); + doc->drawContents(&p/*, QRectF(QPointF(0, 0), QSizeF(size))*/); + } +} + +void tst_text::paintDocToPixmap_painterFill() +{ + QTextDocument *doc = new QTextDocument; + doc->setHtml(m_text); + doc->setTextWidth(300); + QSize size = doc->size().toSize(); + + QBENCHMARK { + QPixmap img(size); + QPainter p(&img); + p.setCompositionMode(QPainter::CompositionMode_Source); + p.fillRect(0, 0, img.width(), img.height(), Qt::transparent); + p.setCompositionMode(QPainter::CompositionMode_SourceOver); + doc->drawContents(&p/*, QRectF(QPointF(0, 0), QSizeF(size))*/); + } +} + +void tst_text::control() +{ QTextControl *control = new QTextControl(m_text); QBENCHMARK { @@ -153,11 +200,12 @@ void tst_text::document() } } -void tst_text::paintDocToPixmap() +void tst_text::paintControlToPixmap() { QTextControl *control = new QTextControl; QTextDocument *doc = control->document(); doc->setHtml(m_text); + doc->setTextWidth(300); QSize size = doc->size().toSize(); QBENCHMARK { @@ -168,11 +216,12 @@ void tst_text::paintDocToPixmap() } } -void tst_text::paintDocToPixmap_painterFill() +void tst_text::paintControlToPixmap_painterFill() { QTextControl *control = new QTextControl; QTextDocument *doc = control->document(); doc->setHtml(m_text); + doc->setTextWidth(300); QSize size = doc->size().toSize(); QBENCHMARK { @@ -185,5 +234,27 @@ void tst_text::paintDocToPixmap_painterFill() } } +void tst_text::constructControl() +{ + QTextControl *control = new QTextControl; + delete control; + + QBENCHMARK { + QTextControl *control = new QTextControl; + delete control; + } +} + +void tst_text::constructDocument() +{ + QTextDocument *doc = new QTextDocument; + delete doc; + + QBENCHMARK { + QTextDocument *doc = new QTextDocument; + delete doc; + } +} + QTEST_MAIN(tst_text) #include "tst_text.moc" diff --git a/tools/qmlviewer/qmlviewer.cpp b/tools/qmlviewer/qmlviewer.cpp index 60208d2..21288c4 100644 --- a/tools/qmlviewer/qmlviewer.cpp +++ b/tools/qmlviewer/qmlviewer.cpp @@ -291,18 +291,6 @@ private: QString customargs; }; -class ConfiguredNetworkAccessManager : public QNetworkAccessManager { -public: - ConfiguredNetworkAccessManager(QObject *parent) : QNetworkAccessManager(parent) { } - - QNetworkReply *createRequest (Operation op, const QNetworkRequest &req, QIODevice * outgoingData) - { - QNetworkRequest request = req; - request.setAttribute(QNetworkRequest::HttpPipeliningAllowedAttribute, true); - return QNetworkAccessManager::createRequest(op,request,outgoingData); - } -}; - class PersistentCookieJar : public QNetworkCookieJar { public: PersistentCookieJar(QObject *parent) : QNetworkCookieJar(parent) { load(); } @@ -383,7 +371,6 @@ QmlViewer::QmlViewer(QWidget *parent, Qt::WindowFlags flags) canvas->setAttribute(Qt::WA_OpaquePaintEvent); canvas->setAttribute(Qt::WA_NoSystemBackground); canvas->setContentResizable(!skin || !scaleSkin); - canvas->engine()->setNetworkAccessManager(new ConfiguredNetworkAccessManager(canvas->engine())); canvas->setFocus(); QObject::connect(canvas, SIGNAL(sceneResized(QSize)), this, SLOT(sceneResized(QSize))); |