From 36ac9c61e73944cd75d09f5751dd8ed053571b9b Mon Sep 17 00:00:00 2001 From: Joona Petrell Date: Thu, 18 Nov 2010 20:57:20 +1000 Subject: Add missing symbols in QtGui emulator def file --- src/s60installs/bwins/QtGuiu.def | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/s60installs/bwins/QtGuiu.def b/src/s60installs/bwins/QtGuiu.def index c91b22c..dc8a865 100644 --- a/src/s60installs/bwins/QtGuiu.def +++ b/src/s60installs/bwins/QtGuiu.def @@ -12898,4 +12898,10 @@ EXPORTS ?qmljsDebugArgumentsString@QApplicationPrivate@@SA?AVQString@@XZ @ 12897 NONAME ; class QString QApplicationPrivate::qmljsDebugArgumentsString(void) ?convertToPostscriptFontFamilyName@QFontEngine@@SA?AVQByteArray@@ABV2@@Z @ 12898 NONAME ; class QByteArray QFontEngine::convertToPostscriptFontFamilyName(class QByteArray const &) ?lastResortFont@QFont@@QBE?AVQString@@XZ @ 12899 NONAME ; class QString QFont::lastResortFont(void) const + ?setFontEngine@QStaticTextItem@@QAEXPAVQFontEngine@@@Z @ 12900 NONAME ; void QStaticTextItem::setFontEngine(class QFontEngine *) + ??0QStaticTextItem@@QAE@ABV0@@Z @ 12901 NONAME ; QStaticTextItem::QStaticTextItem(class QStaticTextItem const &) + ??4QStaticTextItem@@QAEXABV0@@Z @ 12902 NONAME ; void QStaticTextItem::operator=(class QStaticTextItem const &) + ?fontEngine@QStaticTextItem@@QBEPAVQFontEngine@@XZ @ 12903 NONAME ; class QFontEngine * QStaticTextItem::fontEngine(void) const + ?reactivateDeferredActiveObjects@QEventDispatcherS60@@UAEXXZ @ 12904 NONAME ; void QEventDispatcherS60::reactivateDeferredActiveObjects(void) + ?userData@QStaticTextItem@@QBEPAVQStaticTextUserData@@XZ @ 12905 NONAME ; class QStaticTextUserData * QStaticTextItem::userData(void) const -- cgit v0.12 From 0ced71e4dddc12240b22fd5786ed41a529e49c47 Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Thu, 18 Nov 2010 13:35:44 +0100 Subject: Fix parent bug for QDeclarativeOpenMetaObject The dynamic meta object was not called because no parent meta object was called. Reviewed-By: Aaron Kennedy --- src/declarative/util/qdeclarativeopenmetaobject.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/declarative/util/qdeclarativeopenmetaobject.cpp b/src/declarative/util/qdeclarativeopenmetaobject.cpp index 40485bd..c611435 100644 --- a/src/declarative/util/qdeclarativeopenmetaobject.cpp +++ b/src/declarative/util/qdeclarativeopenmetaobject.cpp @@ -186,6 +186,7 @@ QDeclarativeOpenMetaObject::QDeclarativeOpenMetaObject(QObject *obj, bool automa d->type->d->referers.insert(this); QObjectPrivate *op = QObjectPrivate::get(obj); + d->parent = static_cast(op->metaObject); *static_cast(this) = *d->type->d->mem; op->metaObject = this; } @@ -201,6 +202,7 @@ QDeclarativeOpenMetaObject::QDeclarativeOpenMetaObject(QObject *obj, QDeclarativ d->type->d->referers.insert(this); QObjectPrivate *op = QObjectPrivate::get(obj); + d->parent = static_cast(op->metaObject); *static_cast(this) = *d->type->d->mem; op->metaObject = this; } -- cgit v0.12 From d4cd9c899e705ff01f597f0007def8fbd3ab8b39 Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Fri, 19 Nov 2010 09:19:41 +1000 Subject: Add a test on QWS Without a single test, it fails anyways. Task-number: QTBUG-14792 --- tests/auto/declarative/qmlvisual/TEST_GUIDELINES | 2 +- tests/auto/declarative/qmlvisual/tst_qmlvisual.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/auto/declarative/qmlvisual/TEST_GUIDELINES b/tests/auto/declarative/qmlvisual/TEST_GUIDELINES index cb53b6e..469832f 100644 --- a/tests/auto/declarative/qmlvisual/TEST_GUIDELINES +++ b/tests/auto/declarative/qmlvisual/TEST_GUIDELINES @@ -4,4 +4,4 @@ Guidelines for creating new visual tests: 2. Keep it short. It is hoped that these tests can be run regularly, perhaps even for every commit, and if you add up ten seconds for every time someone commits a change to QML then we'll be sitting here for a long time. Completeness is more important than haste, but consider the most time efficient ways to achieve said completeness. Do not forget about snapshot mode (tst_qmlvisual -help for details on -recordsnapshot) when testing that a static scene looks right. -3. Avoid text. Text is relatively unstable due to platform specific peculiarities. If you need to identify an area, consider a unique color as opposed to a unique text label. If you must use Text, TextEdit, or TextInput, use the test-friendlier versions in the 'shared' directory. +3. Avoid text. Text is relatively unstable due to platform specific peculiarities. If you need to identify an area, consider a unique color as opposed to a unique text label. If you must use Text, TextEdit, or TextInput, use the test-friendlier versions in the 'shared' directory. Also keep in mind that text anti-aliasing is disabled during tests for greater consistency, and you should never use point sizes in tests. Text autotests can thus only test some aspects of the elements. diff --git a/tests/auto/declarative/qmlvisual/tst_qmlvisual.cpp b/tests/auto/declarative/qmlvisual/tst_qmlvisual.cpp index 8d4d0d1..2a15102 100644 --- a/tests/auto/declarative/qmlvisual/tst_qmlvisual.cpp +++ b/tests/auto/declarative/qmlvisual/tst_qmlvisual.cpp @@ -104,14 +104,16 @@ void tst_qmlvisual::visual_data() QStringList files; files << findQmlFiles(QDir(QT_TEST_SOURCE_DIR)); if (qgetenv("QMLVISUAL_ALL") != "1") { - //Text on X11 varies per distro - and the CI system is currently using something outdated. #if defined(Q_WS_X11) + //Text on X11 varies per distro - and the CI system is currently using something outdated. foreach(const QString &str, files.filter(QRegExp(".*text.*"))) files.removeAll(str); #endif - //We don't want QWS test results to mire down the CI system #if defined(Q_WS_QWS) + //We don't want QWS test results to mire down the CI system files.clear(); + //Needs at least one test data or it fails anyways + files << QT_TEST_SOURCE_DIR "/selftest_noimages/selftest_noimages.qml"; #endif } -- cgit v0.12 From 519264c692f77f6da2fb8a9ac2ddb1d70b39cc90 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Fri, 19 Nov 2010 10:55:22 +1000 Subject: Doc: clarify Flickable children vs. contentItem children. --- src/declarative/graphicsitems/qdeclarativeflickable.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp index 3a3189c..1870647 100644 --- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp +++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp @@ -386,6 +386,13 @@ void QDeclarativeFlickablePrivate::updateBeginningEnd() \snippet doc/src/snippets/declarative/flickable.qml document \clearfloat + + Items declared as children of a Flickable are automatically parented to the + Flickable's \l contentItem. This should be taken into account when + operating on the children of the Flickable; it is usually the children of + \c contentItem that are relevant. For example, the bound of Items added + to the Flickable will be available by \c contentItem.childrenRect + \section1 Limitations \note Due to an implementation detail, items placed inside a Flickable cannot anchor to it by -- cgit v0.12 From f3a80c1128a04c9eb04a28b2fe8b468113731c43 Mon Sep 17 00:00:00 2001 From: Joona Petrell Date: Fri, 19 Nov 2010 13:29:48 +1000 Subject: Add missing symbols to QtOpenGL emulator def file --- src/s60installs/bwins/QtOpenGLu.def | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/s60installs/bwins/QtOpenGLu.def b/src/s60installs/bwins/QtOpenGLu.def index fa340e4..620fcb9 100644 --- a/src/s60installs/bwins/QtOpenGLu.def +++ b/src/s60installs/bwins/QtOpenGLu.def @@ -8,7 +8,7 @@ EXPORTS ?d_func@QGLShader@@AAEPAVQGLShaderPrivate@@XZ @ 7 NONAME ; class QGLShaderPrivate * QGLShader::d_func(void) ?bindToDynamicTexture@QGLPixelBuffer@@QAE_NI@Z @ 8 NONAME ; bool QGLPixelBuffer::bindToDynamicTexture(unsigned int) ??0QGLWidget@@QAE@PAVQGLContext@@PAVQWidget@@PBV0@V?$QFlags@W4WindowType@Qt@@@@@Z @ 9 NONAME ; QGLWidget::QGLWidget(class QGLContext *, class QWidget *, class QGLWidget const *, class QFlags) - ??_EQGLFormat@@QAE@I@Z @ 10 NONAME ; QGLFormat::~QGLFormat(unsigned int) + ??_EQGLFormat@@QAE@I@Z @ 10 NONAME ABSENT ; QGLFormat::~QGLFormat(unsigned int) ?drawPixmapFragments@QGL2PaintEngineEx@@UAEXPBVPixmapFragment@QPainter@@HABVQPixmap@@V?$QFlags@W4PixmapFragmentHint@QPainter@@@@@Z @ 11 NONAME ; void QGL2PaintEngineEx::drawPixmapFragments(class QPainter::PixmapFragment const *, int, class QPixmap const &, class QFlags) ?paintEngine@QGLWidget@@UBEPAVQPaintEngine@@XZ @ 12 NONAME ; class QPaintEngine * QGLWidget::paintEngine(void) const ?setPreferredPaintEngine@QGL@@YAXW4Type@QPaintEngine@@@Z @ 13 NONAME ; void QGL::setPreferredPaintEngine(enum QPaintEngine::Type) @@ -107,7 +107,7 @@ EXPORTS ??0QGLContext@@QAE@ABVQGLFormat@@@Z @ 106 NONAME ; QGLContext::QGLContext(class QGLFormat const &) ?geometryOutputVertexCount@QGLShaderProgram@@QBEHXZ @ 107 NONAME ; int QGLShaderProgram::geometryOutputVertexCount(void) const ?setAccum@QGLFormat@@QAEX_N@Z @ 108 NONAME ; void QGLFormat::setAccum(bool) - ??0QGLSignalProxy@@QAE@XZ @ 109 NONAME ; QGLSignalProxy::QGLSignalProxy(void) + ??0QGLSignalProxy@@QAE@XZ @ 109 NONAME ABSENT ; QGLSignalProxy::QGLSignalProxy(void) ?isUninitialized@QGLPixmapData@@ABE_NXZ @ 110 NONAME ; bool QGLPixmapData::isUninitialized(void) const ??0QGLFramebufferObjectFormat@@QAE@XZ @ 111 NONAME ; QGLFramebufferObjectFormat::QGLFramebufferObjectFormat(void) ??8@YA_NABVQGLFormat@@0@Z @ 112 NONAME ; bool operator==(class QGLFormat const &, class QGLFormat const &) @@ -496,7 +496,7 @@ EXPORTS ?setUniformValue@QGLShaderProgram@@QAEXPBDABVQSize@@@Z @ 495 NONAME ; void QGLShaderProgram::setUniformValue(char const *, class QSize const &) ?convertToGLFormat@QGLWidget@@SA?AVQImage@@ABV2@@Z @ 496 NONAME ; class QImage QGLWidget::convertToGLFormat(class QImage const &) ?staticMetaObject@QGLTextureGlyphCache@@2UQMetaObject@@B @ 497 NONAME ; struct QMetaObject const QGLTextureGlyphCache::staticMetaObject - ??_EQGLContextResource@@QAE@I@Z @ 498 NONAME ; QGLContextResource::~QGLContextResource(unsigned int) + ??_EQGLContextResource@@QAE@I@Z @ 498 NONAME ABSENT ; QGLContextResource::~QGLContextResource(unsigned int) ?handle@QGLColormap@@IAEKXZ @ 499 NONAME ; unsigned long QGLColormap::handle(void) ?isCreated@QGLBuffer@@QBE_NXZ @ 500 NONAME ; bool QGLBuffer::isCreated(void) const ?setColormap@QGLWidget@@QAEXABVQGLColormap@@@Z @ 501 NONAME ; void QGLWidget::setColormap(class QGLColormap const &) @@ -698,4 +698,9 @@ EXPORTS ?setProfile@QGLFormat@@QAEXW4OpenGLContextProfile@1@@Z @ 697 NONAME ; void QGLFormat::setProfile(enum QGLFormat::OpenGLContextProfile) ?updateDynamicTexture@QGLPixelBuffer@@QBEXI@Z @ 698 NONAME ; void QGLPixelBuffer::updateDynamicTexture(unsigned int) const ?setUniformValue@QGLShaderProgram@@QAEXHH@Z @ 699 NONAME ; void QGLShaderProgram::setUniformValue(int, int) + ?maxTextureHeight@QGLTextureGlyphCache@@UBEHXZ @ 700 NONAME ; int QGLTextureGlyphCache::maxTextureHeight(void) const + ?initializeOffscreenTexture@QGLWindowSurface@@AAE_NABVQSize@@@Z @ 701 NONAME ; bool QGLWindowSurface::initializeOffscreenTexture(class QSize const &) + ?maxTextureWidth@QGLTextureGlyphCache@@UBEHXZ @ 702 NONAME ; int QGLTextureGlyphCache::maxTextureWidth(void) const + ?filterMode@QGLTextureGlyphCache@@QBE?AW4FilterMode@1@XZ @ 703 NONAME ; enum QGLTextureGlyphCache::FilterMode QGLTextureGlyphCache::filterMode(void) const + ?setFilterMode@QGLTextureGlyphCache@@QAEXW4FilterMode@1@@Z @ 704 NONAME ; void QGLTextureGlyphCache::setFilterMode(enum QGLTextureGlyphCache::FilterMode) -- cgit v0.12 From abfdba11b8948497765c24670becf39e2ce1ff6d Mon Sep 17 00:00:00 2001 From: Joona Petrell Date: Fri, 19 Nov 2010 14:40:33 +1000 Subject: Add missing symbols to QtOpenGL arm def file --- src/s60installs/eabi/QtOpenGLu.def | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/s60installs/eabi/QtOpenGLu.def b/src/s60installs/eabi/QtOpenGLu.def index 7ceade4..c92d99e 100644 --- a/src/s60installs/eabi/QtOpenGLu.def +++ b/src/s60installs/eabi/QtOpenGLu.def @@ -702,4 +702,9 @@ EXPORTS _ZeqRK9QGLFormatS1_ @ 701 NONAME _Zls6QDebugRK9QGLFormat @ 702 NONAME _ZneRK9QGLFormatS1_ @ 703 NONAME + _ZN16QGLWindowSurface26initializeOffscreenTextureERK5QSize @ 704 NONAME + _ZNK20QGLTextureGlyphCache15maxTextureWidthEv @ 705 NONAME + _ZNK20QGLTextureGlyphCache16maxTextureHeightEv @ 706 NONAME + _ZThn8_NK20QGLTextureGlyphCache15maxTextureWidthEv @ 707 NONAME + _ZThn8_NK20QGLTextureGlyphCache16maxTextureHeightEv @ 708 NONAME -- cgit v0.12 From ac62887fe00eb22ea00622d4c3dab5ff40417e76 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Fri, 19 Nov 2010 16:23:52 +1000 Subject: Don't leak QML compiled data objects Task-number: QTBUG-14761 --- src/declarative/qml/qdeclarativecompileddata.cpp | 4 ++-- src/declarative/qml/qdeclarativecompiler.cpp | 2 -- src/declarative/qml/qdeclarativecompiler_p.h | 4 +--- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/declarative/qml/qdeclarativecompileddata.cpp b/src/declarative/qml/qdeclarativecompileddata.cpp index a4ecc77..690f499 100644 --- a/src/declarative/qml/qdeclarativecompileddata.cpp +++ b/src/declarative/qml/qdeclarativecompileddata.cpp @@ -169,8 +169,8 @@ QDeclarativeCompiledData::QDeclarativeCompiledData(QDeclarativeEngine *engine) QDeclarativeCompiledData::~QDeclarativeCompiledData() { for (int ii = 0; ii < types.count(); ++ii) { - if (types.at(ii).ref) - types.at(ii).ref->release(); + if (types.at(ii).component) + types.at(ii).component->release(); } for (int ii = 0; ii < propertyCaches.count(); ++ii) diff --git a/src/declarative/qml/qdeclarativecompiler.cpp b/src/declarative/qml/qdeclarativecompiler.cpp index b2740b8..645402e 100644 --- a/src/declarative/qml/qdeclarativecompiler.cpp +++ b/src/declarative/qml/qdeclarativecompiler.cpp @@ -591,8 +591,6 @@ bool QDeclarativeCompiler::compile(QDeclarativeEngine *engine, } } else if (tref.typeData) { ref.component = tref.typeData->compiledData(); - ref.ref = tref.typeData; - ref.ref->addref(); } ref.className = parserRef->name.toUtf8(); out->types << ref; diff --git a/src/declarative/qml/qdeclarativecompiler_p.h b/src/declarative/qml/qdeclarativecompiler_p.h index 43a0901..5cd1fd2 100644 --- a/src/declarative/qml/qdeclarativecompiler_p.h +++ b/src/declarative/qml/qdeclarativecompiler_p.h @@ -89,14 +89,12 @@ public: struct TypeReference { TypeReference() - : type(0), component(0), ref(0) {} + : type(0), component(0) {} QByteArray className; QDeclarativeType *type; -// QDeclarativeComponent *component; QDeclarativeCompiledData *component; - QDeclarativeRefCount *ref; QObject *createInstance(QDeclarativeContextData *, const QBitField &, QList *) const; const QMetaObject *metaObject() const; }; -- cgit v0.12 From 1119a86b9752a1a58dade499a2884b89b2275a57 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Fri, 19 Nov 2010 16:34:05 +1000 Subject: Allow testing of raster engine on Mac from qmlviewer --- tools/qml/main.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/qml/main.cpp b/tools/qml/main.cpp index 579f1ab..209c72f 100644 --- a/tools/qml/main.cpp +++ b/tools/qml/main.cpp @@ -155,7 +155,11 @@ void usage() qWarning(" -I ........................... prepend to the module import search path,"); qWarning(" display path if is empty"); qWarning(" -P ........................... prepend to the plugin search path"); +#if defined(Q_WS_MAC) + qWarning(" -no-opengl ............................... don't use a QGLWidget for the viewport"); +#else qWarning(" -opengl .................................. use a QGLWidget for the viewport"); +#endif qWarning(" -script ........................... set the script to use"); qWarning(" -scriptopts |help ............... set the script options to use"); @@ -370,8 +374,13 @@ static void parseCommandLineOptions(const QStringList &arguments) } else if (arg == "-translation") { if (lastArg) usage(); opts.translationFile = arguments.at(++i); +#if defined(Q_WS_MAC) + } else if (arg == "-no-opengl") { + opts.useGL = false; +#else } else if (arg == "-opengl") { opts.useGL = true; +#endif } else if (arg == "-qmlbrowser") { opts.useNativeFileBrowser = false; } else if (arg == "-warnings") { -- cgit v0.12 From 1960713543e2a5fee76df7dbf06ea70cf277d696 Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Fri, 19 Nov 2010 18:29:11 +1000 Subject: Initial commit of qmlvisualaids A tool to make it easier to do the platform visual updating. Needs to be streamlined at least a little in order to make it feasible to stay up to date. Task-number: QTBUG-14792 --- .../qmlvisual/shared/qmlvisualaids/Button.qml | 19 +++++ .../qmlvisual/shared/qmlvisualaids/Comparison.qml | 75 +++++++++++++++++ .../qmlvisual/shared/qmlvisualaids/main.cpp | 14 ++++ .../qmlvisual/shared/qmlvisualaids/mainwindow.cpp | 74 +++++++++++++++++ .../qmlvisual/shared/qmlvisualaids/mainwindow.h | 31 +++++++ .../qmlvisual/shared/qmlvisualaids/qmlvisual.pro | 26 ++++++ .../qmlvisual/shared/qmlvisualaids/qmlvisual.qrc | 6 ++ .../qmlvisual/shared/qmlvisualaids/testmodel.cpp | 96 ++++++++++++++++++++++ .../qmlvisual/shared/qmlvisualaids/testmodel.h | 50 +++++++++++ 9 files changed, 391 insertions(+) create mode 100644 tests/auto/declarative/qmlvisual/shared/qmlvisualaids/Button.qml create mode 100644 tests/auto/declarative/qmlvisual/shared/qmlvisualaids/Comparison.qml create mode 100644 tests/auto/declarative/qmlvisual/shared/qmlvisualaids/main.cpp create mode 100644 tests/auto/declarative/qmlvisual/shared/qmlvisualaids/mainwindow.cpp create mode 100644 tests/auto/declarative/qmlvisual/shared/qmlvisualaids/mainwindow.h create mode 100644 tests/auto/declarative/qmlvisual/shared/qmlvisualaids/qmlvisual.pro create mode 100644 tests/auto/declarative/qmlvisual/shared/qmlvisualaids/qmlvisual.qrc create mode 100644 tests/auto/declarative/qmlvisual/shared/qmlvisualaids/testmodel.cpp create mode 100644 tests/auto/declarative/qmlvisual/shared/qmlvisualaids/testmodel.h diff --git a/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/Button.qml b/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/Button.qml new file mode 100644 index 0000000..600079f --- /dev/null +++ b/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/Button.qml @@ -0,0 +1,19 @@ +import Qt 4.7 + +Rectangle { + width: txt.width + 16 + height: txt.height + 8 + radius: 4 + border.color: "black" + property alias caption: txt.text + signal triggered + Text{ + id: txt + text: "Button" + anchors.centerIn: parent + } + MouseArea{ + anchors.fill: parent + onClicked: parent.triggered() + } +} diff --git a/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/Comparison.qml b/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/Comparison.qml new file mode 100644 index 0000000..43b10d4 --- /dev/null +++ b/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/Comparison.qml @@ -0,0 +1,75 @@ +import Qt 4.7 + +Item{ + width: 1000 + height:800 + Row{ + spacing: 4 + Button{ + caption: "run" + onTriggered: test.runTest() + } + + Button{ + caption: "update" + onTriggered: test.updateVisuals() + } + + Button{ + caption: "platform" + onTriggered: test.updatePlatformVisuals() + } + } + + Rectangle { + y: 180 + width: 1000 + height: 620 + Row{ + id: grid + spacing: 4 + Text{ + width: 300 + height: 200 + text: test.testName + clip: true; wrapMode: Text.WordWrap + } + Text{ + width: 300 + height: 200 + text: test.testCase + clip: true; wrapMode: Text.WordWrap + } + Text{ + width: 300 + height: 200 + text: test.testScript + clip: true; wrapMode: Text.WordWrap + } + } + Item{ + y: 200 + Row{ + ListView{ + width: 200; height: 400 + delegate: Rectangle{ width: 200; height: 200; color: "blue"; Image{ source: modelData }} + model: test.goodImages; + } + ListView{ + width: 200; height: 400 + delegate: Rectangle{ width: 200; height: 200; color: "blue"; Image{ source: modelData }} + model: test.diffImages; + } + ListView{ + width: 200; height: 400 + delegate: Rectangle{ width: 200; height: 200; color: "blue"; Image{ source: modelData }} + model: test.badImages; + } + } + } + MouseArea{ + anchors.fill: parent + onClicked: test.moveOn(); + } + } +} diff --git a/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/main.cpp b/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/main.cpp new file mode 100644 index 0000000..2d35350 --- /dev/null +++ b/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/main.cpp @@ -0,0 +1,14 @@ +#include +#include +#include "mainwindow.h" +#include +#include +#include + +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + MainWindow *m = new MainWindow; + m->show(); + return a.exec(); +} diff --git a/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/mainwindow.cpp b/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/mainwindow.cpp new file mode 100644 index 0000000..49614ec --- /dev/null +++ b/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/mainwindow.cpp @@ -0,0 +1,74 @@ +#include "mainwindow.h" +#include +#include + +MainWindow::MainWindow(QWidget *parent) : + QMainWindow(parent), testIdx(-1) +{ + createMenus(); + view = new QDeclarativeView(this); + setCentralWidget(view); + view->setResizeMode(QDeclarativeView::SizeViewToRootObject); + curTest = new TestModel(this); + connect(curTest, SIGNAL(moveOn()), + this, SLOT(runTests())); + + view->engine()->rootContext()->setContextProperty("test", curTest); + view->setSource(QUrl("qrc:qml/Comparison.qml")); +} + +void MainWindow::runAllTests() +{ + tests.clear(); + testIdx = 0; + + QString visualTest = "./tst_qmlvisual";//TODO: Crossplatform + + QProcess p;//TODO: Error checking here + p.setProcessChannelMode(QProcess::MergedChannels); + p.start(visualTest, QStringList()); + p.waitForFinished(-1);//Can't time out, because it takes an indeterminate and long time + + QString output = QString(p.readAllStandardOutput()); + QRegExp re("QDeclarativeTester\\( \"([^\"]*)\" \\)"); + int offset=0; + while((offset = re.indexIn(output, offset)) != -1){ + tests << re.cap(1); + offset++; + } + + if(tests.count()) + QMessageBox::information(this, "Test Results", QString("Tests completed. %1 test failures occurred.").arg(tests.count())); + else + QMessageBox::information(this, "Test Results", "Tests completed. All tests passed!"); + + runTests(); +} + +void MainWindow::runTests() +{ + if(testIdx >= tests.size()) + testIdx = -1; + if(testIdx == -1) + return; + showFixScreen(tests[testIdx++]); +} + +void MainWindow::showFixScreen(const QString &path) +{ + if(curTest->setTest(path)){ + view->engine()->rootContext()->setContextProperty("test", curTest); //signal connects to runTests + }else{ + QMessageBox::critical(this, "Test Error", QString("Cannot find test %1.").arg(path)); + runTests(); + } +} + +void MainWindow::createMenus() +{ + QMenu *tests = this->menuBar()->addMenu("Tests"); + tests->addAction("Run All", this, SLOT(runAllTests())); + tests->addSeparator(); + tests->addAction("About Qt...", qApp, SLOT(aboutQt())); + tests->addAction("Quit", qApp, SLOT(quit())); +} diff --git a/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/mainwindow.h b/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/mainwindow.h new file mode 100644 index 0000000..0209064 --- /dev/null +++ b/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/mainwindow.h @@ -0,0 +1,31 @@ +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +#include +#include +#include +#include +#include "testmodel.h" + +class MainWindow : public QMainWindow +{ + Q_OBJECT +public: + explicit MainWindow(QWidget *parent = 0); + void createMenus(); + +signals: + +public slots: + void runTests(); + void runAllTests(); + void showFixScreen(const QString& path); + +private: + QDeclarativeView* view; + TestModel *curTest; + QStringList tests; + int testIdx; +}; + +#endif // MAINWINDOW_H diff --git a/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/qmlvisual.pro b/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/qmlvisual.pro new file mode 100644 index 0000000..d18c235 --- /dev/null +++ b/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/qmlvisual.pro @@ -0,0 +1,26 @@ +#------------------------------------------------- +# +# Project created by QtCreator 2010-11-19T09:48:39 +# +#------------------------------------------------- + +QT += core gui declarative + +TARGET = ../../qmlvisualaids +TEMPLATE = app + + +SOURCES += main.cpp \ + testmodel.cpp \ + mainwindow.cpp + +HEADERS += \ + testmodel.h \ + mainwindow.h + +OTHER_FILES += \ + Comparison.qml \ + Button.qml + +RESOURCES += \ + qmlvisual.qrc diff --git a/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/qmlvisual.qrc b/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/qmlvisual.qrc new file mode 100644 index 0000000..d79b64c --- /dev/null +++ b/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/qmlvisual.qrc @@ -0,0 +1,6 @@ + + + Comparison.qml + Button.qml + + diff --git a/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/testmodel.cpp b/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/testmodel.cpp new file mode 100644 index 0000000..4aec14b --- /dev/null +++ b/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/testmodel.cpp @@ -0,0 +1,96 @@ +#include "testmodel.h" +#include +#include +#include + +TestModel::TestModel(QObject *parent) : + QObject(parent), _testName("Invalid") +{ + +} + +//testPath is the path to the test script, and assumes the file under test has the same name and is in the dir above +bool TestModel::setTest(const QString &testPath) +{ + _good.clear(); + _bad.clear(); + _diff.clear(); + + _testScriptPath = testPath; + if(!_testScriptPath.endsWith(".qml")) + _testScriptPath += ".qml"; + _testName = _testScriptPath.split('/').last(); + + //Assumed that the test case is in the directory above and has the same name as the script + _testPath = _testScriptPath.left(_testScriptPath.lastIndexOf('/', _testScriptPath.lastIndexOf('/') - 1)) + + '/' + _testName; + + bool ret = QFile::exists(_testPath) && QFile::exists(_testScriptPath); + if(!ret) + return ret; + + QFile test(_testPath); + test.open(QFile::ReadOnly | QFile::Text); + _testCase = test.readAll(); + + QFile script(_testScriptPath); + script.open(QFile::ReadOnly | QFile::Text); + _testScript = script.readAll(); + + QString base = _testScriptPath; + base.chop(4);//remove .qml, replace with .%1.png + base += ".%1.png"; + int c = 0; + while (QFile::exists(base.arg(c))) { + _good << "file://" + base.arg(c); + if(QFile::exists(base.arg(c) + ".reject.png")) + _bad << "file://" + base.arg(c) + ".reject.png"; + else + _bad << ""; + + if(QFile::exists(base.arg(c) + ".diff.png")) + _diff << "file://" + base.arg(c) + ".diff.png"; + else + _diff << ""; + + c++; + } + + return ret; +} + +//returns true iff running the test changed the failure images. +bool TestModel::runTest() +{ + launchTester("-play"); + return false;//TODO: Actually check that +} + +void TestModel::updateVisuals() +{ + launchTester("-updatevisuals"); +} + +void TestModel::updatePlatformVisuals() +{ + launchTester("-updateplatformvisuals"); +} + +void TestModel::launchTester(const QString &args) +{ + QStringList arguments; + arguments << args << _testPath; + + QString visualTest; +#if defined(Q_WS_WIN) || defined(Q_WS_S60) + visualTest = "tst_qmlvisual.exe"; +#else + visualTest = "./tst_qmlvisual"; +#endif + + QProcess p; + p.setProcessChannelMode(QProcess::ForwardedChannels); + p.start(visualTest, arguments); + p.waitForFinished(); +} + diff --git a/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/testmodel.h b/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/testmodel.h new file mode 100644 index 0000000..fd64dc2 --- /dev/null +++ b/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/testmodel.h @@ -0,0 +1,50 @@ +#ifndef TESTMODEL_H +#define TESTMODEL_H + +#include +#include +#include + +class TestModel : public QObject +{ + Q_OBJECT + Q_PROPERTY(int snapshotCount READ snapshotCount CONSTANT) + Q_PROPERTY(QStringList goodImages READ goodImages CONSTANT)//List of image locatoins + Q_PROPERTY(QStringList badImages READ badImages CONSTANT) + Q_PROPERTY(QStringList diffImages READ diffImages CONSTANT) + Q_PROPERTY(QString testName READ testName CONSTANT) //The qml file name + Q_PROPERTY(QString testCase READ testCase CONSTANT) //The actual contents, not the location + Q_PROPERTY(QString testScript READ testScript CONSTANT) //The actual contents, not the location +public: + explicit TestModel(QObject *parent = 0); + bool setTest(const QString &testPath);//testPath is the path to the test script, and assumes the file under test has the same name and is in the dir above + + int snapshotCount() { return _count; } + QString testCase() { return _testCase; } + QString testName() { return _testName; } + QString testScript() {return _testScript; } + QStringList goodImages() {return _good;} + QStringList badImages() { return _bad; } + QStringList diffImages() {return _diff;} + +signals: + void moveOn(); + +public slots: + bool runTest();//returns true iff running the test changed the failure images. + void updateVisuals(); + void updatePlatformVisuals(); + +private: + void launchTester(const QString &args); + + int _count; + QStringList _good,_bad,_diff; + QString _testCase; + QString _testScript; + QString _testPath; + QString _testScriptPath; + QString _testName; +}; + +#endif // TESTMODEL_H -- cgit v0.12 From 18205faa87abd85d0848291738821666928b5769 Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Fri, 19 Nov 2010 19:31:01 +1000 Subject: Move qmlvisualaids to another repo Moved to a personal repo, since its fate is a little uncertain so it shouldn't draw this much attention. Task-number: QTBUG-14792 --- .../qmlvisual/shared/qmlvisualaids/Button.qml | 19 ----- .../qmlvisual/shared/qmlvisualaids/Comparison.qml | 75 ----------------- .../qmlvisual/shared/qmlvisualaids/main.cpp | 14 ---- .../qmlvisual/shared/qmlvisualaids/mainwindow.cpp | 74 ----------------- .../qmlvisual/shared/qmlvisualaids/mainwindow.h | 31 ------- .../qmlvisual/shared/qmlvisualaids/qmlvisual.pro | 26 ------ .../qmlvisual/shared/qmlvisualaids/qmlvisual.qrc | 6 -- .../qmlvisual/shared/qmlvisualaids/testmodel.cpp | 96 ---------------------- .../qmlvisual/shared/qmlvisualaids/testmodel.h | 50 ----------- 9 files changed, 391 deletions(-) delete mode 100644 tests/auto/declarative/qmlvisual/shared/qmlvisualaids/Button.qml delete mode 100644 tests/auto/declarative/qmlvisual/shared/qmlvisualaids/Comparison.qml delete mode 100644 tests/auto/declarative/qmlvisual/shared/qmlvisualaids/main.cpp delete mode 100644 tests/auto/declarative/qmlvisual/shared/qmlvisualaids/mainwindow.cpp delete mode 100644 tests/auto/declarative/qmlvisual/shared/qmlvisualaids/mainwindow.h delete mode 100644 tests/auto/declarative/qmlvisual/shared/qmlvisualaids/qmlvisual.pro delete mode 100644 tests/auto/declarative/qmlvisual/shared/qmlvisualaids/qmlvisual.qrc delete mode 100644 tests/auto/declarative/qmlvisual/shared/qmlvisualaids/testmodel.cpp delete mode 100644 tests/auto/declarative/qmlvisual/shared/qmlvisualaids/testmodel.h diff --git a/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/Button.qml b/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/Button.qml deleted file mode 100644 index 600079f..0000000 --- a/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/Button.qml +++ /dev/null @@ -1,19 +0,0 @@ -import Qt 4.7 - -Rectangle { - width: txt.width + 16 - height: txt.height + 8 - radius: 4 - border.color: "black" - property alias caption: txt.text - signal triggered - Text{ - id: txt - text: "Button" - anchors.centerIn: parent - } - MouseArea{ - anchors.fill: parent - onClicked: parent.triggered() - } -} diff --git a/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/Comparison.qml b/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/Comparison.qml deleted file mode 100644 index 43b10d4..0000000 --- a/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/Comparison.qml +++ /dev/null @@ -1,75 +0,0 @@ -import Qt 4.7 - -Item{ - width: 1000 - height:800 - Row{ - spacing: 4 - Button{ - caption: "run" - onTriggered: test.runTest() - } - - Button{ - caption: "update" - onTriggered: test.updateVisuals() - } - - Button{ - caption: "platform" - onTriggered: test.updatePlatformVisuals() - } - } - - Rectangle { - y: 180 - width: 1000 - height: 620 - Row{ - id: grid - spacing: 4 - Text{ - width: 300 - height: 200 - text: test.testName - clip: true; wrapMode: Text.WordWrap - } - Text{ - width: 300 - height: 200 - text: test.testCase - clip: true; wrapMode: Text.WordWrap - } - Text{ - width: 300 - height: 200 - text: test.testScript - clip: true; wrapMode: Text.WordWrap - } - } - Item{ - y: 200 - Row{ - ListView{ - width: 200; height: 400 - delegate: Rectangle{ width: 200; height: 200; color: "blue"; Image{ source: modelData }} - model: test.goodImages; - } - ListView{ - width: 200; height: 400 - delegate: Rectangle{ width: 200; height: 200; color: "blue"; Image{ source: modelData }} - model: test.diffImages; - } - ListView{ - width: 200; height: 400 - delegate: Rectangle{ width: 200; height: 200; color: "blue"; Image{ source: modelData }} - model: test.badImages; - } - } - } - MouseArea{ - anchors.fill: parent - onClicked: test.moveOn(); - } - } -} diff --git a/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/main.cpp b/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/main.cpp deleted file mode 100644 index 2d35350..0000000 --- a/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/main.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include -#include -#include "mainwindow.h" -#include -#include -#include - -int main(int argc, char *argv[]) -{ - QApplication a(argc, argv); - MainWindow *m = new MainWindow; - m->show(); - return a.exec(); -} diff --git a/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/mainwindow.cpp b/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/mainwindow.cpp deleted file mode 100644 index 49614ec..0000000 --- a/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/mainwindow.cpp +++ /dev/null @@ -1,74 +0,0 @@ -#include "mainwindow.h" -#include -#include - -MainWindow::MainWindow(QWidget *parent) : - QMainWindow(parent), testIdx(-1) -{ - createMenus(); - view = new QDeclarativeView(this); - setCentralWidget(view); - view->setResizeMode(QDeclarativeView::SizeViewToRootObject); - curTest = new TestModel(this); - connect(curTest, SIGNAL(moveOn()), - this, SLOT(runTests())); - - view->engine()->rootContext()->setContextProperty("test", curTest); - view->setSource(QUrl("qrc:qml/Comparison.qml")); -} - -void MainWindow::runAllTests() -{ - tests.clear(); - testIdx = 0; - - QString visualTest = "./tst_qmlvisual";//TODO: Crossplatform - - QProcess p;//TODO: Error checking here - p.setProcessChannelMode(QProcess::MergedChannels); - p.start(visualTest, QStringList()); - p.waitForFinished(-1);//Can't time out, because it takes an indeterminate and long time - - QString output = QString(p.readAllStandardOutput()); - QRegExp re("QDeclarativeTester\\( \"([^\"]*)\" \\)"); - int offset=0; - while((offset = re.indexIn(output, offset)) != -1){ - tests << re.cap(1); - offset++; - } - - if(tests.count()) - QMessageBox::information(this, "Test Results", QString("Tests completed. %1 test failures occurred.").arg(tests.count())); - else - QMessageBox::information(this, "Test Results", "Tests completed. All tests passed!"); - - runTests(); -} - -void MainWindow::runTests() -{ - if(testIdx >= tests.size()) - testIdx = -1; - if(testIdx == -1) - return; - showFixScreen(tests[testIdx++]); -} - -void MainWindow::showFixScreen(const QString &path) -{ - if(curTest->setTest(path)){ - view->engine()->rootContext()->setContextProperty("test", curTest); //signal connects to runTests - }else{ - QMessageBox::critical(this, "Test Error", QString("Cannot find test %1.").arg(path)); - runTests(); - } -} - -void MainWindow::createMenus() -{ - QMenu *tests = this->menuBar()->addMenu("Tests"); - tests->addAction("Run All", this, SLOT(runAllTests())); - tests->addSeparator(); - tests->addAction("About Qt...", qApp, SLOT(aboutQt())); - tests->addAction("Quit", qApp, SLOT(quit())); -} diff --git a/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/mainwindow.h b/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/mainwindow.h deleted file mode 100644 index 0209064..0000000 --- a/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/mainwindow.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#include -#include -#include -#include -#include "testmodel.h" - -class MainWindow : public QMainWindow -{ - Q_OBJECT -public: - explicit MainWindow(QWidget *parent = 0); - void createMenus(); - -signals: - -public slots: - void runTests(); - void runAllTests(); - void showFixScreen(const QString& path); - -private: - QDeclarativeView* view; - TestModel *curTest; - QStringList tests; - int testIdx; -}; - -#endif // MAINWINDOW_H diff --git a/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/qmlvisual.pro b/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/qmlvisual.pro deleted file mode 100644 index d18c235..0000000 --- a/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/qmlvisual.pro +++ /dev/null @@ -1,26 +0,0 @@ -#------------------------------------------------- -# -# Project created by QtCreator 2010-11-19T09:48:39 -# -#------------------------------------------------- - -QT += core gui declarative - -TARGET = ../../qmlvisualaids -TEMPLATE = app - - -SOURCES += main.cpp \ - testmodel.cpp \ - mainwindow.cpp - -HEADERS += \ - testmodel.h \ - mainwindow.h - -OTHER_FILES += \ - Comparison.qml \ - Button.qml - -RESOURCES += \ - qmlvisual.qrc diff --git a/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/qmlvisual.qrc b/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/qmlvisual.qrc deleted file mode 100644 index d79b64c..0000000 --- a/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/qmlvisual.qrc +++ /dev/null @@ -1,6 +0,0 @@ - - - Comparison.qml - Button.qml - - diff --git a/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/testmodel.cpp b/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/testmodel.cpp deleted file mode 100644 index 4aec14b..0000000 --- a/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/testmodel.cpp +++ /dev/null @@ -1,96 +0,0 @@ -#include "testmodel.h" -#include -#include -#include - -TestModel::TestModel(QObject *parent) : - QObject(parent), _testName("Invalid") -{ - -} - -//testPath is the path to the test script, and assumes the file under test has the same name and is in the dir above -bool TestModel::setTest(const QString &testPath) -{ - _good.clear(); - _bad.clear(); - _diff.clear(); - - _testScriptPath = testPath; - if(!_testScriptPath.endsWith(".qml")) - _testScriptPath += ".qml"; - _testName = _testScriptPath.split('/').last(); - - //Assumed that the test case is in the directory above and has the same name as the script - _testPath = _testScriptPath.left(_testScriptPath.lastIndexOf('/', _testScriptPath.lastIndexOf('/') - 1)) - + '/' + _testName; - - bool ret = QFile::exists(_testPath) && QFile::exists(_testScriptPath); - if(!ret) - return ret; - - QFile test(_testPath); - test.open(QFile::ReadOnly | QFile::Text); - _testCase = test.readAll(); - - QFile script(_testScriptPath); - script.open(QFile::ReadOnly | QFile::Text); - _testScript = script.readAll(); - - QString base = _testScriptPath; - base.chop(4);//remove .qml, replace with .%1.png - base += ".%1.png"; - int c = 0; - while (QFile::exists(base.arg(c))) { - _good << "file://" + base.arg(c); - if(QFile::exists(base.arg(c) + ".reject.png")) - _bad << "file://" + base.arg(c) + ".reject.png"; - else - _bad << ""; - - if(QFile::exists(base.arg(c) + ".diff.png")) - _diff << "file://" + base.arg(c) + ".diff.png"; - else - _diff << ""; - - c++; - } - - return ret; -} - -//returns true iff running the test changed the failure images. -bool TestModel::runTest() -{ - launchTester("-play"); - return false;//TODO: Actually check that -} - -void TestModel::updateVisuals() -{ - launchTester("-updatevisuals"); -} - -void TestModel::updatePlatformVisuals() -{ - launchTester("-updateplatformvisuals"); -} - -void TestModel::launchTester(const QString &args) -{ - QStringList arguments; - arguments << args << _testPath; - - QString visualTest; -#if defined(Q_WS_WIN) || defined(Q_WS_S60) - visualTest = "tst_qmlvisual.exe"; -#else - visualTest = "./tst_qmlvisual"; -#endif - - QProcess p; - p.setProcessChannelMode(QProcess::ForwardedChannels); - p.start(visualTest, arguments); - p.waitForFinished(); -} - diff --git a/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/testmodel.h b/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/testmodel.h deleted file mode 100644 index fd64dc2..0000000 --- a/tests/auto/declarative/qmlvisual/shared/qmlvisualaids/testmodel.h +++ /dev/null @@ -1,50 +0,0 @@ -#ifndef TESTMODEL_H -#define TESTMODEL_H - -#include -#include -#include - -class TestModel : public QObject -{ - Q_OBJECT - Q_PROPERTY(int snapshotCount READ snapshotCount CONSTANT) - Q_PROPERTY(QStringList goodImages READ goodImages CONSTANT)//List of image locatoins - Q_PROPERTY(QStringList badImages READ badImages CONSTANT) - Q_PROPERTY(QStringList diffImages READ diffImages CONSTANT) - Q_PROPERTY(QString testName READ testName CONSTANT) //The qml file name - Q_PROPERTY(QString testCase READ testCase CONSTANT) //The actual contents, not the location - Q_PROPERTY(QString testScript READ testScript CONSTANT) //The actual contents, not the location -public: - explicit TestModel(QObject *parent = 0); - bool setTest(const QString &testPath);//testPath is the path to the test script, and assumes the file under test has the same name and is in the dir above - - int snapshotCount() { return _count; } - QString testCase() { return _testCase; } - QString testName() { return _testName; } - QString testScript() {return _testScript; } - QStringList goodImages() {return _good;} - QStringList badImages() { return _bad; } - QStringList diffImages() {return _diff;} - -signals: - void moveOn(); - -public slots: - bool runTest();//returns true iff running the test changed the failure images. - void updateVisuals(); - void updatePlatformVisuals(); - -private: - void launchTester(const QString &args); - - int _count; - QStringList _good,_bad,_diff; - QString _testCase; - QString _testScript; - QString _testPath; - QString _testScriptPath; - QString _testName; -}; - -#endif // TESTMODEL_H -- cgit v0.12