diff options
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/snippets/code/src_gui_graphicsview_qgraphicsitem.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/doc/src/snippets/code/src_gui_graphicsview_qgraphicsitem.cpp b/doc/src/snippets/code/src_gui_graphicsview_qgraphicsitem.cpp index 4f27661..81099a7 100644 --- a/doc/src/snippets/code/src_gui_graphicsview_qgraphicsitem.cpp +++ b/doc/src/snippets/code/src_gui_graphicsview_qgraphicsitem.cpp @@ -271,3 +271,9 @@ class QGraphicsPathItem : public QAbstractGraphicsShapeItem }; //! [18] +//! [19] +QTransform xform = item->deviceTransform(view->viewportTransform()); +QRect deviceRect = xform.mapRect(rect).toAlignedRect(); +view->viewport()->scroll(dx, dy, deviceRect); +//! [19] + |