path: root/src/plugins/platforms/vnc/qvncintegration.cpp
diff options
authorLaszlo Agocs <>2021-01-02 19:42:06 +0100
committerLaszlo Agocs <>2021-01-04 17:30:43 +0100
commit587fed817aec5a435fb6467cd42b77831271ec34 (patch)
tree74a8f3b820a53a0e3317b8e80931f8e0002629b3 /src/plugins/platforms/vnc/qvncintegration.cpp
parent8da171a5aee304421ca0cd2f5c20c9bfa8205dc1 (diff)
Add a platform capability indicating support for QRhi-based rendering
This attempts to reconcile a minor difference between Qt 5 and Qt 6: Running Qt Quick applications with a platform plugin such as vnc, led to an automatic fallback to the 'software' backend based on the OpenGL capability reported from the platform plugin. In Qt 6.0 this logic is gone from Qt Quick, because we do not have, and wish not to have, individual flags for each and every 3D API on this level. Therefore in Qt 6.0 a Qt Quick application running with the vnc (or linuxfb, or minimal) platform needs an explicit selection of the software backend via QT_QUICK_BACKEND or QQuickWindow::setGraphicsApi(). To keep migration for users of such platform plugins easier, we can still reintroduce a Qt 5-like logic: by having a high level Is-QRhi-Supported type of flag, we can make Qt Quick query that, and trigger the fallback to the software backend when it is reported as false by the platform plugin. As this is the minority case and a conscious choice by platform plugins, the flag can be opt-out (i.e. true by the default hasCapability implementation). When it comes to the existing OpenGL flag, that needs to stay for compatibility reasons, but it is worth noting that the new flag semantically falls in the exact same category: it does not indicate things will really work at run time, but rather serves as an opt-out, "do not even try" type of declaration the platform plugin can make, which then allows modules like Qt Quick to make early, upfront decisions about which rendering paths/backends to take. Change-Id: I8d6fddeb82ca6eece7b7abc1a5b64ebe6d8af29d Task-number: QTBUG-89561 Reviewed-by: Andy Nichols <>
Diffstat (limited to 'src/plugins/platforms/vnc/qvncintegration.cpp')
1 files changed, 1 insertions, 0 deletions
diff --git a/src/plugins/platforms/vnc/qvncintegration.cpp b/src/plugins/platforms/vnc/qvncintegration.cpp
index 9836839274..e6586ebfa6 100644
--- a/src/plugins/platforms/vnc/qvncintegration.cpp
+++ b/src/plugins/platforms/vnc/qvncintegration.cpp
@@ -105,6 +105,7 @@ bool QVncIntegration::hasCapability(QPlatformIntegration::Capability cap) const
switch (cap) {
case ThreadedPixmaps: return true;
case WindowManagement: return false;
+ case RhiBasedRendering: return false;
default: return QPlatformIntegration::hasCapability(cap);