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.
void updateChildWithGraphicsEffectFlagRecursively()
Returns a pointer to this item's effect if it has one; otherwise \nullptr.
QGraphicsItem * subFocusItem
void setFocusHelper(Qt::FocusReason focusReason, bool climb, bool focusFromHide)
void invalidateChildrenSceneTransform()
virtual void setPosHelper(const QPointF &pos)
QVariant extra(Extra type) const
QGraphicsScene * scene
static bool insertionOrder(QGraphicsItem *a, QGraphicsItem *b)
Qt::InputMethodHints imHints
QList< QGraphicsItem ** > focusProxyRefs
QTransform transformToParent() const
virtual void focusScopeItemChange(bool isSubFocusItem)
void initStyleOption(QStyleOptionGraphicsItem *option, const QTransform &worldTransform, const QRegion &exposedRegion, bool allItems=false) const
QGraphicsEffect * graphicsEffect
QGraphicsItem * focusProxy
void markParentDirty(bool updateBoundingRect=false)
QGraphicsItem * focusScopeItem
void setEnabledHelper(bool newEnabled, bool explicitly, bool update=true)
void setSubFocus(QGraphicsItem *rootItem=nullptr, QGraphicsItem *stopItem=nullptr)
void combineTransformToParent(QTransform *x, const QTransform *viewTransform=nullptr) const
QMap< Qt::GestureType, Qt::GestureFlags > gestureContext
bool itemIsUntransformable() const
QList< ExtraStruct > extras
quint32 mayHaveChildWithGraphicsEffect
void updateAncestorFlag(QGraphicsItem::GraphicsItemFlag childFlag, AncestorFlag flag=NoFlag, bool enabled=false, bool root=true)
bool discardUpdateRequest(bool ignoreVisibleBit=false, bool ignoreDirtyBit=false, bool ignoreOpacity=false) const
void combineTransformFromParent(QTransform *x, const QTransform *viewTransform=nullptr) const
static QGraphicsItemPrivate * get(QGraphicsItem *item)
virtual void resetWidth()
QGraphicsItem::PanelModality panelModality
virtual void transformChanged()
bool childrenCombineOpacity() const
void appendGraphicsTransform(QGraphicsTransform *t)
void clearSubFocus(QGraphicsItem *rootItem=nullptr, QGraphicsItem *stopItem=nullptr)
void setTransformHelper(const QTransform &transform)
void ensureSceneTransformRecursive(QGraphicsItem **topMostDirtyItem)
void removeChild(QGraphicsItem *child)
QRectF sceneEffectiveBoundingRect() const
void remapItemPos(QEvent *event, QGraphicsItem *item)
void clearFocusHelper(bool giveFocusToParent, bool hiddenByParentPanel)
static bool movableAncestorIsSelected(const QGraphicsItem *item)
QRectF effectiveBoundingRect(const QRectF &rect) const
QRectF effectiveBoundingRect(QGraphicsItem *topMostEffectItem=nullptr) const
void updatePaintedViewBoundingRects(bool updateChildren)
bool isFullyTransparent() const
bool childrenClippedToShape() const
virtual void updateSceneTransformFromParent()
virtual void siblingOrderChange()
quint32 paintedViewBoundingRectsNeedRepaint
void childrenBoundingRectHelper(QTransform *x, QRectF *rect, QGraphicsItem *topMostEffectItem)
virtual void resolvePalette(uint inheritedMask)
virtual void subFocusItemChange()
qreal effectiveOpacity() const
TransformData * transformData
QGraphicsItemCache * maybeExtraItemCache() const
void prependGraphicsTransform(QGraphicsTransform *t)
static const QGraphicsItemPrivate * get(const QGraphicsItem *item)
virtual void resetHeight()
QHash< QWidget *, QRect > paintedViewBoundingRects
QGraphicsItemCache * extraItemCache() const
virtual void resolveFont(uint inheritedMask)
qreal combineOpacityFromParent(qreal parentOpacity) const
void unsetExtra(Extra type)
qreal calcEffectiveOpacity() const
void addChild(QGraphicsItem *child)
void setIsMemberOfGroup(bool enabled)
virtual bool isProxyWidget() const
void setVisibleHelper(bool newVisible, bool explicitly, bool update=true, bool hiddenByPanel=false)
static bool isOpacityNull(qreal opacity)
virtual void setHeight(qreal)
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,...
The QGraphicsPathItem class provides a path item that you can add to a QGraphicsScene.
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.
\inmodule QtWidgets
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...
\inmodule QtWidgets
The QGraphicsView class provides a widget for displaying the contents of a QGraphicsScene.
QObject * q_ptr
Definition qobject.h:72
uint isWidget
Definition qobject.h:76
QObjectList children
Definition qobject.h:74
QObject * parent
Definition qobject.h:73
friend class QPainter
qreal width() const
Returns the width of the generated outlines.
void setWidth(qreal width)
Sets the width of the generated outline painter path to width.
\inmodule QtGui
friend class QWidget
Definition qpainter.h:431
\inmodule QtCore\reentrant
Definition qpoint.h:232
The QPolygonF class provides a list of points using floating point precision.
Definition qpolygon.h:96
Combined button and popup list for selecting options.
QT_REQUIRE_CONFIG(animation)
Q_CORE_EXPORT QDebug operator<<(QDebug debug, QDir::Filters filters)
Definition qdir.cpp:2582
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
bool operator<(Extra extra) const
QFixed height() const