Converting QMLProject to Pro issues, questions
-
Hey,
I have made a project design using design studio, and realised that I could not build without converting to pro.
I followed the https://doc.qt.io/qtcreator/quick-converting-ui-projects.html
And it works, but I had to do a lot of changes. and the tutorial says to create a QQuickView view;
But that only gave errors, so main.cpp ended up like this to work:QQmlApplicationEngine engine; const QUrl url(QStringLiteral("qrc:/qml/main.qml")); QObject::connect(&engine, &QQmlApplicationEngine::objectCreated, &app, [url](QObject *obj, const QUrl &objUrl) { if (!obj && url == objUrl) QCoreApplication::exit(-1); }, Qt::QueuedConnection); engine.load(url); app.exec();
Also, the styles set in design studio was gone, and so was the
Import ProjectName
Had to change it to
import "../imports/ProjectName"
To get the Constants from design studio project..
Should the tutorial work right out the box, or is the changes I have made normal to make?
Feels like I missed something as I have to change stuff in each QML file..