Skip to content

multiple quickwindow scenegraph couldn't render correct #80

Description

@msinamsh

@cinderblocks
@jcelerier
@jarkkokoivikko-code-q
@NielsMayer
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:

Screen Shot 2024-01-30 at 2 17 59 AM

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

Screen Shot 2024-01-30 at 2 20 09 AM

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

.
and maybe its because i should render scenegraph with multithread according to this link:
https://doc.qt.io/qt-6/qtquick-visualcanvas-scenegraph.html#what-if-there-is-no-or-more-than-one-window-visible

but i dont know how can i

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions