Quantcast
Channel: Active questions tagged qtquick2 - Stack Overflow
Viewing all articles
Browse latest Browse all 107

multiwindow scenegraph couldn't renderr correct [closed]

$
0
0

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:enter image description here

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 imageenter image description here

and i think its because i cant use setgraphicsapi for second window that i opened from qml with ApplicationWindow


Viewing all articles
Browse latest Browse all 107

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>