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
55 void contentItemChange(QQuickItem *newItem, QQuickItem *oldItem) override;
56 void contentSizeChange(const QSizeF &newSize, const QSizeF &oldSize) override;
57 void fontChange(const QFont &newFont, const QFont &oldFont) override;
58 void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override;
59 void localeChange(const QLocale &newLocale, const QLocale &oldLocale) override;
60 void mirrorChange() override;
61 void itemChange(ItemChange change, const ItemChangeData &data) override;
62 void paddingChange(const QMarginsF &newPadding, const QMarginsF &oldPadding) override;
63 void enabledChange() override;
64
65 QFont defaultFont() const override;
66
67#if QT_CONFIG(accessibility)
68 QAccessible::Role accessibleRole() const override;
69 void accessibilityActiveChanged(bool active) override;
70#endif
71
72private:
73 Q_DISABLE_COPY(QQuickPopupItem)
74 Q_DECLARE_PRIVATE(QQuickPopupItem)
75 friend class QQuickPopup;
76};
77
78class Q_QUICKTEMPLATES2_EXPORT QQuickPopupItemPrivate : public QQuickPagePrivate
79{
80 Q_DECLARE_PUBLIC(QQuickPopupItem)
81
82public:
83 QQuickPopupItemPrivate(QQuickPopup *popup);
84
85 static QQuickPopupItemPrivate *get(QQuickPopupItem *popupItem);
86
87 void implicitWidthChanged() override;
88 void implicitHeightChanged() override;
89
90 void resolveFont() override;
91
92 QQuickItem *getContentItem() override;
93
94 void cancelContentItem() override;
95 void executeContentItem(bool complete = false) override;
96
97 void cancelBackground() override;
98 void executeBackground(bool complete = false) override;
99
100 QQuickPalette *palette() const override;
101 void setPalette(QQuickPalette* p) override;
102 void resetPalette() override;
103
104 QPalette defaultPalette() const override;
105 bool providesPalette() const override;
106
107 QPalette parentPalette(const QPalette &fallbackPalette) const override;
108
109 // Only used by QQuickContextMenuAttached for Qt 6.
110 // In Qt 7 this will obsolete Controls' copy of QQuickAttachedPropertyPropagator
111 // and its attached popup logic: QTBUG-138546
112 QtPrivate::QQuickAttachedPropertyPropagator *attachedPropertyPropagator_parent(
113 const QMetaObject *attachedType) override;
114
115 int backId = 0;
116 int escapeId = 0;
117 QQuickPopup *popup = nullptr;
118};
119
120QT_END_NAMESPACE
121
122#endif // QQUICKPOPUPITEM_P_P_H
QAccessibleQuickPopupItem(QQuickPopupItem *popupItem)
QAccessible::State state() const override
Combined button and popup list for selecting options.