Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qgraphicstransform.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QGRAPHICSTRANSFORM_H
6#define QGRAPHICSTRANSFORM_H
7
8#include <QtWidgets/qtwidgetsglobal.h>
9#include <QtCore/QObject>
10#include <QtGui/QVector3D>
11#include <QtGui/QTransform>
12#include <QtGui/QMatrix4x4>
13
14QT_REQUIRE_CONFIG(graphicsview);
15
16QT_BEGIN_NAMESPACE
17
18class QGraphicsItem;
20
21class Q_WIDGETS_EXPORT QGraphicsTransform : public QObject
22{
23 Q_OBJECT
24public:
25 QGraphicsTransform(QObject *parent = nullptr);
26 ~QGraphicsTransform();
27
28 virtual void applyTo(QMatrix4x4 *matrix) const = 0;
29
30protected Q_SLOTS:
31 void update();
32
33protected:
34 QGraphicsTransform(QGraphicsTransformPrivate &p, QObject *parent);
35
36private:
37 friend class QGraphicsItem;
38 friend class QGraphicsItemPrivate;
39 Q_DECLARE_PRIVATE(QGraphicsTransform)
40};
41
43
44class Q_WIDGETS_EXPORT QGraphicsScale : public QGraphicsTransform
45{
46 Q_OBJECT
47
48 Q_PROPERTY(QVector3D origin READ origin WRITE setOrigin NOTIFY originChanged)
49 Q_PROPERTY(qreal xScale READ xScale WRITE setXScale NOTIFY xScaleChanged)
50 Q_PROPERTY(qreal yScale READ yScale WRITE setYScale NOTIFY yScaleChanged)
51 Q_PROPERTY(qreal zScale READ zScale WRITE setZScale NOTIFY zScaleChanged)
52public:
53 QGraphicsScale(QObject *parent = nullptr);
54 ~QGraphicsScale();
55
56 QVector3D origin() const;
57 void setOrigin(const QVector3D &point);
58
59 qreal xScale() const;
60 void setXScale(qreal);
61
62 qreal yScale() const;
63 void setYScale(qreal);
64
65 qreal zScale() const;
66 void setZScale(qreal);
67
68 void applyTo(QMatrix4x4 *matrix) const override;
69
70Q_SIGNALS:
71 void originChanged();
72 void xScaleChanged();
73 void yScaleChanged();
74 void zScaleChanged();
75 void scaleChanged();
76
77private:
78 Q_DECLARE_PRIVATE(QGraphicsScale)
79};
80
82
83class Q_WIDGETS_EXPORT QGraphicsRotation : public QGraphicsTransform
84{
85 Q_OBJECT
86
87 Q_PROPERTY(QVector3D origin READ origin WRITE setOrigin NOTIFY originChanged)
88 Q_PROPERTY(qreal angle READ angle WRITE setAngle NOTIFY angleChanged)
89 Q_PROPERTY(QVector3D axis READ axis WRITE setAxis NOTIFY axisChanged)
90public:
91 QGraphicsRotation(QObject *parent = nullptr);
92 ~QGraphicsRotation();
93
94 QVector3D origin() const;
95 void setOrigin(const QVector3D &point);
96
97 qreal angle() const;
98 void setAngle(qreal);
99
100 QVector3D axis() const;
101 void setAxis(const QVector3D &axis);
102 void setAxis(Qt::Axis axis);
103
104 void applyTo(QMatrix4x4 *matrix) const override;
105
106Q_SIGNALS:
107 void originChanged();
108 void angleChanged();
109 void axisChanged();
110
111private:
112 Q_DECLARE_PRIVATE(QGraphicsRotation)
113};
114
115QT_END_NAMESPACE
116
117#endif // QFXTRANSFORM_H
The QAbstractGraphicsShapeItem class provides a common base for all path items.
The QGraphicsEllipseItem class provides an ellipse item that you can add to a QGraphicsScene.
QList< QRectF > exposed
QHash< QPaintDevice *, DeviceData > deviceData
QHash< const QGraphicsItem *, QMap< int, QVariant > > data
The QGraphicsItemGroup class provides a container that treats a group of items as a single item.
The QGraphicsItem class is the base class for all graphical items in a QGraphicsScene.
The QGraphicsLineItem class provides a line item that you can add to a QGraphicsScene.
The QGraphicsObject class provides a base class for all graphics items that require signals,...
QGraphicsPixmapItem::ShapeMode shapeMode
Qt::TransformationMode transformationMode
The QGraphicsPixmapItem class provides a pixmap item that you can add to a QGraphicsScene.
The QGraphicsPolygonItem class provides a polygon item that you can add to a QGraphicsScene.
The QGraphicsRectItem class provides a rectangle item that you can add to a QGraphicsScene.
The QGraphicsRotation class provides a rotation transformation around a given axis.
The QGraphicsScale class provides a scale transformation.
The QGraphicsSceneContextMenuEvent class provides context menu events in the graphics view framework.
The QGraphicsSceneDragDropEvent class provides events for drag and drop in the graphics view framewor...
The QGraphicsSceneEvent class provides a base class for all graphics view related events.
The QGraphicsSceneHelpEvent class provides events when a tooltip is requested.
The QGraphicsSceneHoverEvent class provides hover events in the graphics view framework.
The QGraphicsSceneMouseEvent class provides mouse events in the graphics view framework.
The QGraphicsSceneMoveEvent class provides events for widget moving in the graphics view framework.
The QGraphicsSceneResizeEvent class provides events for widget resizing in the graphics view framewor...
The QGraphicsSceneWheelEvent class provides wheel events in the graphics view framework.
The QGraphicsScene class provides a surface for managing a large number of 2D graphical items.
The QGraphicsSimpleTextItem class provides a simple text item that you can add to a QGraphicsScene.
void _q_updateBoundingRect(const QSizeF &)
bool _q_mouseOnEdge(QGraphicsSceneMouseEvent *)
QWidgetTextControl * control
QWidgetTextControl * textControl() const
void sendControlEvent(QEvent *e)
The QGraphicsTextItem class provides a text item that you can add to a QGraphicsScene to display form...
The QGraphicsTransform class is an abstract base class for building advanced transformations on QGrap...
The QGraphicsView class provides a widget for displaying the contents of a QGraphicsScene.
friend class QPainter
\inmodule QtGui
friend class QWidget
Definition qpainter.h:431
\inmodule QtCore\reentrant
Definition qpoint.h:231
The QPolygonF class provides a list of points using floating point precision.
Definition qpolygon.h:96
QT_REQUIRE_CONFIG(animation)
Q_CORE_EXPORT QDebug operator<<(QDebug debug, QDir::Filters filters)
Definition qdir.cpp:2568
static void formatGraphicsItemHelper(QDebug debug, const QGraphicsItem *item)
bool _qt_movableAncestorIsSelected(const QGraphicsItem *item)
static QRectF setupTextLayout(QTextLayout *layout)
QDebug operator<<(QDebug debug, const QGraphicsObject *item)
static QPainterPath qt_graphicsItem_shapeFromPath(const QPainterPath &path, const QPen &pen)
QDebug operator<<(QDebug debug, const QGraphicsItem *item)
static bool qt_QGraphicsItem_isObscured(const QGraphicsItem *item, const QGraphicsItem *other, const QRectF &rect)
bool qt_closestItemLast(const QGraphicsItem *item1, const QGraphicsItem *item2)
Returns true if item2 is on top of item1.
bool qt_closestLeaf(const QGraphicsItem *item1, const QGraphicsItem *item2)
bool qt_notclosestLeaf(const QGraphicsItem *item1, const QGraphicsItem *item2)
bool qt_closestItemFirst(const QGraphicsItem *item1, const QGraphicsItem *item2)
Returns true if item1 is on top of item2.
QT_REQUIRE_CONFIG(graphicsview)
static QRectF adjustedItemBoundingRect(const QGraphicsItem *item)
static QRectF adjustedItemEffectiveBoundingRect(const QGraphicsItem *item)
static void _q_adjustRect(QRectF *rect)
QDebug operator<<(QDebug debug, QIODevice::OpenMode modes)
Q_DECLARE_TYPEINFO(QObjectPrivate::ConnectionList, Q_RELOCATABLE_TYPE)
const QTransform * transformPtr
const QTransform * effectTransform
QStyleOptionGraphicsItem * option
const QTransform * viewTransform