| 286 | } |
| 287 | |
| 288 | void RenderModeRequest::apply() |
| 289 | { |
| 290 | QMutexLocker lock(&mutex); |
| 291 | |
| 292 | if (connection) |
| 293 | disconnect(connection); |
| 294 | |
| 295 | if (window && window->rendererInterface()->graphicsApi() != QSGRendererInterface::OpenGL) |
| 296 | return; |
| 297 | |
| 298 | if (window) { |
| 299 | const QByteArray mode = renderModeToString(RenderModeRequest::mode); |
| 300 | QQuickWindowPrivate *winPriv = QQuickWindowPrivate::get(window); |
| 301 | QObject::connect(window.get(), &QQuickWindow::beforeSynchronizing, this, [this, winPriv, mode]() { |
| 302 | emit aboutToCleanSceneGraph(); |
| 303 | QMetaObject::invokeMethod(window, "cleanupSceneGraph", Qt::DirectConnection); |
| 304 | winPriv->visualizationMode = mode; |
| 305 | emit sceneGraphCleanedUp(); }, static_cast<Qt::ConnectionType>(Qt::DirectConnection | Qt::SingleShotConnection)); |
| 306 | } |
| 307 | |
| 308 | QMetaObject::invokeMethod(this, "preFinished", Qt::QueuedConnection); |
| 309 | } |
| 310 | |
| 311 | void RenderModeRequest::preFinished() |
| 312 | { |
nothing calls this directly
no test coverage detected