diff options
author | Mitch Curtis <mitch.curtis@theqtcompany.com> | 2016-03-30 16:34:15 +0200 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@theqtcompany.com> | 2016-04-01 12:23:03 +0000 |
commit | 335b1fff26ef0c13e1cd1fe697c70d7b8f1a8139 (patch) | |
tree | 3f890be1b88ff1ca4383a3fcd6472cf985d61df0 /tests/manual/gifs/tst_gifs.cpp | |
parent | cb3b2d7dab2f99a559c8dd6d89d43bb81978805d (diff) |
Improve documentation for delegate controls
- Add "Delegate Controls" doc page. This will list future delegate
controls, such as CheckDelegate, RadioDelegate and SwitchDelegate.
- Add GIF for ItemDelegate.
Change-Id: If8c66ab2178185f96d190f29ef7815beaa6e8d68
Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Diffstat (limited to 'tests/manual/gifs/tst_gifs.cpp')
-rw-r--r-- | tests/manual/gifs/tst_gifs.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/manual/gifs/tst_gifs.cpp b/tests/manual/gifs/tst_gifs.cpp index ed5d2956..bc096ccb 100644 --- a/tests/manual/gifs/tst_gifs.cpp +++ b/tests/manual/gifs/tst_gifs.cpp @@ -60,6 +60,8 @@ private slots: void swipeDelegate_data(); void swipeDelegate(); void swipeDelegateBehind(); + void delegates_data(); + void delegates(); private: void moveSmoothly(QQuickWindow *window, const QPoint &from, const QPoint &to, int movements, @@ -466,6 +468,39 @@ void tst_Gifs::swipeDelegateBehind() gifRecorder.waitForFinish(); } +void tst_Gifs::delegates_data() +{ + QTest::addColumn<QString>("name"); + QTest::newRow("ItemDelegate") << "itemdelegate"; +} + +void tst_Gifs::delegates() +{ + QFETCH(QString, name); + + GifRecorder gifRecorder; + gifRecorder.setDataDirPath(dataDirPath); + gifRecorder.setOutputDir(outputDir); + gifRecorder.setRecordingDuration(5); + gifRecorder.setQmlFileName(QString::fromLatin1("qtquickcontrols-%1.qml").arg(name)); + gifRecorder.setHighQuality(true); + + gifRecorder.start(); + + QQuickWindow *window = gifRecorder.window(); + QQuickItem *delegate = window->property("delegate").value<QQuickItem*>(); + QVERIFY(delegate); + + const QPoint delegateCenter(delegate->mapToScene(QPointF(delegate->width() / 2, delegate->height() / 2)).toPoint()); + QTest::mousePress(window, Qt::LeftButton, Qt::NoModifier, delegateCenter, 200); + QTest::mouseRelease(window, Qt::LeftButton, Qt::NoModifier, delegateCenter, 400); + + QTest::mousePress(window, Qt::LeftButton, Qt::NoModifier, delegateCenter, 1000); + QTest::mouseRelease(window, Qt::LeftButton, Qt::NoModifier, delegateCenter, 400); + + gifRecorder.waitForFinish(); +} + QTEST_MAIN(tst_Gifs) #include "tst_gifs.moc" |