11#include <private/qtquicktemplates2-config_p.h>
12#if QT_CONFIG(quicktemplates2_container)
19#include <QtCore/private/qobject_p.h>
20#include <QtCore/qscopedvaluerollback.h>
21#include <QtQuick/private/qquickitem_p.h>
22#include <QtQuick/private/qquickitemchangelistener_p.h>
23#include <QtQuick/private/qquickwindowmodule_p_p.h>
105 QQmlListProperty<QObject> contentData();
115 void updateFont(
const QFont &
f);
123 void _q_updateActiveFocus();
126 static void contentData_append(QQmlListProperty<QObject> *prop,
QObject *
obj);
128 void cancelBackground();
129 void executeBackground(
bool complete =
false);
138 for (
auto &&popup : q_func()->findChildren<
QQuickPopup *>())
150 bool insideRelayout =
false;
151 bool hasBackgroundWidth =
false;
152 bool hasBackgroundHeight =
false;
162 if (!
p->widthValid()) {
164 p->widthValidFlag =
false;
180 content->
setY(mbh + hh);
182 content->
setHeight(
q->height() - mbh - hh - fh);
232 const bool changed =
font !=
f;
237 const QList<QQuickPopup *> popups =
q->findChildren<
QQuickPopup *>();
242 emit q->fontChanged();
255 if (qobject_cast<QQuickControl *>(
item) || qobject_cast<QQuickTextField *>(
item) || qobject_cast<QQuickTextArea *>(
item))
273 emit q->activeFocusControlChanged();
304QQuickApplicationWindow::QQuickApplicationWindow(
QWindow *parent)
310QQuickApplicationWindow::~QQuickApplicationWindow()
313 d->setActiveFocusControl(
nullptr);
350 d->executeBackground();
351 return d->background;
354void QQuickApplicationWindow::setBackground(
QQuickItem *background)
360 if (!
d->background.isExecuting())
361 d->cancelBackground();
364 d->hasBackgroundWidth =
false;
365 d->hasBackgroundHeight =
false;
378 d->hasBackgroundWidth = backgroundPrivate->widthValid();
379 d->hasBackgroundHeight = backgroundPrivate->heightValid();
384 if (!
d->background.isExecuting())
423 d->header->setParentItem(
nullptr);
434#if QT_CONFIG(quicktemplates2_container)
472void QQuickApplicationWindow::setFooter(
QQuickItem *footer)
480 d->footer->setParentItem(
nullptr);
491#if QT_CONFIG(quicktemplates2_container)
526 return QQmlListProperty<QObject>(
q->contentItem(),
q,
547 if (!
d->appWindowContentItem) {
550 d->appWindowContentItem->setFocus(
true);
553 return d->appWindowContentItem;
573 return d->activeFocusControl;
598void QQuickApplicationWindow::setFont(
const QFont &
font)
605 d->setFont_helper(resolvedFont);
608void QQuickApplicationWindow::resetFont()
633void QQuickApplicationWindow::setLocale(
const QLocale &locale)
650void QQuickApplicationWindow::resetLocale()
687 d->menuBar->setParentItem(
nullptr);
699 emit menuBarChanged();
705 return d->componentComplete;
711 d->componentComplete =
false;
719 d->componentComplete =
true;
720 d->executeBackground(
true);
779 connect(wnd, &QQuickWindow::activeFocusItemChanged,
784 emit q->windowChanged();
785 emit q->contentItemChanged();
788 if ((oldWindow && oldWindow->menuBar()) || (newWindow && newWindow->menuBar()))
789 emit q->menuBarChanged();
790 if ((oldWindow && oldWindow->header()) || (newWindow && newWindow->header()))
791 emit q->headerChanged();
792 if ((oldWindow && oldWindow->footer()) || (newWindow && newWindow->footer()))
793 emit q->footerChanged();
801 control = appWindow->activeFocusControl();
808 emit q->activeFocusControlChanged();
821 if (
QQuickPopup *popup = qobject_cast<QQuickPopup *>(
p->parent())) {
822 d->windowChange(popup->window());
829 d->windowChange(popup->window());
846 return qobject_cast<QQuickApplicationWindow *>(
d->window);
879 return d->activeFocusControl;
939#include "moc_qquickapplicationwindow_p.cpp"
QFont resolve(const QFont &) const
Returns a new QFont that has attributes copied from other that have not been previously set on this f...
QGraphicsWidget * window() const
QGraphicsItem * parentItem() const
Returns a pointer to this item's parent item.
static QMetaObject::Connection connect(const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot, Qt::ConnectionType type=Qt::AutoConnection)
QObject * parent() const
Returns a pointer to the parent object.
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
static bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *member)
\threadsafe
QList< T > findChildren(QAnyStringView aName, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
Returns all children of this object with the given name that can be cast to type T,...
The QPalette class contains color groups for each widget state.
void windowChange(QQuickWindow *wnd)
QQuickItem * activeFocusControl
QQuickApplicationWindow * window
QQuickApplicationWindowAttached(QObject *parent=nullptr)
QQuickItem * activeFocusControl
void setFont_helper(const QFont &f)
void _q_updateActiveFocus()
QQuickItem * activeFocusControl
QQmlListProperty< QObject > contentData()
\qmlproperty list<QtObject> QtQuick.Controls::ApplicationWindow::contentData \qmldefault
void updateChildrenPalettes(const QPalette &parentPalette) override
void setActiveFocusControl(QQuickItem *item)
QPalette defaultPalette() const override
void itemGeometryChanged(QQuickItem *item, QQuickGeometryChange change, const QRectF &diff) override
void itemImplicitWidthChanged(QQuickItem *item) override
void updateFont(const QFont &f)
QPalette windowPalette() const override
static void contentData_append(QQmlListProperty< QObject > *prop, QObject *obj)
static QQuickApplicationWindowPrivate * get(QQuickApplicationWindow *window)
QQuickDeferredPointer< QQuickItem > background
void executeBackground(bool complete=false)
void itemVisibilityChanged(QQuickItem *item) override
void itemImplicitHeightChanged(QQuickItem *item) override
void activeFocusControlChanged()
void resizeEvent(QResizeEvent *event) override
Override this to handle resize events (ev).
QQuickItem * activeFocusControl
bool isComponentComplete() const
void classBegin() override
Invoked after class creation, but before any properties have been set.
void componentComplete() override
Invoked after the root component that caused this instantiation has completed construction.
static void updateLocaleRecur(QQuickItem *item, const QLocale &l)
static void hideOldItem(QQuickItem *item)
static QQuickControlPrivate * get(QQuickControl *control)
static void updateFontRecur(QQuickItem *item, const QFont &font)
static void data_clear(QQmlListProperty< QObject > *)
static qsizetype data_count(QQmlListProperty< QObject > *)
\qmlproperty list<QtObject> QtQuick::Item::data \qmldefault
static QObject * data_at(QQmlListProperty< QObject > *, qsizetype)
static void data_append(QQmlListProperty< QObject > *, QObject *)
static QQuickItemPrivate * get(QQuickItem *item)
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
qreal x
\qmlproperty real QtQuick::Item::x \qmlproperty real QtQuick::Item::y \qmlproperty real QtQuick::Item...
void setParentItem(QQuickItem *parent)
qreal z
\qmlproperty real QtQuick::Item::z
qreal y
Defines the item's y position relative to its parent.
qreal width
This property holds the width of this item.
qreal height
This property holds the height of this item.
static QPalette palette(Scope scope)
static QFont font(Scope scope)
void updateChildrenPalettes(const QPalette &parentPalette) override
void classBegin() override
Invoked after class creation, but before any properties have been set.
void componentComplete() override
Invoked after the root component that caused this instantiation has completed construction.
\qmltype Window \instantiates QQuickWindow \inqmlmodule QtQuick
QQuickItem * contentItem
\qmlattachedproperty Item Window::contentItem
\inmodule QtCore\reentrant
The QResizeEvent class contains event parameters for resize events.
virtual void resizeEvent(QResizeEvent *)
Override this to handle resize events (ev).
Combined button and popup list for selecting options.
static QDBusError::ErrorType get(const char *name)
static QString header(const QString &name)
bool qFuzzyIsNull(qfloat16 f) noexcept
GLdouble GLdouble GLdouble GLdouble q
static void layoutItem(QQuickItem *item, qreal y, qreal width)
static QT_BEGIN_NAMESPACE const QQuickItemPrivate::ChangeTypes ItemChanges
Styled top-level window with support for a header and footer.
static QQuickItem * findActiveFocusControl(QQuickWindow *window)
void quickCancelDeferred(QObject *object, const QString &property)
void quickCompleteDeferred(QObject *object, const QString &property, QQuickDeferredPointer< T > &delegate)
void quickBeginDeferred(QObject *object, const QString &property, QQuickDeferredPointer< T > &delegate)
static QString backgroundName()
connect(quitButton, &QPushButton::clicked, &app, &QCoreApplication::quit, Qt::QueuedConnection)
myObject disconnect()
[26]