summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2009-09-16 23:48:08 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2009-09-16 23:48:08 (GMT)
commitfc3e138a26f9add4def111e8f6305f1aa674fa05 (patch)
tree6faadb7dfed65556470710cf5759d1434d8fc578
parentd5b554a7dc9204e65b1bfc3408d2d126d5ec2981 (diff)
downloadQt-fc3e138a26f9add4def111e8f6305f1aa674fa05.zip
Qt-fc3e138a26f9add4def111e8f6305f1aa674fa05.tar.gz
Qt-fc3e138a26f9add4def111e8f6305f1aa674fa05.tar.bz2
Experiment with reset functions for width and height.
-rw-r--r--src/declarative/fx/qfxitem.cpp14
-rw-r--r--src/declarative/fx/qfxitem.h6
2 files changed, 18 insertions, 2 deletions
diff --git a/src/declarative/fx/qfxitem.cpp b/src/declarative/fx/qfxitem.cpp
index c7e807c..dd51aa6 100644
--- a/src/declarative/fx/qfxitem.cpp
+++ b/src/declarative/fx/qfxitem.cpp
@@ -2688,6 +2688,13 @@ void QFxItem::setWidth(qreal w)
QRectF(x(), y(), oldWidth, height()));
}
+void QFxItem::resetWidth()
+{
+ Q_D(QFxItem);
+ d->widthValid = false;
+ setImplicitWidth(implicitWidth());
+}
+
qreal QFxItem::implicitWidth() const
{
Q_D(const QFxItem);
@@ -2740,6 +2747,13 @@ void QFxItem::setHeight(qreal h)
QRectF(x(), y(), width(), oldHeight));
}
+void QFxItem::resetHeight()
+{
+ Q_D(QFxItem);
+ d->heightValid = false;
+ setImplicitHeight(implicitHeight());
+}
+
qreal QFxItem::implicitHeight() const
{
Q_D(const QFxItem);
diff --git a/src/declarative/fx/qfxitem.h b/src/declarative/fx/qfxitem.h
index 9d2113f..b309cb3 100644
--- a/src/declarative/fx/qfxitem.h
+++ b/src/declarative/fx/qfxitem.h
@@ -75,8 +75,8 @@ class Q_DECLARATIVE_EXPORT QFxItem : public QGraphicsObject, public QmlParserSta
Q_PROPERTY(QmlList<QmlState *>* states READ states DESIGNABLE false)
Q_PROPERTY(QmlList<QmlTransition *>* transitions READ transitions DESIGNABLE false)
Q_PROPERTY(QString state READ state WRITE setState NOTIFY stateChanged)
- Q_PROPERTY(qreal width READ width WRITE setWidth NOTIFY widthChanged FINAL)
- Q_PROPERTY(qreal height READ height WRITE setHeight NOTIFY heightChanged FINAL)
+ Q_PROPERTY(qreal width READ width WRITE setWidth NOTIFY widthChanged RESET resetWidth FINAL)
+ Q_PROPERTY(qreal height READ height WRITE setHeight NOTIFY heightChanged RESET resetHeight FINAL)
Q_PROPERTY(QRectF childrenRect READ childrenRect NOTIFY childrenRectChanged DESIGNABLE false FINAL)
Q_PROPERTY(QFxAnchors * anchors READ anchors DESIGNABLE false CONSTANT FINAL)
Q_PROPERTY(QFxAnchorLine left READ left CONSTANT FINAL)
@@ -134,10 +134,12 @@ public:
qreal width() const;
void setWidth(qreal);
+ void resetWidth();
qreal implicitWidth() const;
qreal height() const;
void setHeight(qreal);
+ void resetHeight();
qreal implicitHeight() const;
TransformOrigin transformOrigin() const;