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#if QT_CONFIG(tabletevent) || QT_CONFIG(wheelevent)
41 bool eatEventIfBlockedByModal(QPointerEvent *event);
42#endif
43 bool startDrag(QEvent *event, const QPointF &pos);
44 bool handlePress(QQuickItem *source, QEvent *event, QQuickPopup *target);
45 bool handleMove(QQuickItem *source, QEvent *event, QQuickPopup *target);
46 bool handleRelease(QQuickItem *source, QEvent *event, QQuickPopup *target);
47
48 bool handleMouseEvent(QQuickItem *source, QMouseEvent *event, QQuickPopup *target = nullptr);
49 bool handleHoverEvent(QQuickItem *source, QHoverEvent *event, QQuickPopup *target = nullptr);
50#if QT_CONFIG(quicktemplates2_multitouch)
51 bool handleTouchEvent(QQuickItem *source, QTouchEvent *event, QQuickPopup *target = nullptr);
52#endif
53
54 void addPopup(QQuickPopup *popup);
55 void removePopup(QQuickPopup *popup);
56 void setMouseGrabberPopup(QQuickPopup *popup);
57
58 QList<QQuickPopup *> stackingOrderPopups() const;
59 QList<QQuickPopup *> stackingOrderDrawers() const;
60
61 void itemGeometryChanged(QQuickItem *item, QQuickGeometryChange change, const QRectF &diff) override;
62 void itemRotationChanged(QQuickItem *item) override;
63
64 void updateGeometry();
65
66 QQmlComponent *modal = nullptr;
67 QQmlComponent *modeless = nullptr;
68 QList<QQuickPopup *> allPopups;
69 // Store drawers as QQuickPopup instead of QQuickDrawer because they're no longer
70 // QQuickDrawer by the time removePopup is called.
71 QList<QQuickPopup *> allDrawers;
72 QPointer<QQuickPopup> mouseGrabberPopup;
73 QPointer<QQuickItem> lastActiveFocusItem;
74 QPointer<QQuickPopup> lastActiveFocusItemPopup;
75};
76
77QT_END_NAMESPACE
78
79#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
Combined button and popup list for selecting options.
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)