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_P_H
5#define QGRAPHICSPROXYWIDGET_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists for the convenience
12// of other Qt classes. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtWidgets/private/qtwidgetsglobal_p.h>
19#include "qgraphicsproxywidget.h"
20#include "private/qgraphicswidget_p.h"
21
22#include <QtCore/qpointer.h>
23
24QT_REQUIRE_CONFIG(graphicsview);
25
26QT_BEGIN_NAMESPACE
27
28class Q_AUTOTEST_EXPORT QGraphicsProxyWidgetPrivate : public QGraphicsWidgetPrivate
29{
30 Q_DECLARE_PUBLIC(QGraphicsProxyWidget)
31public:
32 QGraphicsProxyWidgetPrivate();
33 ~QGraphicsProxyWidgetPrivate();
34
35 void init();
36 void sendWidgetMouseEvent(QGraphicsSceneMouseEvent *event);
37 void sendWidgetMouseEvent(QGraphicsSceneHoverEvent *event);
38 void sendWidgetKeyEvent(QKeyEvent *event);
39 void setWidget_helper(QWidget *widget, bool autoShow);
40
41 QWidget *findFocusChild(QWidget *child, bool next) const;
42 void removeSubFocusHelper(QWidget *widget, Qt::FocusReason reason);
43
44 void _q_removeWidgetSlot();
45
46 void embedSubWindow(QWidget *);
47 void unembedSubWindow(QWidget *);
48
49 bool isProxyWidget() const override;
50
51 QPointer<QWidget> widget;
52 QPointer<QWidget> lastWidgetUnderMouse;
53 QPointer<QWidget> embeddedMouseGrabber;
54 QWidget *dragDropWidget;
55 Qt::DropAction lastDropAction;
56
57 void updateWidgetGeometryFromProxy();
58 void updateProxyGeometryFromWidget();
59
60 void updateProxyInputMethodAcceptanceFromWidget();
61
62 QPointF mapToReceiver(const QPointF &pos, const QWidget *receiver) const;
63
64 enum ChangeMode {
65 NoMode,
66 ProxyToWidgetMode,
67 WidgetToProxyMode
68 };
69 quint32 posChangeMode : 2;
70 quint32 sizeChangeMode : 2;
71 quint32 visibleChangeMode : 2;
72 quint32 enabledChangeMode : 2;
73 quint32 styleChangeMode : 2;
74 quint32 paletteChangeMode : 2;
75 quint32 tooltipChangeMode : 2;
76 quint32 focusFromWidgetToProxy : 1;
77 quint32 proxyIsGivingFocus : 1;
78};
79
80QT_END_NAMESPACE
81
82#endif
83

Provided by KDAB

Privacy Policy
Learn to use CMake with our Intro Training
Find out more

source code of qtbase/src/widgets/graphicsview/qgraphicsproxywidget_p.h