Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-21 08:32:48

0001 // Copyright (C) 2016 The Qt Company Ltd.
0002 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
0003 // Qt-Security score:significant reason:default
0004 
0005 #ifndef QGRAPHICSPROXYWIDGET_H
0006 #define QGRAPHICSPROXYWIDGET_H
0007 
0008 #include <QtWidgets/qtwidgetsglobal.h>
0009 #include <QtWidgets/qgraphicswidget.h>
0010 
0011 QT_REQUIRE_CONFIG(graphicsview);
0012 
0013 QT_BEGIN_NAMESPACE
0014 
0015 class QGraphicsProxyWidgetPrivate;
0016 
0017 class Q_WIDGETS_EXPORT QGraphicsProxyWidget : public QGraphicsWidget
0018 {
0019     Q_OBJECT
0020 public:
0021     QGraphicsProxyWidget(QGraphicsItem *parent = nullptr, Qt::WindowFlags wFlags = Qt::WindowFlags());
0022     ~QGraphicsProxyWidget();
0023 
0024     void setWidget(QWidget *widget);
0025     QWidget *widget() const;
0026 
0027     QRectF subWidgetRect(const QWidget *widget) const;
0028 
0029     void setGeometry(const QRectF &rect) override;
0030 
0031     void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
0032 
0033     enum {
0034         Type = 12
0035     };
0036     int type() const override;
0037 
0038     QGraphicsProxyWidget *createProxyForChildWidget(QWidget *child);
0039 
0040 protected:
0041     QVariant itemChange(GraphicsItemChange change, const QVariant &value) override;
0042 
0043     bool event(QEvent *event) override;
0044     bool eventFilter(QObject *object, QEvent *event) override;
0045 
0046     void showEvent(QShowEvent *event) override;
0047     void hideEvent(QHideEvent *event) override;
0048 
0049 #ifndef QT_NO_CONTEXTMENU
0050     void contextMenuEvent(QGraphicsSceneContextMenuEvent *event) override;
0051 #endif
0052 
0053 #if QT_CONFIG(draganddrop)
0054     void dragEnterEvent(QGraphicsSceneDragDropEvent *event) override;
0055     void dragLeaveEvent(QGraphicsSceneDragDropEvent *event) override;
0056     void dragMoveEvent(QGraphicsSceneDragDropEvent *event) override;
0057     void dropEvent(QGraphicsSceneDragDropEvent *event) override;
0058 #endif
0059 
0060     void hoverEnterEvent(QGraphicsSceneHoverEvent *event) override;
0061     void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) override;
0062     void hoverMoveEvent(QGraphicsSceneHoverEvent *event) override;
0063     void grabMouseEvent(QEvent *event) override;
0064     void ungrabMouseEvent(QEvent *event) override;
0065 
0066     void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override;
0067     void mousePressEvent(QGraphicsSceneMouseEvent *event) override;
0068     void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override;
0069     void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) override;
0070 #if QT_CONFIG(wheelevent)
0071     void wheelEvent(QGraphicsSceneWheelEvent *event) override;
0072 #endif
0073 
0074     void keyPressEvent(QKeyEvent *event) override;
0075     void keyReleaseEvent(QKeyEvent *event) override;
0076 
0077     void focusInEvent(QFocusEvent *event) override;
0078     void focusOutEvent(QFocusEvent *event) override;
0079     bool focusNextPrevChild(bool next) override;
0080 
0081     QVariant inputMethodQuery(Qt::InputMethodQuery query) const override;
0082     void inputMethodEvent(QInputMethodEvent *event) override;
0083 
0084     QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const override;
0085     void resizeEvent(QGraphicsSceneResizeEvent *event) override;
0086 
0087 protected Q_SLOTS:
0088     QGraphicsProxyWidget *newProxyWidget(const QWidget *);
0089 
0090 private:
0091     Q_DISABLE_COPY(QGraphicsProxyWidget)
0092     Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QGraphicsProxyWidget)
0093     Q_PRIVATE_SLOT(d_func(), void _q_removeWidgetSlot())
0094 
0095     friend class QWidget;
0096     friend class QWidgetPrivate;
0097     friend class QGraphicsItem;
0098 };
0099 
0100 QT_END_NAMESPACE
0101 
0102 #endif