diff options
author | Martin Jones <martin.jones@nokia.com> | 2011-09-23 16:13:51 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-09-26 03:24:42 +0200 |
commit | 14228a41471a327f6e600220a795a1c6cb23c2b2 (patch) | |
tree | c7c9f127b8dfc9f9e608ab421a692be7896d0c18 /src/declarative/items/qsgflickable_p.h | |
parent | 2790f9b1d5488f7f29903408eaa5d2a6118f55ee (diff) |
Support margins in Flickable.
It is sometimes desireable to leave a margin/add decoration around the
content of a Flickable. This adds topMargin, leftMargin, bottomMargin
rightMargin, xOrigin and yOrigin properties to Flickable.
Task-number: QTBUG-21362
Change-Id: Ia24ea4c63e7a8de683b68100baac782c6f3a66bb
Reviewed-on: http://codereview.qt-project.org/5445
Reviewed-by: Bea Lam <bea.lam@nokia.com>
Diffstat (limited to 'src/declarative/items/qsgflickable_p.h')
-rw-r--r-- | src/declarative/items/qsgflickable_p.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/declarative/items/qsgflickable_p.h b/src/declarative/items/qsgflickable_p.h index d638b921c5..54581a5932 100644 --- a/src/declarative/items/qsgflickable_p.h +++ b/src/declarative/items/qsgflickable_p.h @@ -63,6 +63,14 @@ class Q_AUTOTEST_EXPORT QSGFlickable : public QSGItem Q_PROPERTY(qreal contentY READ contentY WRITE setContentY NOTIFY contentYChanged) Q_PROPERTY(QSGItem *contentItem READ contentItem CONSTANT) + Q_PROPERTY(qreal topMargin READ topMargin WRITE setTopMargin NOTIFY topMarginChanged) + Q_PROPERTY(qreal bottomMargin READ bottomMargin WRITE setBottomMargin NOTIFY bottomMarginChanged) + Q_PROPERTY(qreal yOrigin READ yOrigin NOTIFY yOriginChanged) + + Q_PROPERTY(qreal leftMargin READ leftMargin WRITE setLeftMargin NOTIFY leftMarginChanged) + Q_PROPERTY(qreal rightMargin READ rightMargin WRITE setRightMargin NOTIFY rightMarginChanged) + Q_PROPERTY(qreal xOrigin READ xOrigin NOTIFY xOriginChanged) + Q_PROPERTY(qreal horizontalVelocity READ horizontalVelocity NOTIFY horizontalVelocityChanged) Q_PROPERTY(qreal verticalVelocity READ verticalVelocity NOTIFY verticalVelocityChanged) @@ -122,6 +130,21 @@ public: qreal contentY() const; virtual void setContentY(qreal pos); + qreal topMargin() const; + void setTopMargin(qreal m); + + qreal bottomMargin() const; + void setBottomMargin(qreal m); + + qreal leftMargin() const; + void setLeftMargin(qreal m); + + qreal rightMargin() const; + void setRightMargin(qreal m); + + virtual qreal yOrigin() const; + virtual qreal xOrigin() const; + bool isMoving() const; bool isMovingHorizontally() const; bool isMovingVertically() const; @@ -169,6 +192,12 @@ Q_SIGNALS: void contentHeightChanged(); void contentXChanged(); void contentYChanged(); + void topMarginChanged(); + void bottomMarginChanged(); + void leftMarginChanged(); + void rightMarginChanged(); + void yOriginChanged(); + void xOriginChanged(); void movingChanged(); void movingHorizontallyChanged(); void movingVerticallyChanged(); @@ -219,6 +248,7 @@ protected: virtual qreal maxYExtent() const; qreal vWidth() const; qreal vHeight() const; + virtual void componentComplete(); virtual void viewportMoved(); virtual void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry); |