summaryrefslogtreecommitdiffstats
path: root/src/widgets/doc/snippets/graphicsview/graphicsview_snippet.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/doc/snippets/graphicsview/graphicsview_snippet.cpp')
-rw-r--r--src/widgets/doc/snippets/graphicsview/graphicsview_snippet.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/widgets/doc/snippets/graphicsview/graphicsview_snippet.cpp b/src/widgets/doc/snippets/graphicsview/graphicsview_snippet.cpp
new file mode 100644
index 0000000000..303f2fa9e2
--- /dev/null
+++ b/src/widgets/doc/snippets/graphicsview/graphicsview_snippet.cpp
@@ -0,0 +1,16 @@
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+//! [2]
+class View : public QGraphicsView
+{
+Q_OBJECT
+ ...
+public slots:
+ void zoomIn() { scale(1.2, 1.2); }
+ void zoomOut() { scale(1 / 1.2, 1 / 1.2); }
+ void rotateLeft() { rotate(-10); }
+ void rotateRight() { rotate(10); }
+ ...
+};
+//! [2]