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
qquickpopupitem_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 QQUICKPOPUPITEM_P_P_H
6#define QQUICKPOPUPITEM_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/qquickpage_p.h>
20#include <QtQuickTemplates2/private/qquickpage_p_p.h>
21
22QT_BEGIN_NAMESPACE
23
24class QQuickPopup;
25class QQuickPopupItemPrivate;
26
27class Q_QUICKTEMPLATES2_EXPORT QQuickPopupItem : public QQuickPage
28{
29 Q_OBJECT
30
31public:
32 explicit QQuickPopupItem(QQuickPopup *popup);
33
34protected:
35 void updatePolish() override;
36
37 bool childMouseEventFilter(QQuickItem *child, QEvent *event) override;
38 void focusInEvent(QFocusEvent *event) override;
39 void focusOutEvent(QFocusEvent *event) override;
40 void keyPressEvent(QKeyEvent *event) override;
41 void keyReleaseEvent(QKeyEvent *event) override;
42 void mousePressEvent(QMouseEvent *event) override;
43 void mouseMoveEvent(QMouseEvent *event) override;
44 void mouseReleaseEvent(QMouseEvent *event) override;
45 void mouseDoubleClickEvent(QMouseEvent *event) override;
46 void mouseUngrabEvent() override;
47#if QT_CONFIG(quicktemplates2_multitouch)
48 void touchEvent(QTouchEvent *event) override;
49 void touchUngrabEvent() override;
50#endif
51#if QT_CONFIG(wheelevent)
52 void wheelEvent(QWheelEvent *event) override;
53#endif
54#if QT_CONFIG(quick_draganddrop)
55 void dragEnterEvent(QDragEnterEvent *event) override;
56 void dragMoveEvent(QDragMoveEvent *event) override;
57 void dragLeaveEvent(QDragLeaveEvent *event) override;
58 void dropEvent(QDropEvent *event) override;
59#endif
60
61 void contentItemChange(QQuickItem *newItem, QQuickItem *oldItem) override;
62 void contentSizeChange(const QSizeF &newSize, const QSizeF &oldSize) override;
63 void fontChange(const QFont &newFont, const QFont &oldFont) override;
64 void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override;
65 void localeChange(const QLocale &newLocale, const QLocale &oldLocale) override;
66 void mirrorChange() override;
67 void itemChange(ItemChange change, const ItemChangeData &data) override;
68 void paddingChange(const QMarginsF &newPadding, const QMarginsF &oldPadding) override;
69 void insetChange(const QMarginsF &newInset, const QMarginsF &oldInset) override;
70 void spacingChange(qreal newSpacing, qreal oldSpacing) override;
71 void enabledChange() override;
72
73 QFont defaultFont() const override;
74
75#if QT_CONFIG(accessibility)
76 QAccessible::Role accessibleRole() const override;
77 void accessibilityActiveChanged(bool active) override;
78#endif
79
80private:
81 Q_DISABLE_COPY(QQuickPopupItem)
82 Q_DECLARE_PRIVATE(QQuickPopupItem)
83 friend class QQuickPopup;
84};
85
86class Q_QUICKTEMPLATES2_EXPORT QQuickPopupItemPrivate : public QQuickPagePrivate
87{
88 Q_DECLARE_PUBLIC(QQuickPopupItem)
89
90public:
91 QQuickPopupItemPrivate(QQuickPopup *popup);
92
93 static QQuickPopupItemPrivate *get(QQuickPopupItem *popupItem);
94
95 void implicitWidthChanged() override;
96 void implicitHeightChanged() override;
97
98 void resolveFont() override;
99
100 QQuickItem *getContentItem() override;
101
102 void cancelContentItem() override;
103 void executeContentItem(bool complete = false) override;
104
105 void cancelBackground() override;
106 void executeBackground(bool complete = false) override;
107
108 QQuickPalette *palette() const override;
109 void setPalette(QQuickPalette* p) override;
110 void resetPalette() override;
111
112 QPalette defaultPalette() const override;
113 bool providesPalette() const override;
114
115 QPalette parentPalette(const QPalette &fallbackPalette) const override;
116
117 // Only used by QQuickContextMenuAttached for Qt 6.
118 // In Qt 7 this will obsolete Controls' copy of QQuickAttachedPropertyPropagator
119 // and its attached popup logic: QTBUG-138546
120 QtPrivate::QQuickAttachedPropertyPropagator *attachedPropertyPropagator_parent(
121 const QMetaObject *attachedType) override;
122
123 int backId = 0;
124 int escapeId = 0;
125 QQuickPopup *popup = nullptr;
126};
127
128QT_END_NAMESPACE
129
130#endif // QQUICKPOPUPITEM_P_P_H
QAccessibleQuickPopupItem(QQuickPopupItem *popupItem)
QAccessible::State state() const override
Combined button and popup list for selecting options.