View Single Post
Posts: 62 | Thanked: 158 times | Joined on Jul 2011 @ Malaysia
#3
I added the line addimportpath but the error still exist Here's my code

Code:
#include <QApplication>
#include <QtDeclarative>
#include <QUrl>

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    QDeclarativeView view;
    view.setSource(QUrl("qrc:/main.qml"));
    view.engine()->addImportPath(QString("/opt/qtm12/imports"));
    view.showMaximized();
    return app.exec();
}