3#include "qml_material/control/panel.hpp"
8class QML_MATERIAL_API Page :
public Panel {
10 QML_NAMED_ELEMENT(PageBase)
11 Q_PROPERTY(QString title READ title WRITE setTitle RESET resetTitle NOTIFY titleChanged FINAL)
12 Q_PROPERTY(QQuickItem* header READ header WRITE setHeader NOTIFY headerChanged FINAL)
13 Q_PROPERTY(QQuickItem* footer READ footer WRITE setFooter NOTIFY footerChanged FINAL)
15 qreal implicitHeaderWidth READ implicitHeaderWidth NOTIFY implicitHeaderWidthChanged FINAL)
16 Q_PROPERTY(qreal implicitHeaderHeight READ implicitHeaderHeight NOTIFY
17 implicitHeaderHeightChanged FINAL)
19 qreal implicitFooterWidth READ implicitFooterWidth NOTIFY implicitFooterWidthChanged FINAL)
20 Q_PROPERTY(qreal implicitFooterHeight READ implicitFooterHeight NOTIFY
21 implicitFooterHeightChanged FINAL)
22 Q_PROPERTY(
bool canBack READ canBack WRITE setCanBack NOTIFY canBackChanged FINAL)
23 Q_PROPERTY(
bool scrolling READ scrolling WRITE setScrolling NOTIFY scrollingChanged FINAL)
26 explicit Page(QQuickItem* parent =
nullptr);
28 QString title()
const;
29 void setTitle(
const QString& value);
31 QQuickItem* header()
const;
32 QQuickItem* footer()
const;
33 void setHeader(QQuickItem* item);
34 void setFooter(QQuickItem* item);
35 qreal implicitHeaderWidth()
const;
36 qreal implicitHeaderHeight()
const;
37 qreal implicitFooterWidth()
const;
38 qreal implicitFooterHeight()
const;
40 void setCanBack(
bool value);
41 bool scrolling()
const;
42 void setScrolling(
bool value);
44 Q_SIGNAL
void titleChanged();
45 Q_SIGNAL
void headerChanged();
46 Q_SIGNAL
void footerChanged();
47 Q_SIGNAL
void implicitHeaderWidthChanged();
48 Q_SIGNAL
void implicitHeaderHeightChanged();
49 Q_SIGNAL
void implicitFooterWidthChanged();
50 Q_SIGNAL
void implicitFooterHeightChanged();
51 Q_SIGNAL
void canBackChanged();
52 Q_SIGNAL
void scrollingChanged();
55 QRectF contentRect()
const override;
56 void componentComplete()
override;
57 void geometryChange(
const QRectF& geometry,
const QRectF& oldGeometry)
override;
61 QPointer<QQuickItem> item;
62 QSizeF implicitSize { 0, 0 };
63 QList<QMetaObject::Connection> connections;
65 void setSlot(Slot& slot, QQuickItem* item);
66 void updateSlot(Slot& slot);
71 bool m_can_back =
false;
72 bool m_scrolling =
false;
73 bool m_layout_active =
false;
74 QMetaObject::Connection m_spacing_connection;