diff options
Diffstat (limited to 'src/widgets/doc/src/graphicsview.qdoc')
-rw-r--r-- | src/widgets/doc/src/graphicsview.qdoc | 42 |
1 files changed, 9 insertions, 33 deletions
diff --git a/src/widgets/doc/src/graphicsview.qdoc b/src/widgets/doc/src/graphicsview.qdoc index 2dfad442a3..81c9f344bb 100644 --- a/src/widgets/doc/src/graphicsview.qdoc +++ b/src/widgets/doc/src/graphicsview.qdoc @@ -1,29 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2020 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Free Documentation License Usage -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: https://www.gnu.org/licenses/fdl-1.3.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2020 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only /*! \page graphicsview.html @@ -89,7 +65,7 @@ descending stacking order (i.e., the first returned item is topmost, and the last item is bottom-most). - \snippet graphicsview.cpp 0 + \snippet graphicsview/graphicsview.cpp 0 QGraphicsScene's event propagation architecture schedules scene events for delivery to items, and also manages propagation between items. If @@ -120,7 +96,7 @@ enable OpenGL support, you can set a QOpenGLWidget as the viewport by calling QGraphicsView::setViewport(). - \snippet graphicsview.cpp 1 + \snippet graphicsview/graphicsview.cpp 1 The view receives input events from the keyboard and mouse, and translates these to scene events (converting the coordinates used @@ -327,7 +303,7 @@ Here is an example of how to implement zoom and rotate slots in a subclass of QGraphicsView: - \snippet graphicsview_snippet.cpp 2 + \snippet graphicsview/graphicsview_snippet.cpp 2 The slots could be connected to \l{QToolButton}{QToolButtons} with \l{QAbstractButton::autoRepeat}{autoRepeat} enabled. @@ -347,7 +323,7 @@ a QPainter to either of the rendering functions. This example shows how to print the whole scene into a full page, using QPrinter. - \snippet graphicsview.cpp 3 + \snippet graphicsview/graphicsview.cpp 3 The difference between the scene and view rendering functions is that one operates in scene coordinates, and the other in view coordinates. @@ -358,7 +334,7 @@ is to render the exact contents of the viewport using the provided painter. - \snippet graphicsview.cpp 4 + \snippet graphicsview/graphicsview.cpp 4 When the source and target areas' sizes do not match, the source contents are stretched to fit into the target area. By passing a @@ -384,7 +360,7 @@ so in mousePressEvent() or mouseMoveEvent(), you can get the originating widget pointer from the event. For example: - \snippet graphicsview.cpp 5 + \snippet graphicsview/graphicsview.cpp 5 To intercept drag and drop events for the scene, you reimplement QGraphicsScene::dragEnterEvent() and whichever event handlers your @@ -443,7 +419,7 @@ Example: - \snippet graphicsview.cpp 6 + \snippet graphicsview/graphicsview.cpp 6 \section2 Item Groups |