diff options
-rw-r--r-- | src/controls/qquickapplicationwindow.cpp | 52 | ||||
-rw-r--r-- | src/controls/qquickapplicationwindow_p.h | 10 | ||||
-rw-r--r-- | src/imports/controls/ApplicationWindow.qml | 9 |
3 files changed, 1 insertions, 70 deletions
diff --git a/src/controls/qquickapplicationwindow.cpp b/src/controls/qquickapplicationwindow.cpp index c642c208..a750ec01 100644 --- a/src/controls/qquickapplicationwindow.cpp +++ b/src/controls/qquickapplicationwindow.cpp @@ -60,7 +60,7 @@ class QQuickApplicationWindowPrivate : public QQuickItemChangeListener Q_DECLARE_PUBLIC(QQuickApplicationWindow) public: - QQuickApplicationWindowPrivate() : complete(false), contentWidth(0), contentHeight(0), header(Q_NULLPTR), footer(Q_NULLPTR) { } + QQuickApplicationWindowPrivate() : complete(false), header(Q_NULLPTR), footer(Q_NULLPTR) { } void relayout(); @@ -68,8 +68,6 @@ public: void itemImplicitHeightChanged(QQuickItem *item) Q_DECL_OVERRIDE; bool complete; - qreal contentWidth; - qreal contentHeight; QQuickItem *header; QQuickItem *footer; QQuickApplicationWindow *q_ptr; @@ -197,54 +195,6 @@ void QQuickApplicationWindow::setFooter(QQuickItem *footer) } } -/*! - \qmlproperty real QtQuickControls2::ApplicationWindow::contentWidth - - This property is the width of the window content without header and footer. - Setting it will resize the window accordingly. - By default the implicit width of the child items is used. - - \sa contentHeight -*/ -qreal QQuickApplicationWindow::contentWidth() const -{ - Q_D(const QQuickApplicationWindow); - return d->contentWidth; -} - -void QQuickApplicationWindow::setContentWidth(qreal width) -{ - Q_D(QQuickApplicationWindow); - if (d->contentWidth != width) { - d->contentWidth = width; - emit contentWidthChanged(); - } -} - -/*! - \qmlproperty real QtQuickControls2::ApplicationWindow::contentHeight - - This property is the height of the window content without header and footer. - Setting it will resize the window accordingly. - By default the implicit height of the child items is used. - - \sa contentWidth -*/ -qreal QQuickApplicationWindow::contentHeight() const -{ - Q_D(const QQuickApplicationWindow); - return d->contentHeight; -} - -void QQuickApplicationWindow::setContentHeight(qreal height) -{ - Q_D(QQuickApplicationWindow); - if (d->contentHeight != height) { - d->contentHeight = height; - emit contentHeightChanged(); - } -} - bool QQuickApplicationWindow::isComponentComplete() const { Q_D(const QQuickApplicationWindow); diff --git a/src/controls/qquickapplicationwindow_p.h b/src/controls/qquickapplicationwindow_p.h index 6acab50b..3117322f 100644 --- a/src/controls/qquickapplicationwindow_p.h +++ b/src/controls/qquickapplicationwindow_p.h @@ -60,8 +60,6 @@ class Q_QUICKCONTROLS_EXPORT QQuickApplicationWindow : public QQuickWindowQmlImp Q_OBJECT Q_PROPERTY(QQuickItem *header READ header WRITE setHeader NOTIFY headerChanged FINAL) Q_PROPERTY(QQuickItem *footer READ footer WRITE setFooter NOTIFY footerChanged FINAL) - Q_PROPERTY(qreal contentWidth READ contentWidth WRITE setContentWidth NOTIFY contentWidthChanged FINAL) - Q_PROPERTY(qreal contentHeight READ contentHeight WRITE setContentHeight NOTIFY contentHeightChanged FINAL) public: explicit QQuickApplicationWindow(QWindow *parent = Q_NULLPTR); @@ -73,17 +71,9 @@ public: QQuickItem *footer() const; void setFooter(QQuickItem *footer); - qreal contentWidth() const; - void setContentWidth(qreal width); - - qreal contentHeight() const; - void setContentHeight(qreal height); - Q_SIGNALS: void headerChanged(); void footerChanged(); - void contentWidthChanged(); - void contentHeightChanged(); protected: bool isComponentComplete() const; diff --git a/src/imports/controls/ApplicationWindow.qml b/src/imports/controls/ApplicationWindow.qml index d989185d..38533be6 100644 --- a/src/imports/controls/ApplicationWindow.qml +++ b/src/imports/controls/ApplicationWindow.qml @@ -42,13 +42,4 @@ AbstractApplicationWindow { id: window color: Theme.backgroundColor - - contentWidth: contentItem.children.length === 1 ? contentItem.children[0].implicitWidth : 0 - contentHeight: contentItem.children.length === 1 ? contentItem.children[0].implicitHeight : 0 - - minimumWidth: Math.max(contentWidth, - (header ? header.implicitWidth : 0), - (footer ? footer.implicitWidth : 0)) - minimumHeight: contentHeight + (header ? header.implicitHeight : 0) - + (footer ? footer.implicitHeight : 0) } |