Hi,
Having quite a beefy C++ project. Starting from scratch would be last resort. New features like “Flow” layout and Timeline are quite attractive but unfortunately, never made it to the QT C++ framework. I’m wondering if it’s possible to leverage QML inside a C++ QApplication?
More specifically, how would someone go about “creating” a QML Timeline and use it in a C++ QMainWindow?
My guess is YES as I’ve seen this example but can’t really compile and test it on windows:
int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
QSurfaceFormat::setDefaultFormat(QQuick3D::idealSurfaceFormat());
qputenv("QT_QUICK_CONTROLS_STYLE", "Basic");
QQmlApplicationEngine engine;
engine.
load(QUrl(QStringLiteral
("qrc:/main.qml")));
if (engine.rootObjects().isEmpty())
return -1;
return app.exec();
}
int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
QSurfaceFormat::setDefaultFormat(QQuick3D::idealSurfaceFormat());
qputenv("QT_QUICK_CONTROLS_STYLE", "Basic");
QQmlApplicationEngine engine;
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
if (engine.rootObjects().isEmpty())
return -1;
return app.exec();
}
To copy to clipboard, switch view to plain text mode
Bookmarks