summaryrefslogtreecommitdiffstats
path: root/src/declarative/util
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-11-02 09:11:55 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-11-02 09:11:55 (GMT)
commit9e949e41c2751a0c27ac4bb6edae8e7cfc59851a (patch)
treea307dd40b6642425e005839fc209dd8b31618885 /src/declarative/util
parent8b4cbdbd3bfcdc98ca5f8e728b004596a1213127 (diff)
parent7f86f70e98e0b826ad35b8bb744305b5f4dbbfe8 (diff)
downloadQt-9e949e41c2751a0c27ac4bb6edae8e7cfc59851a.zip
Qt-9e949e41c2751a0c27ac4bb6edae8e7cfc59851a.tar.gz
Qt-9e949e41c2751a0c27ac4bb6edae8e7cfc59851a.tar.bz2
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'src/declarative/util')
-rw-r--r--src/declarative/util/qmllistmodel.cpp4
-rw-r--r--src/declarative/util/qmllistmodel_p.h5
-rw-r--r--src/declarative/util/qmlstate_p.h2
3 files changed, 8 insertions, 3 deletions
diff --git a/src/declarative/util/qmllistmodel.cpp b/src/declarative/util/qmllistmodel.cpp
index dba2203..17083db 100644
--- a/src/declarative/util/qmllistmodel.cpp
+++ b/src/declarative/util/qmllistmodel.cpp
@@ -457,6 +457,7 @@ void QmlListModel::remove(int index)
if (node)
delete node;
emit itemsRemoved(index,1);
+ emit countChanged(_root->values.count());
}
}
@@ -488,6 +489,7 @@ void QmlListModel::insert(int index, const QScriptValue& valuemap)
mn->setObjectValue(valuemap);
_root->values.insert(index,qVariantFromValue(mn));
emit itemsInserted(index,1);
+ emit countChanged(_root->values.count());
}
/*!
@@ -563,6 +565,7 @@ void QmlListModel::append(const QScriptValue& valuemap)
mn->setObjectValue(valuemap);
_root->values << qVariantFromValue(mn);
emit itemsInserted(count()-1,1);
+ emit countChanged(_root->values.count());
}
/*!
@@ -642,7 +645,6 @@ void QmlListModel::set(int index, const QString& property, const QVariant& value
emit itemsChanged(index,1,roles);
}
-
class QmlListModelParser : public QmlCustomParser
{
public:
diff --git a/src/declarative/util/qmllistmodel_p.h b/src/declarative/util/qmllistmodel_p.h
index 8676024..31365d1 100644
--- a/src/declarative/util/qmllistmodel_p.h
+++ b/src/declarative/util/qmllistmodel_p.h
@@ -62,7 +62,7 @@ struct ModelNode;
class QmlListModel : public QListModelInterface
{
Q_OBJECT
- Q_PROPERTY(int count READ count)
+ Q_PROPERTY(int count READ count NOTIFY countChanged)
public:
QmlListModel(QObject *parent=0);
@@ -81,6 +81,9 @@ public:
Q_INVOKABLE void set(int index, const QString& property, const QVariant& value);
Q_INVOKABLE void move(int from, int to, int count);
+Q_SIGNALS:
+ void countChanged(int);
+
private:
QVariant valueForNode(ModelNode *) const;
mutable QStringList roleStrings;
diff --git a/src/declarative/util/qmlstate_p.h b/src/declarative/util/qmlstate_p.h
index 92aef8c..ff42893 100644
--- a/src/declarative/util/qmlstate_p.h
+++ b/src/declarative/util/qmlstate_p.h
@@ -54,7 +54,7 @@ QT_MODULE(Declarative)
class ActionEvent;
class QmlBinding;
-class Action
+class Q_DECLARATIVE_EXPORT Action
{
public:
Action();