#include <QtCore/qtranslator.h>
#include <QSignalSpy>
+#include "../shared/util.h"
+
Q_DECLARE_METATYPE(QList<int>)
Q_DECLARE_METATYPE(QList<QVariantHash>)
QDeclarativeListModel model;
QDeclarativeEngine eng;
- QDeclarativeComponent component(&eng, QUrl::fromLocalFile(SRCDIR "/data/model.qml"));
+ QDeclarativeComponent component(&eng, QUrl::fromLocalFile(TESTDATA("model.qml")));
QQuickItem *item = createWorkerTest(&eng, &component, &model);
QVERIFY(item != 0);
QDeclarativeListModel model;
QDeclarativeEngine eng;
- QDeclarativeComponent component(&eng, QUrl::fromLocalFile(SRCDIR "/data/model.qml"));
+ QDeclarativeComponent component(&eng, QUrl::fromLocalFile(TESTDATA("model.qml")));
QQuickItem *item = createWorkerTest(&eng, &component, &model);
QVERIFY(item != 0);
void tst_qdeclarativelistmodel::enumerate()
{
QDeclarativeEngine eng;
- QDeclarativeComponent component(&eng, QUrl::fromLocalFile(SRCDIR "/data/enumerate.qml"));
+ QDeclarativeComponent component(&eng, QUrl::fromLocalFile(TESTDATA("enumerate.qml")));
QVERIFY(!component.isError());
QQuickItem *item = qobject_cast<QQuickItem*>(component.create());
QVERIFY(item != 0);
QDeclarativeListModel model;
QDeclarativeEngine eng;
- QDeclarativeComponent component(&eng, QUrl::fromLocalFile(SRCDIR "/data/model.qml"));
+ QDeclarativeComponent component(&eng, QUrl::fromLocalFile(TESTDATA("model.qml")));
QQuickItem *item = createWorkerTest(&eng, &component, &model);
QVERIFY(item != 0);
void tst_qdeclarativelistmodel::crash_model_with_multiple_roles()
{
QDeclarativeEngine eng;
- QDeclarativeComponent component(&eng, QUrl::fromLocalFile(SRCDIR "/data/multipleroles.qml"));
+ QDeclarativeComponent component(&eng, QUrl::fromLocalFile(TESTDATA("multipleroles.qml")));
QObject *rootItem = component.create();
QVERIFY(component.errorString().isEmpty());
QVERIFY(rootItem != 0);
void tst_qdeclarativelistmodel::set_model_cache()
{
QDeclarativeEngine eng;
- QDeclarativeComponent component(&eng, QUrl::fromLocalFile(SRCDIR "/data/setmodelcachelist.qml"));
+ QDeclarativeComponent component(&eng, QUrl::fromLocalFile(TESTDATA("setmodelcachelist.qml")));
QObject *model = component.create();
QVERIFY2(component.errorString().isEmpty(), QTest::toString(component.errorString()));
QVERIFY(model != 0);
QDeclarativeListModel model;
QDeclarativeEngine engine;
- QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/model.qml"));
+ QDeclarativeComponent component(&engine, QUrl::fromLocalFile(TESTDATA("model.qml")));
QVERIFY2(component.errorString().isEmpty(), component.errorString().toUtf8());
QQuickItem *item = createWorkerTest(&engine, &component, &model);
QVERIFY(item != 0);
void tst_qdeclarativelistmodel::signal_handlers()
{
QDeclarativeEngine eng;
- QDeclarativeComponent component(&eng, QUrl::fromLocalFile(SRCDIR "/data/signalhandlers.qml"));
+ QDeclarativeComponent component(&eng, QUrl::fromLocalFile(TESTDATA("signalhandlers.qml")));
QObject *model = component.create();
QVERIFY2(component.errorString().isEmpty(), QTest::toString(component.errorString()));
QVERIFY(model != 0);
{
QDeclarativeListModel model;
QDeclarativeEngine eng;
- QDeclarativeComponent component(&eng, QUrl::fromLocalFile(SRCDIR "/data/workersync.qml"));
+ QDeclarativeComponent component(&eng, QUrl::fromLocalFile(TESTDATA("workersync.qml")));
QQuickItem *item = createWorkerTest(&eng, &component, &model);
QVERIFY(item != 0);
{
QDeclarativeListModel model;
QDeclarativeEngine eng;
- QDeclarativeComponent component(&eng, QUrl::fromLocalFile(SRCDIR "/data/workerremoveelement.qml"));
+ QDeclarativeComponent component(&eng, QUrl::fromLocalFile(TESTDATA("workerremoveelement.qml")));
QQuickItem *item = createWorkerTest(&eng, &component, &model);
QVERIFY(item != 0);
{
QDeclarativeListModel model;
QDeclarativeEngine eng;
- QDeclarativeComponent component(&eng, QUrl::fromLocalFile(SRCDIR "/data/workerremovelist.qml"));
+ QDeclarativeComponent component(&eng, QUrl::fromLocalFile(TESTDATA("workerremovelist.qml")));
QQuickItem *item = createWorkerTest(&eng, &component, &model);
QVERIFY(item != 0);