summaryrefslogtreecommitdiffstats
path: root/tests/manual
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2024-02-29 13:21:25 +0100
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2024-03-01 20:41:30 +0100
commitf451b01791536fede40c8d4fb90799c2e23e9386 (patch)
tree7e9e1b147060cc10024b1601d2edea5698292802 /tests/manual
parentb571634172428263fa83ac733cf89e664bded014 (diff)
Add QWidgetPrivate::rhi() helper method
For accessing the RHI managed by the widget compositing machinery. Pick-to: 6.7 6.6 6.5 Change-Id: Ia3c1227cc2d9cfebe95611cad3dbcd7aa6f6f8c7 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Diffstat (limited to 'tests/manual')
-rw-r--r--tests/manual/rhi/rhiwidgetproto/rhiwidget.cpp9
1 files changed, 1 insertions, 8 deletions
diff --git a/tests/manual/rhi/rhiwidgetproto/rhiwidget.cpp b/tests/manual/rhi/rhiwidgetproto/rhiwidget.cpp
index e801940c86..d535c655d0 100644
--- a/tests/manual/rhi/rhiwidgetproto/rhiwidget.cpp
+++ b/tests/manual/rhi/rhiwidgetproto/rhiwidget.cpp
@@ -155,14 +155,7 @@ QPlatformBackingStoreRhiConfig QRhiWidgetPrivate::rhiConfig() const
void QRhiWidgetPrivate::ensureRhi()
{
Q_Q(QRhiWidget);
- // the QRhi and infrastructure belongs to the top-level widget, not to this widget
- QWidget *tlw = q->window();
- QWidgetPrivate *wd = get(tlw);
-
- QRhi *currentRhi = nullptr;
- if (QWidgetRepaintManager *repaintManager = wd->maybeRepaintManager())
- currentRhi = repaintManager->rhi();
-
+ QRhi *currentRhi = QWidgetPrivate::rhi();
if (currentRhi && currentRhi->backend() != QBackingStoreRhiSupport::apiToRhiBackend(config.api())) {
qWarning("The top-level window is already using another graphics API for composition, "
"'%s' is not compatible with this widget",