i designed an app using scenegraph for rendering some 2d on qtquick and qml. My goal is render some 2d content on main window and another 2d content on a seprate window.I load my app from c++ with this code :
QGuiApplication app(argc, argv); QQmlApplicationEngine engine;#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)#ifndef QNANO_USE_RHI QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGL);#endif#endif const QUrl url(u"qrc:/NoroView/Main.qml"_qs); QObject::connect(&engine, &QQmlApplicationEngine::objectCreationFailed,&app, []() { QCoreApplication::exit(-1); }, Qt::QueuedConnection); engine.load(url); return app.exec();
and
QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGL);
is for set graphics api for using on scene graph and its ok.like this photo:
Everything goes fine with just one window(main window) but when i open another seprate window to render second content on it using ApplicationWindow from qml texts on the main window get unreadable and content on the second window turn into mono color(just green) and the texts will get completely unreadable as you can see in below image
and i think its because i cant use setgraphicsapi for second window that i opened from qml with ApplicationWindow