From 3c20b9b97377172dd1fc384bd28d3c7dbff0f523 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Mon, 17 Feb 2020 15:32:39 +0100 Subject: QGraphicsProxyWidgets: document that using OpenGL comes with limitations The documentation already states that high-performance scenarios are not a usecase that mixes well with QGraphicsProxyWidget. However, we can generally not test or support all combinations of widgets and styles with an OpenGL viewport. That Qt's basic framework code has to be graphicsview aware is already unfortunate enough; adding more special checks all over the place hurts maintainability, makes the general usecase slower, and poorly serves use-cases that are beyond of what QGraphicsProxyWidget was designed for. Change-Id: Iff43ead292240f7b068dcf9206bb3bee3031b1dc Fixes: QTBUG-63687 Reviewed-by: Friedemann Kleint Reviewed-by: Paul Wicking --- src/widgets/graphicsview/qgraphicsproxywidget.cpp | 4 +++- src/widgets/graphicsview/qgraphicsview.cpp | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/widgets/graphicsview/qgraphicsproxywidget.cpp b/src/widgets/graphicsview/qgraphicsproxywidget.cpp index a9a57c57fa..fe3475e6bb 100644 --- a/src/widgets/graphicsview/qgraphicsproxywidget.cpp +++ b/src/widgets/graphicsview/qgraphicsproxywidget.cpp @@ -183,7 +183,9 @@ QT_BEGIN_NAMESPACE \warning This class is provided for convenience when bridging QWidgets and QGraphicsItems, it should not be used for - high-performance scenarios. + high-performance scenarios. In particular, embedding widgets into a scene + that is then displayed through a QGraphicsView that uses an OpenGL viewport + will not work for all combinations. \sa QGraphicsScene::addWidget(), QGraphicsWidget */ diff --git a/src/widgets/graphicsview/qgraphicsview.cpp b/src/widgets/graphicsview/qgraphicsview.cpp index 686b41960a..7ac9aebfe6 100644 --- a/src/widgets/graphicsview/qgraphicsview.cpp +++ b/src/widgets/graphicsview/qgraphicsview.cpp @@ -123,6 +123,10 @@ static const int QGRAPHICSVIEW_PREALLOC_STYLE_OPTIONS = 503; // largest prime < \image graphicsview-view.png + \note Using an OpenGL viewport limits the ability to use QGraphicsProxyWidget. + Not all combinations of widgets and styles can be supported with such a setup. + You should carefully test your UI and make the necessary adjustments. + \sa QGraphicsScene, QGraphicsItem, QGraphicsSceneEvent */ -- cgit v1.2.3