summaryrefslogtreecommitdiff
path: root/tests/tst_qml/tst_qmltest.cpp
blob: 38e5411bfa8103e71fc9adc4853f97164ef09deb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include <QString>
#include <QtTest>
#include <QCoreApplication>
#include <QtQml>

class QmlTest : public QObject
{
    Q_OBJECT

private slots:
    void testCase1()
    {
        QQmlEngine engine;
        engine.addImportPath(qApp->applicationDirPath() + "/../../src");
        qDebug() << (qApp->applicationDirPath() + "/../../src");

        QStringListModel modelData;
        QQmlContext *context = new QQmlContext(engine.rootContext());
        context->setContextProperty("myModel", &modelData);

        QQmlComponent component(&engine);
        component.setData("import QtQuickStreamer 1.0\n"
                          "Pipeline { name: 'qmltest' }",
                          QUrl());
        qDebug() << component.errors();
        QObject *view = component.create(context);
    }
};

QTEST_MAIN(QmlTest)

#include "tst_qmltest.moc"