Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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
4#ifndef QGRAPHICSPROXYWIDGET_H
5#define QGRAPHICSPROXYWIDGET_H
6
7#include <QtWidgets/qtwidgetsglobal.h>
8#include <QtWidgets/qgraphicswidget.h>
9
10QT_REQUIRE_CONFIG(graphicsview);
11
13
15
16class Q_WIDGETS_EXPORT QGraphicsProxyWidget : public QGraphicsWidget
17{
19public:
20 QGraphicsProxyWidget(QGraphicsItem *parent = nullptr, Qt::WindowFlags wFlags = Qt::WindowFlags());
22
24 QWidget *widget() const;
25
26 QRectF subWidgetRect(const QWidget *widget) const;
27
28 void setGeometry(const QRectF &rect) override;
29
31
32 enum {
33 Type = 12
34 };
35 int type() const override;
36
37 QGraphicsProxyWidget *createProxyForChildWidget(QWidget *child);
38
39protected:
40 QVariant itemChange(GraphicsItemChange change, const QVariant &value) override;
41
42 bool event(QEvent *event) override;
43 bool eventFilter(QObject *object, QEvent *event) override;
44
45 void showEvent(QShowEvent *event) override;
46 void hideEvent(QHideEvent *event) override;
47
48#ifndef QT_NO_CONTEXTMENU
49 void contextMenuEvent(QGraphicsSceneContextMenuEvent *event) override;
50#endif
51
52#if QT_CONFIG(draganddrop)
53 void dragEnterEvent(QGraphicsSceneDragDropEvent *event) override;
54 void dragLeaveEvent(QGraphicsSceneDragDropEvent *event) override;
55 void dragMoveEvent(QGraphicsSceneDragDropEvent *event) override;
56 void dropEvent(QGraphicsSceneDragDropEvent *event) override;
57#endif
58
59 void hoverEnterEvent(QGraphicsSceneHoverEvent *event) override;
60 void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) override;
61 void hoverMoveEvent(QGraphicsSceneHoverEvent *event) override;
62 void grabMouseEvent(QEvent *event) override;
63 void ungrabMouseEvent(QEvent *event) override;
64
65 void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override;
66 void mousePressEvent(QGraphicsSceneMouseEvent *event) override;
67 void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override;
68 void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) override;
69#if QT_CONFIG(wheelevent)
70 void wheelEvent(QGraphicsSceneWheelEvent *event) override;
71#endif
72
73 void keyPressEvent(QKeyEvent *event) override;
74 void keyReleaseEvent(QKeyEvent *event) override;
75
76 void focusInEvent(QFocusEvent *event) override;
77 void focusOutEvent(QFocusEvent *event) override;
78 bool focusNextPrevChild(bool next) override;
79
80 QVariant inputMethodQuery(Qt::InputMethodQuery query) const override;
81 void inputMethodEvent(QInputMethodEvent *event) override;
82
83 QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const override;
84 void resizeEvent(QGraphicsSceneResizeEvent *event) override;
85
86protected Q_SLOTS:
87 QGraphicsProxyWidget *newProxyWidget(const QWidget *);
88
89private:
90 Q_DISABLE_COPY(QGraphicsProxyWidget)
91 Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QGraphicsProxyWidget)
92 Q_PRIVATE_SLOT(d_func(), void _q_removeWidgetSlot())
93
94 friend class QWidget;
95 friend class QWidgetPrivate;
96 friend class QGraphicsItem;
97};
98
100
101#endif
\inmodule QtCore
Definition qcoreevent.h:45
The QFocusEvent class contains event parameters for widget focus events.
Definition qevent.h:470
The QGraphicsItem class is the base class for all graphical items in a QGraphicsScene.
QScopedPointer< QGraphicsItemPrivate > d_ptr
The QGraphicsProxyWidget class provides a proxy layer for embedding a QWidget in a QGraphicsScene.
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 QGraphicsSceneHoverEvent class provides hover events in the graphics view framework.
The QGraphicsSceneMouseEvent class provides mouse events 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 QGraphicsWidget class is the base class for all widget items in a QGraphicsScene.
The QHideEvent class provides an event which is sent after a widget is hidden.
Definition qevent.h:586
The QInputMethodEvent class provides parameters for input method events.
Definition qevent.h:625
The QKeyEvent class describes a key event.
Definition qevent.h:424
\inmodule QtCore
Definition qobject.h:103
The QPainter class performs low-level painting on widgets and other paint devices.
Definition qpainter.h:46
\inmodule QtCore\reentrant
Definition qrect.h:484
The QShowEvent class provides an event that is sent when a widget is shown.
Definition qevent.h:578
\inmodule QtCore
Definition qsize.h:208
The QStyleOptionGraphicsItem class is used to describe the parameters needed to draw a QGraphicsItem.
\inmodule QtCore
Definition qvariant.h:65
The QWidget class is the base class of all user interface objects.
Definition qwidget.h:99
QOpenGLWidget * widget
[1]
QPainter paint
rect
[4]
short next
Definition keywords.cpp:445
Combined button and popup list for selecting options.
InputMethodQuery
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum type
struct _cl_event * event
GLenum query
GLuint GLenum option
#define QT_REQUIRE_CONFIG(feature)
#define Q_OBJECT
#define Q_SLOTS
#define Q_PRIVATE_SLOT(d, signature)
QLayoutItem * child
[0]
QPainter painter(this)
[7]
scrollArea setWidget(imageLabel)
Definition moc.h:23