lundi 20 avril 2015

I got errors: "QQmlApplicationEngine failed to load component" and "qrc:/main.qml:-1 File not found"

I created a Qt Widgets application, then added a qml named "main.qml" to it. My files are dialog.cpp, dialog.h, dialog.ui, main.cpp,, main.qml in qml.qrc

#include "dialog.h"
#include <QApplication>
#include <QQmlApplicationEngine>
int main(int argc, char *argv[])
QApplication a(argc, argv);
Dialog w;
   QQmlApplicationEngine engine;
// engine.load(QUrl(QStringLiteral("qrc://main.qml")));
return a.exec();


I wrote "QT += qml quick widgets" in
I didn't modified other codes, how did this happen? This is my first question in stackoverflow, I try to make my question clear.

Aucun commentaire:

Enregistrer un commentaire