aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickpage_p.h
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2018-03-09 14:37:24 +0100
committerJ-P Nurmi <jpnurmi@qt.io>2018-03-09 15:57:07 +0000
commit2f4726883b17fe2c935ac2e5d1bfa9b2bca8b5e3 (patch)
tree7c8671b18f1ad739d6172bdc6ec10fc274efa036 /src/quicktemplates2/qquickpage_p.h
parent87dec648804bfa974a297c37542dd77de9f72e9f (diff)
Inherit QQuickPage from QQuickPane
This allows us to remove a lot of duplicate code, and Page gets the same automatic content size calculation that was added to Pane. Change-Id: I98dc3a5070d61c1720dc11003bc4076aba481b3a Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquickpage_p.h')
-rw-r--r--src/quicktemplates2/qquickpage_p.h22
1 files changed, 2 insertions, 20 deletions
diff --git a/src/quicktemplates2/qquickpage_p.h b/src/quicktemplates2/qquickpage_p.h
index 0789e996..49f9f85f 100644
--- a/src/quicktemplates2/qquickpage_p.h
+++ b/src/quicktemplates2/qquickpage_p.h
@@ -48,25 +48,22 @@
// We mean it.
//
-#include <QtQuickTemplates2/private/qquickcontrol_p.h>
+#include <QtQuickTemplates2/private/qquickpane_p.h>
#include <QtQml/qqmllist.h>
QT_BEGIN_NAMESPACE
class QQuickPagePrivate;
-class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickPage : public QQuickControl
+class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickPage : public QQuickPane
{
Q_OBJECT
Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY titleChanged FINAL)
Q_PROPERTY(QQuickItem *header READ header WRITE setHeader NOTIFY headerChanged FINAL)
Q_PROPERTY(QQuickItem *footer READ footer WRITE setFooter NOTIFY footerChanged FINAL)
- Q_PROPERTY(QQmlListProperty<QObject> contentData READ contentData FINAL)
- Q_PROPERTY(QQmlListProperty<QQuickItem> contentChildren READ contentChildren NOTIFY contentChildrenChanged FINAL)
// 2.1 (Qt 5.8)
Q_PROPERTY(qreal contentWidth READ contentWidth WRITE setContentWidth NOTIFY contentWidthChanged FINAL REVISION 1)
Q_PROPERTY(qreal contentHeight READ contentHeight WRITE setContentHeight NOTIFY contentHeightChanged FINAL REVISION 1)
- Q_CLASSINFO("DefaultProperty", "contentData")
public:
explicit QQuickPage(QQuickItem *parent = nullptr);
@@ -80,29 +77,14 @@ public:
QQuickItem *footer() const;
void setFooter(QQuickItem *footer);
- QQmlListProperty<QObject> contentData();
- QQmlListProperty<QQuickItem> contentChildren();
-
- // 2.1 (Qt 5.8)
- qreal contentWidth() const;
- void setContentWidth(qreal width);
-
- qreal contentHeight() const;
- void setContentHeight(qreal height);
-
Q_SIGNALS:
void titleChanged();
void headerChanged();
void footerChanged();
- void contentChildrenChanged();
- // 2.1 (Qt 5.8)
- Q_REVISION(1) void contentWidthChanged();
- Q_REVISION(1) void contentHeightChanged();
protected:
void componentComplete() override;
- void contentItemChange(QQuickItem *newItem, QQuickItem *oldItem) override;
void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) override;
void paddingChange(const QMarginsF &newPadding, const QMarginsF &oldPadding) override;
void spacingChange(qreal newSpacing, qreal oldSpacing) override;