diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2009-05-11 05:53:34 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2009-05-11 05:53:34 (GMT) |
commit | 692931ae2fec4fa8fc4ebcbcff20c952d6319536 (patch) | |
tree | f962585a77c22a6cd77465a52b7dbc66aa0bdca8 /src/declarative/fx/qfxanchors.h | |
parent | 447b79e7c497c93429c25d883dfac954868483a2 (diff) | |
download | Qt-692931ae2fec4fa8fc4ebcbcff20c952d6319536.zip Qt-692931ae2fec4fa8fc4ebcbcff20c952d6319536.tar.gz Qt-692931ae2fec4fa8fc4ebcbcff20c952d6319536.tar.bz2 |
Add support for removing anchors.
This makes it possible to remove an anchor that was previously set.
Trying to set a new anchor after one was removed isn't working yet.
Diffstat (limited to 'src/declarative/fx/qfxanchors.h')
-rw-r--r-- | src/declarative/fx/qfxanchors.h | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/src/declarative/fx/qfxanchors.h b/src/declarative/fx/qfxanchors.h index 3a250b9..5a8cc1a 100644 --- a/src/declarative/fx/qfxanchors.h +++ b/src/declarative/fx/qfxanchors.h @@ -84,12 +84,12 @@ class Q_DECLARATIVE_EXPORT QFxAnchors : public QObject { Q_OBJECT - Q_PROPERTY(QFxAnchorLine left READ left WRITE setLeft); - Q_PROPERTY(QFxAnchorLine right READ right WRITE setRight); - Q_PROPERTY(QFxAnchorLine horizontalCenter READ horizontalCenter WRITE setHorizontalCenter); - Q_PROPERTY(QFxAnchorLine top READ top WRITE setTop); - Q_PROPERTY(QFxAnchorLine bottom READ bottom WRITE setBottom); - Q_PROPERTY(QFxAnchorLine verticalCenter READ verticalCenter WRITE setVerticalCenter); + Q_PROPERTY(QFxAnchorLine left READ left WRITE setLeft RESET resetLeft); + Q_PROPERTY(QFxAnchorLine right READ right WRITE setRight RESET resetRight); + Q_PROPERTY(QFxAnchorLine horizontalCenter READ horizontalCenter WRITE setHorizontalCenter RESET resetHorizontalCenter); + Q_PROPERTY(QFxAnchorLine top READ top WRITE setTop RESET resetTop); + Q_PROPERTY(QFxAnchorLine bottom READ bottom WRITE setBottom RESET resetBottom); + Q_PROPERTY(QFxAnchorLine verticalCenter READ verticalCenter WRITE setVerticalCenter RESET resetVerticalCenter); Q_PROPERTY(int leftMargin READ leftMargin WRITE setLeftMargin NOTIFY leftMarginChanged); Q_PROPERTY(int rightMargin READ rightMargin WRITE setRightMargin NOTIFY rightMarginChanged); Q_PROPERTY(int horizontalCenterOffset READ horizontalCenterOffset WRITE setHorizontalCenterOffset NOTIFY horizontalCenterOffsetChanged()); @@ -109,27 +109,35 @@ public: HasBottomAnchor = 0x08, HasHCenterAnchor = 0x10, HasVCenterAnchor = 0x20, - HasBaselineAnchor = 0x40 + HasBaselineAnchor = 0x40, + Horizontal_Mask = HasLeftAnchor | HasRightAnchor | HasHCenterAnchor, + Vertical_Mask = HasTopAnchor | HasBottomAnchor | HasVCenterAnchor | HasBaselineAnchor }; Q_DECLARE_FLAGS(UsedAnchors, UsedAnchor); QFxAnchorLine left() const; void setLeft(const QFxAnchorLine &edge); + Q_INVOKABLE void resetLeft(); //### temporarily invokable for testing QFxAnchorLine right() const; void setRight(const QFxAnchorLine &edge); + void resetRight(); QFxAnchorLine horizontalCenter() const; void setHorizontalCenter(const QFxAnchorLine &edge); + void resetHorizontalCenter(); QFxAnchorLine top() const; void setTop(const QFxAnchorLine &edge); + void resetTop(); QFxAnchorLine bottom() const; void setBottom(const QFxAnchorLine &edge); + void resetBottom(); QFxAnchorLine verticalCenter() const; void setVerticalCenter(const QFxAnchorLine &edge); + void resetVerticalCenter(); int leftMargin() const; void setLeftMargin(int); @@ -172,12 +180,8 @@ Q_SIGNALS: private Q_SLOTS: void fillChanged(); - void updateLeftAnchor(); - void updateRightAnchor(); - void updateHCenterAnchor(); - void updateTopAnchor(); - void updateBottomAnchor(); - void updateVCenterAnchor(); + void updateHorizontalAnchors(); + void updateVerticalAnchors(); private: //### should item be a friend? (and make some of the public methods private or protected) |