From 6e111b951930c892d86ae914706d16a11231a546 Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Mon, 31 Aug 2009 13:18:44 +1000 Subject: AnchorChanges doc --- examples/declarative/anchors/anchor-changes.qml | 8 ++++++-- src/declarative/util/qmlstateoperations.cpp | 19 ++++++++++++++++++- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/examples/declarative/anchors/anchor-changes.qml b/examples/declarative/anchors/anchor-changes.qml index 37a33ff..8996439 100644 --- a/examples/declarative/anchors/anchor-changes.qml +++ b/examples/declarative/anchors/anchor-changes.qml @@ -26,14 +26,18 @@ Item { } MouseRegion { - anchors.fill: parent + anchors.fill: Content onPressed: Window.state = "FullScreen" onReleased: Window.state = "" } states : State { name: "FullScreen" - AnchorChanges { target: Content; top: Window.top; bottom: Window.bottom } + //! [0] + AnchorChanges { + target: Content; top: Window.top; bottom: Window.bottom + } + //! [0] } transitions : Transition { diff --git a/src/declarative/util/qmlstateoperations.cpp b/src/declarative/util/qmlstateoperations.cpp index b17b80b..85ad1b5 100644 --- a/src/declarative/util/qmlstateoperations.cpp +++ b/src/declarative/util/qmlstateoperations.cpp @@ -285,7 +285,11 @@ QmlStateChangeScript::ActionList QmlStateChangeScript::actions() /*! \qmlclass AnchorChanges - \brief The AnchorChanges element allows you to change anchors in a state. + \brief The AnchorChanges element allows you to change the anchors of an item in a state. + + \snippet examples/declarative/anchors/anchor-changes.qml 0 + + For more information on anchors see \l {anchor-layout}{Anchor Layouts}. */ QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,AnchorChanges,QmlAnchorChanges) @@ -313,6 +317,11 @@ public: qreal origHeight; }; +/*! + \qmlproperty Object AnchorChanges::target + This property holds the object that the anchors to change belong to +*/ + QmlAnchorChanges::QmlAnchorChanges(QObject *parent) : QmlStateOperation(*(new QmlAnchorChangesPrivate), parent) { @@ -354,6 +363,14 @@ void QmlAnchorChanges::setReset(const QString &reset) d->resetList = d->resetString.split(QLatin1Char(',')); } +/*! + \qmlproperty AnchorLine AnchorChanges::top + \qmlproperty AnchorLine AnchorChanges::bottom + \qmlproperty AnchorLine AnchorChanges::left + \qmlproperty AnchorLine AnchorChanges::right + These properties change the \e left, \e top, \e right and \e bottom anchors of the item +*/ + QFxAnchorLine QmlAnchorChanges::left() const { Q_D(const QmlAnchorChanges); -- cgit v0.12