Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qquickoverlay_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// Qt-Security score:significant reason:default
4
5#ifndef QQUICKOVERLAY_P_P_H
6#define QQUICKOVERLAY_P_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtQuickTemplates2/private/qquickoverlay_p.h>
20
21#include <QtQuick/private/qquickitem_p.h>
22#include <QtQuick/private/qquickitemchangelistener_p.h>
23
24#include <QtCore/qpointer.h>
25
27
28class QQuickPopup;
29
30class Q_AUTOTEST_EXPORT QQuickOverlayPrivate : public QQuickItemPrivate,
31 public QSafeQuickItemChangeListener<QQuickOverlayPrivate>
32{
33public:
34 Q_DECLARE_PUBLIC(QQuickOverlay)
35
36 static QQuickOverlayPrivate *get(QQuickOverlay *overlay)
37 {
38 return overlay->d_func();
39 }
40
41 bool startDrag(QEvent *event, const QPointF &pos);
42 bool handlePress(QQuickItem *source, QEvent *event, QQuickPopup *target);
43 bool handleMove(QQuickItem *source, QEvent *event, QQuickPopup *target);
44 bool handleRelease(QQuickItem *source, QEvent *event, QQuickPopup *target);
45
46 bool handleMouseEvent(QQuickItem *source, QMouseEvent *event, QQuickPopup *target = nullptr);
47 bool handleHoverEvent(QQuickItem *source, QHoverEvent *event, QQuickPopup *target = nullptr);
48#if QT_CONFIG(quicktemplates2_multitouch)
49 bool handleTouchEvent(QQuickItem *source, QTouchEvent *event, QQuickPopup *target = nullptr);
50#endif
51
52 void addPopup(QQuickPopup *popup);
53 void removePopup(QQuickPopup *popup);
54 void setMouseGrabberPopup(QQuickPopup *popup);
55
56 QList<QQuickPopup *> stackingOrderPopups() const;
57 QList<QQuickPopup *> stackingOrderDrawers() const;
58
59 void itemGeometryChanged(QQuickItem *item, QQuickGeometryChange change, const QRectF &diff) override;
60 void itemRotationChanged(QQuickItem *item) override;
61
62 void updateGeometry();
63
64 QQmlComponent *modal = nullptr;
65 QQmlComponent *modeless = nullptr;
66 QList<QQuickPopup *> allPopups;
67 // Store drawers as QQuickPopup instead of QQuickDrawer because they're no longer
68 // QQuickDrawer by the time removePopup is called.
69 QList<QQuickPopup *> allDrawers;
70 QPointer<QQuickPopup> mouseGrabberPopup;
71 QPointer<QQuickItem> lastActiveFocusItem;
72};
73
74QT_END_NAMESPACE
75
76#endif // QQUICKOVERLAY_P_P_H
QPalette defaultPalette() const override
void setSubMenu(QQuickMenu *subMenu)
void executeArrow(bool complete=false)
QPointer< QQuickMenu > subMenu
QQuickDeferredPointer< QQuickItem > arrow
bool acceptKeyClick(Qt::Key key) const override
QQuickMenuPositioner(QQuickMenu *menu)
void reposition() override
static const QQuickPopup::ClosePolicy cascadingSubMenuClosePolicy
Menu popup that can be used as a context menu or popup menu.
static QQuickItem * findParentMenuItem(QQuickMenu *subMenu)
static bool shouldCascade()
static QWindow * effectiveWindow(QWindow *window, QPoint *offset)
QString nativeMenuItemListToString(const QList< QQuickNativeMenuItem * > &nativeItems)