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
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
28#include <QtCore/qpointer.h>
29
31
34class QQuickPopup;
36class QQuickPopupItem;
39
40class Q_QUICKTEMPLATES2_EXPORT QQuickPopupTransitionManager : public QQuickTransitionManager
41{
42public:
44
45 void transitionEnter();
46 void transitionExit();
47
48protected:
49 void finished() override;
50
51private:
52 QQuickPopupPrivate *popup = nullptr;
53};
54
55class Q_QUICKTEMPLATES2_EXPORT QQuickPopupPrivate
56 : public QObjectPrivate
58 , public QQuickPaletteProviderPrivateBase<QQuickPopup, QQuickPopupPrivate>
59{
60public:
61 Q_DECLARE_PUBLIC(QQuickPopup)
62
64
66 {
67 return popup->d_func();
68 }
69
70 QQmlListProperty<QObject> contentData();
71 QQmlListProperty<QQuickItem> contentChildren();
72
73 void init();
74 void closeOrReject();
75 bool tryClose(const QPointF &pos, QQuickPopup::ClosePolicy flags);
76
77 bool contains(const QPointF &scenePos) const;
78
79#if QT_CONFIG(quicktemplates2_multitouch)
80 virtual bool acceptTouch(const QTouchEvent::TouchPoint &point);
81#endif
82 virtual bool blockInput(QQuickItem *item, const QPointF &point) const;
83
84 virtual bool handlePress(QQuickItem* item, const QPointF &point, ulong timestamp);
85 virtual bool handleMove(QQuickItem* item, const QPointF &point, ulong timestamp);
86 virtual bool handleRelease(QQuickItem* item, const QPointF &point, ulong timestamp);
87 virtual void handleUngrab();
88
89 bool handleMouseEvent(QQuickItem *item, QMouseEvent *event);
90 bool handleHoverEvent(QQuickItem *item, QHoverEvent *event);
91#if QT_CONFIG(quicktemplates2_multitouch)
92 bool handleTouchEvent(QQuickItem *item, QTouchEvent *event);
93#endif
94
95 void reposition();
96
97 void createOverlay();
98 void destroyDimmer();
99 void toggleOverlay();
100 void updateContentPalettes(const QPalette& parentPalette);
101 virtual void showDimmer();
102 virtual void hideDimmer();
103 virtual void resizeDimmer();
104
105 virtual bool prepareEnterTransition();
106 virtual bool prepareExitTransition();
107 virtual void finalizeEnterTransition();
108 virtual void finalizeExitTransition();
109
110 virtual void opened();
111
112 QMarginsF getMargins() const;
113
114 void setTopMargin(qreal value, bool reset = false);
115 void setLeftMargin(qreal value, bool reset = false);
116 void setRightMargin(qreal value, bool reset = false);
117 void setBottomMargin(qreal value, bool reset = false);
118
119 QQuickPopupAnchors *getAnchors();
120 virtual QQuickPopupPositioner *getPositioner();
121
122 void setWindow(QQuickWindow *window);
123 void itemDestroyed(QQuickItem *item) override;
124
125 QPalette defaultPalette() const override;
126
128 NoTransition, EnterTransition, ExitTransition
129 };
130
131 static const QQuickPopup::ClosePolicy DefaultClosePolicy;
132
133 bool focus = false;
134 bool modal = false;
135 bool dim = false;
136 bool hasDim = false;
137 bool visible = false;
138 bool complete = true;
139 bool positioning = false;
140 bool hasWidth = false;
141 bool hasHeight = false;
142 bool hasTopMargin = false;
143 bool hasLeftMargin = false;
144 bool hasRightMargin = false;
145 bool hasBottomMargin = false;
146 bool hasZ = false;
147 bool allowVerticalFlip = false;
148 bool allowHorizontalFlip = false;
149 bool allowVerticalMove = true;
150 bool allowHorizontalMove = true;
151 bool allowVerticalResize = true;
152 bool allowHorizontalResize = true;
153 bool hadActiveFocusBeforeExitTransition = false;
154 bool interactive = true;
155 bool hasClosePolicy = false;
156 bool outsidePressed = false;
157 bool outsideParentPressed = false;
158 bool inDestructor = false;
159 bool relaxEdgeConstraint = false;
160 int touchId = -1;
161 qreal x = 0;
162 qreal y = 0;
163 qreal effectiveX = 0;
164 qreal effectiveY = 0;
165 qreal margins = -1;
166 qreal topMargin = 0;
167 qreal leftMargin = 0;
168 qreal rightMargin = 0;
169 qreal bottomMargin = 0;
171 TransitionState transitionState = NoTransition;
172 QQuickPopup::ClosePolicy closePolicy = DefaultClosePolicy;
173 QQuickItem *parentItem = nullptr;
174 QQuickItem *dimmer = nullptr;
175 QPointer<QQuickWindow> window;
176 QQuickTransition *enter = nullptr;
177 QQuickTransition *exit = nullptr;
178 QQuickPopupItem *popupItem = nullptr;
179 QQuickPopupPositioner *positioner = nullptr;
180 QList<QQuickStateAction> enterActions;
181 QList<QQuickStateAction> exitActions;
184 qreal explicitDimmerOpacity = 0;
185 qreal prevOpacity = 0;
186 qreal prevScale = 0;
187
189};
190
192
193#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:246
\inmodule QtCore
Definition qmargins.h:270
\inmodule QtGui
Definition qevent.h:196
The QPalette class contains color groups for each widget state.
Definition qpalette.h:19
\inmodule QtCore\reentrant
Definition qpoint.h:217
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Definition qquickitem.h:63
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:917
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:35
double qreal
Definition qtypes.h:187
QGraphicsItem * item
aWidget window() -> setWindowTitle("New Window Title")
[2]