Make state a public property of QSGItem.
authorMichael Brasser <michael.brasser@nokia.com>
Fri, 9 Sep 2011 04:03:31 +0000 (14:03 +1000)
committerQt by Nokia <qt-info@nokia.com>
Sun, 11 Sep 2011 23:41:58 +0000 (01:41 +0200)
The property type is QString, so doesn't need to be private.

Change-Id: If1d1a740be451331e8142fbe1d89fda2eeff4509
Reviewed-on: http://codereview.qt-project.org/4499
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Charles Yin <charles.yin@nokia.com>

src/declarative/items/qsgitem.cpp
src/declarative/items/qsgitem.h

index fd1cf66..009e8cb 100644 (file)
@@ -3181,6 +3181,18 @@ void QSGItemPrivate::setState(const QString &state)
     _states()->setState(state);
 }
 
+QString QSGItem::state() const
+{
+    Q_D(const QSGItem);
+    return d->state();
+}
+
+void QSGItem::setState(const QString &state)
+{
+    Q_D(QSGItem);
+    d->setState(state);
+}
+
 QDeclarativeListProperty<QSGTransform> QSGItem::transform()
 {
     Q_D(QSGItem);
index 9a540d7..3cbb7c2 100644 (file)
@@ -118,7 +118,7 @@ class Q_DECLARATIVE_EXPORT QSGItem : public QObject, public QDeclarativeParserSt
 
     Q_PRIVATE_PROPERTY(QSGItem::d_func(), QDeclarativeListProperty<QDeclarativeState> states READ states DESIGNABLE false)
     Q_PRIVATE_PROPERTY(QSGItem::d_func(), QDeclarativeListProperty<QDeclarativeTransition> transitions READ transitions DESIGNABLE false)
-    Q_PRIVATE_PROPERTY(QSGItem::d_func(), QString state READ state WRITE setState NOTIFY stateChanged)
+    Q_PROPERTY(QString state READ state WRITE setState NOTIFY stateChanged)
     Q_PROPERTY(QRectF childrenRect READ childrenRect NOTIFY childrenRectChanged DESIGNABLE false FINAL)
     Q_PRIVATE_PROPERTY(QSGItem::d_func(), QSGAnchors * anchors READ anchors DESIGNABLE false CONSTANT FINAL)
     Q_PRIVATE_PROPERTY(QSGItem::d_func(), QSGAnchorLine left READ left CONSTANT FINAL)
@@ -204,6 +204,9 @@ public:
     bool clip() const;
     void setClip(bool);
 
+    QString state() const;
+    void setState(const QString &);
+
     qreal baselineOffset() const;
     void setBaselineOffset(qreal);