aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickapplicationwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/quicktemplates2/qquickapplicationwindow.cpp')
-rw-r--r--src/quicktemplates2/qquickapplicationwindow.cpp25
1 files changed, 16 insertions, 9 deletions
diff --git a/src/quicktemplates2/qquickapplicationwindow.cpp b/src/quicktemplates2/qquickapplicationwindow.cpp
index 3a454353..87dc8816 100644
--- a/src/quicktemplates2/qquickapplicationwindow.cpp
+++ b/src/quicktemplates2/qquickapplicationwindow.cpp
@@ -42,6 +42,7 @@
#include "qquicktextfield_p.h"
#include "qquicktoolbar_p.h"
#include "qquicktabbar_p.h"
+#include "qquickdialogbuttonbox_p.h"
#include <QtCore/private/qobject_p.h>
#include <QtQuick/private/qquickitem_p.h>
@@ -68,7 +69,7 @@ QT_BEGIN_NAMESPACE
\image qtquickcontrols2-applicationwindow-wireframe.png
\qml
- import QtQuick.Controls 2.0
+ import QtQuick.Controls 2.1
ApplicationWindow {
visible: true
@@ -153,7 +154,7 @@ public:
void relayout();
- void itemGeometryChanged(QQuickItem *item, const QRectF &newRect, const QRectF &oldRect) override;
+ void itemGeometryChanged(QQuickItem *item, QQuickGeometryChange change, const QRectF &diff) override;
void itemVisibilityChanged(QQuickItem *item) override;
void itemImplicitWidthChanged(QQuickItem *item) override;
void itemImplicitHeightChanged(QQuickItem *item) override;
@@ -223,11 +224,11 @@ void QQuickApplicationWindowPrivate::relayout()
}
}
-void QQuickApplicationWindowPrivate::itemGeometryChanged(QQuickItem *item, const QRectF &newRect, const QRectF &oldRect)
+void QQuickApplicationWindowPrivate::itemGeometryChanged(QQuickItem *item, QQuickGeometryChange change, const QRectF &diff)
{
Q_UNUSED(item)
- Q_UNUSED(newRect)
- Q_UNUSED(oldRect)
+ Q_UNUSED(change)
+ Q_UNUSED(diff)
relayout();
}
@@ -357,8 +358,9 @@ void QQuickApplicationWindow::setBackground(QQuickItem *background)
}
\endcode
- \note Assigning a ToolBar or TabBar as a window header sets the respective
- \l ToolBar::position or \l TabBar::position property automatically to \c Header.
+ \note Assigning a ToolBar, TabBar, or DialogButtonBox as a window header
+ automatically sets the respective \l ToolBar::position, \l TabBar::position,
+ or \l DialogButtonBox::position property to \c Header.
\sa footer, Page::header
*/
@@ -391,6 +393,8 @@ void QQuickApplicationWindow::setHeader(QQuickItem *header)
toolBar->setPosition(QQuickToolBar::Header);
else if (QQuickTabBar *tabBar = qobject_cast<QQuickTabBar *>(header))
tabBar->setPosition(QQuickTabBar::Header);
+ else if (QQuickDialogButtonBox *buttonBox = qobject_cast<QQuickDialogButtonBox *>(header))
+ buttonBox->setPosition(QQuickDialogButtonBox::Header);
}
if (isComponentComplete())
d->relayout();
@@ -411,8 +415,9 @@ void QQuickApplicationWindow::setHeader(QQuickItem *header)
}
\endcode
- \note Assigning a ToolBar or TabBar as a window footer sets the respective
- \l ToolBar::position or \l TabBar::position property automatically to \c Footer.
+ \note Assigning a ToolBar, TabBar, or DialogButtonBox as a window footer
+ automatically sets the respective \l ToolBar::position, \l TabBar::position,
+ or \l DialogButtonBox::position property to \c Footer.
\sa header, Page::footer
*/
@@ -445,6 +450,8 @@ void QQuickApplicationWindow::setFooter(QQuickItem *footer)
toolBar->setPosition(QQuickToolBar::Footer);
else if (QQuickTabBar *tabBar = qobject_cast<QQuickTabBar *>(footer))
tabBar->setPosition(QQuickTabBar::Footer);
+ else if (QQuickDialogButtonBox *buttonBox = qobject_cast<QQuickDialogButtonBox *>(footer))
+ buttonBox->setPosition(QQuickDialogButtonBox::Footer);
}
if (isComponentComplete())
d->relayout();