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 insetChange(const QMarginsF &newInset, const QMarginsF &oldInset) override;
64 void spacingChange(qreal newSpacing, qreal oldSpacing) override;
65 void enabledChange() override;
66
67 QFont defaultFont() const override;
68
69#if QT_CONFIG(accessibility)
70 QAccessible::Role accessibleRole() const override;
71 void accessibilityActiveChanged(bool active) override;
72#endif
73
74private:
75 Q_DISABLE_COPY(QQuickPopupItem)
76 Q_DECLARE_PRIVATE(QQuickPopupItem)
77 friend class QQuickPopup;
78};
79
80class Q_QUICKTEMPLATES2_EXPORT QQuickPopupItemPrivate : public QQuickPagePrivate
81{
82 Q_DECLARE_PUBLIC(QQuickPopupItem)
83
84public:
85 QQuickPopupItemPrivate(QQuickPopup *popup);
86
87 static QQuickPopupItemPrivate *get(QQuickPopupItem *popupItem);
88
89 void implicitWidthChanged() override;
90 void implicitHeightChanged() override;
91
92 void resolveFont() override;
93
94 QQuickItem *getContentItem() override;
95
96 void cancelContentItem() override;
97 void executeContentItem(bool complete = false) override;
98
99 void cancelBackground() override;
100 void executeBackground(bool complete = false) override;
101
102 QQuickPalette *palette() const override;
103 void setPalette(QQuickPalette* p) override;
104 void resetPalette() override;
105
106 QPalette defaultPalette() const override;
107 bool providesPalette() const override;
108
109 QPalette parentPalette(const QPalette &fallbackPalette) const override;
110
111 // Only used by QQuickContextMenuAttached for Qt 6.
112 // In Qt 7 this will obsolete Controls' copy of QQuickAttachedPropertyPropagator
113 // and its attached popup logic: QTBUG-138546
114 QtPrivate::QQuickAttachedPropertyPropagator *attachedPropertyPropagator_parent(
115 const QMetaObject *attachedType) override;
116
117 int backId = 0;
118 int escapeId = 0;
119 QQuickPopup *popup = nullptr;
120};
121
122QT_END_NAMESPACE
123
124#endif // QQUICKPOPUPITEM_P_P_H
QAccessibleQuickPopupItem(QQuickPopupItem *popupItem)
QAccessible::State state() const override
Combined button and popup list for selecting options.