summaryrefslogtreecommitdiffstats
path: root/examples/declarative/extending/extended/main.cpp
blob: 1006214ef4f29656f16f6f3b67caacd1d2f69e02 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <QApplication>
#include <QmlEngine>
#include <QmlComponent>
#include <QDebug>
#include <QLineEdit>

int main(int argc, char ** argv)
{
    QApplication app(argc, argv);

    QmlEngine engine;
    QmlComponent component(&engine, ":example.qml");
    QLineEdit *edit = qobject_cast<QLineEdit *>(component.create());

    if (edit) {
        edit->show();
        return app.exec();
    } else {
        qWarning() << "An error occured";
        return 0;
    }
}