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
qquickapplicationwindow_p_p.h
Go to the documentation of this file.
1// Copyright (C) 2025 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 QQUICKAPPLICATIONWINDOW_P_P_H
6#define QQUICKAPPLICATIONWINDOW_P_P_H
7
8#include <QtQuick/private/qquickitemchangelistener_p.h>
9#include <QtQuick/private/qquickwindowmodule_p_p.h>
10#include <QtQuickTemplates2/private/qquickapplicationwindow_p.h>
11#include <QtQuickTemplates2/private/qquickcontrol_p.h>
12#include <QtQuickTemplates2/private/qquickdeferredpointer_p_p.h>
13#include <QtQuickTemplates2/private/qquickpopup_p_p.h>
14#include <QtQuickTemplates2/private/qquicktheme_p.h>
15#include <QtQuickTemplates2/private/qquicktooltip_p.h>
16
17//
18// W A R N I N G
19// -------------
20//
21// This file is not part of the Qt API. It exists purely as an
22// implementation detail. This header file may change from version to
23// version without notice, or even be removed.
24//
25// We mean it.
26//
27
29
30class Q_QUICKTEMPLATES2_EXPORT QQuickApplicationWindowPrivate
31 : public QQuickWindowQmlImplPrivate
32 , public QSafeQuickItemChangeListener<QQuickApplicationWindowPrivate>
33{
34 Q_DECLARE_PUBLIC(QQuickApplicationWindow)
35
36public:
37 static QQuickApplicationWindowPrivate *get(QQuickApplicationWindow *window)
38 {
39 return window->d_func();
40 }
41
42 QQmlListProperty<QObject> contentData();
43
44 void updateHasBackgroundFlags();
45 void relayout();
46
47 void itemGeometryChanged(QQuickItem *item, QQuickGeometryChange change, const QRectF &diff) override;
48 void itemVisibilityChanged(QQuickItem *item) override;
49 void itemImplicitWidthChanged(QQuickItem *item) override;
50 void itemImplicitHeightChanged(QQuickItem *item) override;
51 QPalette windowPalette() const override { return defaultPalette(); }
52
53 void updateFont(const QFont &f);
54 inline void setFont_helper(const QFont &f) {
55 if (font.resolveMask() == f.resolveMask() && font == f)
56 return;
57 updateFont(f);
58 }
59 void resolveFont();
60
61 void _q_updateActiveFocus();
62 void setActiveFocusControl(QQuickItem *item);
63
64 static void contentData_append(QQmlListProperty<QObject> *prop, QObject *obj);
65
66 void cancelBackground();
67 void executeBackground(bool complete = false);
68
69 QPalette defaultPalette() const override { return QQuickTheme::palette(QQuickTheme::System); }
70 void updateChildrenPalettes(const QPalette &parentPalette) override
71 {
72 // Update regular children
73 QQuickWindowPrivate::updateChildrenPalettes(parentPalette);
74
75 // And cover special cases
76 for (auto &&child : q_func()->findChildren<QObject *>()) {
77 if (auto *popup = qobject_cast<QQuickPopup *>(child))
78 QQuickPopupPrivate::get(popup)->updateContentPalettes(parentPalette);
79 else if (auto *toolTipAttached = qobject_cast<QQuickToolTipAttached *>(child)) {
80 if (auto *toolTip = toolTipAttached->toolTip())
81 QQuickPopupPrivate::get(toolTip)->updateContentPalettes(parentPalette);
82 }
83 }
84 }
85
86 QQuickDeferredPointer<QQuickItem> background;
87 QQuickControl *control = nullptr;
88 QQuickItem *menuBar = nullptr;
89 QQuickItem *header = nullptr;
90 QQuickItem *footer = nullptr;
91 QFont font;
92 QLocale locale;
93 QQuickItem *activeFocusControl = nullptr;
94 bool insideRelayout = false;
95 bool hasBackgroundWidth = false;
96 bool hasBackgroundHeight = false;
97};
98
99QT_END_NAMESPACE
100
101#endif // QQUICKAPPLICATIONWINDOW_P_P_H
bool isInteractiveControlType(const QQuickItem *item)
static void layoutItem(QQuickItem *item, qreal y, qreal width)
static const QQuickItemPrivate::ChangeTypes ItemChanges
Styled top-level window with support for a header and footer.
static QQuickItem * findActiveFocusControl(QQuickWindow *window)