sylas
16th January 2017, 15:54
Hi all! If I don't write: /home/sylvain/quick/main.qml it doesn't work. My name is sylvain. I think it is not normal to write his name in a code. . This thread continues the old thread "view possible in the design mode and qmlscene but not at the end or"run" ". Here, below, the code of main.cpp.
//main.cpp
#include <QGuiApplication>
#include <QQuickView>
int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
QQuickView view;
//view.setSource(QUrl::fromLocalFile("qrc:/main.qml"));//unfortunately doesn't work
view.setSource(QUrl::fromLocalFile("/home/sylvain/quick/main.qml"));
view.show();
return app.exec();
}
//main.cpp
#include <QGuiApplication>
#include <QQuickView>
int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
QQuickView view;
//view.setSource(QUrl::fromLocalFile("qrc:/main.qml"));//unfortunately doesn't work
view.setSource(QUrl::fromLocalFile("/home/sylvain/quick/main.qml"));
view.show();
return app.exec();
}