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
qgraphicsproxywidget.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 QGRAPHICSPROXYWIDGET_H
6#define QGRAPHICSPROXYWIDGET_H
7
8#include <QtWidgets/qtwidgetsglobal.h>
9#include <QtWidgets/qgraphicswidget.h>
10
12
13QT_BEGIN_NAMESPACE
14
15class QGraphicsProxyWidgetPrivate;
16
17class Q_WIDGETS_EXPORT QGraphicsProxyWidget : public QGraphicsWidget
18{
19 Q_OBJECT
20public:
21 QGraphicsProxyWidget(QGraphicsItem *parent = nullptr, Qt::WindowFlags wFlags = Qt::WindowFlags());
22 ~QGraphicsProxyWidget();
23
24 void setWidget(QWidget *widget);
25 QWidget *widget() const;
26
27 QRectF subWidgetRect(const QWidget *widget) const;
28
29 void setGeometry(const QRectF &rect) override;
30
31 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
32
33 enum {
34 Type = 12
35 };
36 int type() const override;
37
38 QGraphicsProxyWidget *createProxyForChildWidget(QWidget *child);
39
40protected:
41 QVariant itemChange(GraphicsItemChange change, const QVariant &value) override;
42
43 bool event(QEvent *event) override;
44 bool eventFilter(QObject *object, QEvent *event) override;
45
46 void showEvent(QShowEvent *event) override;
47 void hideEvent(QHideEvent *event) override;
48
49#ifndef QT_NO_CONTEXTMENU
50 void contextMenuEvent(QGraphicsSceneContextMenuEvent *event) override;
51#endif
52
53#if QT_CONFIG(draganddrop)
54 void dragEnterEvent(QGraphicsSceneDragDropEvent *event) override;
55 void dragLeaveEvent(QGraphicsSceneDragDropEvent *event) override;
56 void dragMoveEvent(QGraphicsSceneDragDropEvent *event) override;
57 void dropEvent(QGraphicsSceneDragDropEvent *event) override;
58#endif
59
60 void hoverEnterEvent(QGraphicsSceneHoverEvent *event) override;
61 void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) override;
62 void hoverMoveEvent(QGraphicsSceneHoverEvent *event) override;
63 void grabMouseEvent(QEvent *event) override;
64 void ungrabMouseEvent(QEvent *event) override;
65
66 void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override;
67 void mousePressEvent(QGraphicsSceneMouseEvent *event) override;
68 void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override;
69 void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) override;
70#if QT_CONFIG(wheelevent)
71 void wheelEvent(QGraphicsSceneWheelEvent *event) override;
72#endif
73
74 void keyPressEvent(QKeyEvent *event) override;
75 void keyReleaseEvent(QKeyEvent *event) override;
76
77 void focusInEvent(QFocusEvent *event) override;
78 void focusOutEvent(QFocusEvent *event) override;
79 bool focusNextPrevChild(bool next) override;
80
81 QVariant inputMethodQuery(Qt::InputMethodQuery query) const override;
82 void inputMethodEvent(QInputMethodEvent *event) override;
83
84 QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const override;
85 void resizeEvent(QGraphicsSceneResizeEvent *event) override;
86
87protected Q_SLOTS:
88 QGraphicsProxyWidget *newProxyWidget(const QWidget *);
89
90private:
91 Q_DISABLE_COPY(QGraphicsProxyWidget)
92 Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QGraphicsProxyWidget)
93 Q_PRIVATE_SLOT(d_func(), void _q_removeWidgetSlot())
94
95 friend class QWidget;
96 friend class QWidgetPrivate;
97 friend class QGraphicsItem;
98};
99
100QT_END_NAMESPACE
101
102#endif
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 QGraphicsProxyWidget class provides a proxy layer for embedding a QWidget in 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