aboutsummaryrefslogtreecommitdiffstats
path: root/src/controls
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@theqtcompany.com>2015-09-02 13:15:01 +0200
committerJ-P Nurmi <jpnurmi@theqtcompany.com>2015-09-05 17:42:17 +0000
commit3ae1022f42982348c341c2f296e7e7d6d3667fe0 (patch)
tree66f5391a39c9efe5b6e1845e651bc1751758473f /src/controls
parentddfa5e774febee165059079a5e9f9e54a122a190 (diff)
ApplicationWindow: remove contentWidth/Height
As illustrated by QTBUG-48072, setting Window.minimumWidth and Window.minimumHeight automatically may cause very unpleasant surprises. Qt Quick Controls 2.x gives the user direct access to the header and footer items, so they can easily calculate the desired minimum, default and maximum sizes for the window. Change-Id: I974566ee81af63a3e9cfd0fa1c1fa36e3989548a Task-number: QTBUG-48072 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Diffstat (limited to 'src/controls')
-rw-r--r--src/controls/qquickapplicationwindow.cpp52
-rw-r--r--src/controls/qquickapplicationwindow_p.h10
2 files changed, 1 insertions, 61 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;