Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qquickpopup_p_p.h
Go to the documentation of this file.
1// Copyright (C) 2017 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 QQUICKPOPUP_P_P_H
5#define QQUICKPOPUP_P_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 purely as an
12// implementation detail. 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 <QtQuickTemplates2/private/qquickpopup_p.h>
19#include <QtQuickTemplates2/private/qquickcontrol_p.h>
20#include <QtQuickTemplates2/private/qquicktheme_p.h>
21
22#include <QtCore/private/qobject_p.h>
23#include <QtQuick/qquickitem.h>
24#include <QtQuick/private/qquickitemchangelistener_p.h>
25#include <QtQuick/private/qquicktransitionmanager_p_p.h>
26#include <QtQuick/private/qquickitem_p.h>
27
29
32class QQuickPopup;
34class QQuickPopupItem;
37
38class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickPopupTransitionManager : public QQuickTransitionManager
39{
40public:
42
43 void transitionEnter();
44 void transitionExit();
45
46protected:
47 void finished() override;
48
49private:
50 QQuickPopupPrivate *popup = nullptr;
51};
52
53class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickPopupPrivate
54 : public QObjectPrivate
56 , public QQuickPaletteProviderPrivateBase<QQuickPopup, QQuickPopupPrivate>
57{
58public:
59 Q_DECLARE_PUBLIC(QQuickPopup)
60
62
64 {
65 return popup->d_func();
66 }
67
68 QQmlListProperty<QObject> contentData();
69 QQmlListProperty<QQuickItem> contentChildren();
70
71 void init();
72 void closeOrReject();
73 bool tryClose(const QPointF &pos, QQuickPopup::ClosePolicy flags);
74
75 bool contains(const QPointF &scenePos) const;
76
77#if QT_CONFIG(quicktemplates2_multitouch)
78 virtual bool acceptTouch(const QTouchEvent::TouchPoint &point);
79#endif
80 virtual bool blockInput(QQuickItem *item, const QPointF &point) const;
81
82 virtual bool handlePress(QQuickItem* item, const QPointF &point, ulong timestamp);
83 virtual bool handleMove(QQuickItem* item, const QPointF &point, ulong timestamp);
84 virtual bool handleRelease(QQuickItem* item, const QPointF &point, ulong timestamp);
85 virtual void handleUngrab();
86
87 bool handleMouseEvent(QQuickItem *item, QMouseEvent *event);
88 bool handleHoverEvent(QQuickItem *item, QHoverEvent *event);
89#if QT_CONFIG(quicktemplates2_multitouch)
90 bool handleTouchEvent(QQuickItem *item, QTouchEvent *event);
91#endif
92
93 void reposition();
94
95 void createOverlay();
96 void destroyOverlay();
97 void toggleOverlay();
98 void updateContentPalettes(const QPalette& parentPalette);
99 virtual void showOverlay();
100 virtual void hideOverlay();
101 virtual void resizeOverlay();
102
103 virtual bool prepareEnterTransition();
104 virtual bool prepareExitTransition();
105 virtual void finalizeEnterTransition();
106 virtual void finalizeExitTransition();
107
108 virtual void opened();
109
110 QMarginsF getMargins() const;
111
112 void setTopMargin(qreal value, bool reset = false);
113 void setLeftMargin(qreal value, bool reset = false);
114 void setRightMargin(qreal value, bool reset = false);
115 void setBottomMargin(qreal value, bool reset = false);
116
117 QQuickPopupAnchors *getAnchors();
118 virtual QQuickPopupPositioner *getPositioner();
119
120 void setWindow(QQuickWindow *window);
121 void itemDestroyed(QQuickItem *item) override;
122
123 QPalette defaultPalette() const override;
124
126 NoTransition, EnterTransition, ExitTransition
127 };
128
129 static const QQuickPopup::ClosePolicy DefaultClosePolicy;
130
131 bool focus = false;
132 bool modal = false;
133 bool dim = false;
134 bool hasDim = false;
135 bool visible = false;
136 bool complete = true;
137 bool positioning = false;
138 bool hasWidth = false;
139 bool hasHeight = false;
140 bool hasTopMargin = false;
141 bool hasLeftMargin = false;
142 bool hasRightMargin = false;
143 bool hasBottomMargin = false;
144 bool hasZ = false;
145 bool allowVerticalFlip = false;
146 bool allowHorizontalFlip = false;
147 bool allowVerticalMove = true;
148 bool allowHorizontalMove = true;
149 bool allowVerticalResize = true;
150 bool allowHorizontalResize = true;
151 bool hadActiveFocusBeforeExitTransition = false;
152 bool interactive = true;
153 bool hasClosePolicy = false;
154 bool outsidePressed = false;
155 bool outsideParentPressed = false;
156 bool inDestructor = false;
157 int touchId = -1;
158 qreal x = 0;
159 qreal y = 0;
160 qreal effectiveX = 0;
161 qreal effectiveY = 0;
162 qreal margins = -1;
163 qreal topMargin = 0;
164 qreal leftMargin = 0;
165 qreal rightMargin = 0;
166 qreal bottomMargin = 0;
168 TransitionState transitionState = NoTransition;
169 QQuickPopup::ClosePolicy closePolicy = DefaultClosePolicy;
170 QQuickItem *parentItem = nullptr;
171 QQuickItem *dimmer = nullptr;
173 QQuickTransition *enter = nullptr;
174 QQuickTransition *exit = nullptr;
175 QQuickPopupItem *popupItem = nullptr;
176 QQuickPopupPositioner *positioner = nullptr;
181 qreal prevOpacity = 0;
182 qreal prevScale = 0;
183
185};
186
188
189#endif // QQUICKPOPUP_P_P_H
The QEventPoint class provides information about a point in a QPointerEvent.
Definition qeventpoint.h:20
\inmodule QtGui
Definition qevent.h:245
Definition qlist.h:74
\inmodule QtCore
Definition qmargins.h:274
\inmodule QtGui
Definition qevent.h:195
The QPalette class contains color groups for each widget state.
Definition qpalette.h:19
\inmodule QtCore\reentrant
Definition qpoint.h:214
\inmodule QtCore
Definition qpointer.h:18
The QQmlListProperty class allows applications to expose list-like properties of QObject-derived clas...
Definition qqmllist.h:24
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Definition qquickitem.h:64
static const QQuickPopup::ClosePolicy DefaultClosePolicy
Base type of popup-like user interface controls.
QList< QQuickStateAction > enterActions
QPointer< QQuickWindow > window
QList< QQuickStateAction > exitActions
QQuickPopupTransitionManager transitionManager
static QQuickPopupPrivate * get(QQuickPopup *popup)
\qmltype Window \instantiates QQuickWindow \inqmlmodule QtQuick
The QTouchEvent class contains parameters that describe a touch event.
Definition qevent.h:916
bool focus
[0]
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
static bool contains(const QJsonArray &haystack, unsigned needle)
Definition qopengl.cpp:116
GLint GLint GLint GLint GLint x
[0]
GLbitfield flags
GLint y
struct _cl_event * event
GLboolean reset
QQuickAnchors * anchors(QQuickItem *item)
static QT_BEGIN_NAMESPACE void init(QTextBoundaryFinder::BoundaryType type, QStringView str, QCharAttributes *attributes)
unsigned long ulong
Definition qtypes.h:30
double qreal
Definition qtypes.h:92
QGraphicsItem * item
aWidget window() -> setWindowTitle("New Window Title")
[2]