summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
authorBea Lam <bea.lam@nokia.com>2010-02-25 05:50:34 (GMT)
committerBea Lam <bea.lam@nokia.com>2010-02-25 05:50:34 (GMT)
commit4c5292a36360821a3ba4a7bc4532688dff7b7ae9 (patch)
tree969d79e3860c1709d307479320ab0a648639aa48 /src/declarative
parent410dd39d7294cd0c9e46e01f839c137482d9fc5d (diff)
parentd022acd47350f61d3959b076d7bc92df86015b16 (diff)
downloadQt-4c5292a36360821a3ba4a7bc4532688dff7b7ae9.zip
Qt-4c5292a36360821a3ba4a7bc4532688dff7b7ae9.tar.gz
Qt-4c5292a36360821a3ba4a7bc4532688dff7b7ae9.tar.bz2
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-qml
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/qml/qdeclarativebinding.cpp2
-rw-r--r--src/declarative/qml/qdeclarativemetaproperty.cpp22
-rw-r--r--src/declarative/qml/qdeclarativemetaproperty.h30
-rw-r--r--src/declarative/qml/qdeclarativemetaproperty_p.h2
4 files changed, 27 insertions, 29 deletions
diff --git a/src/declarative/qml/qdeclarativebinding.cpp b/src/declarative/qml/qdeclarativebinding.cpp
index 5ac5701..bde01ae 100644
--- a/src/declarative/qml/qdeclarativebinding.cpp
+++ b/src/declarative/qml/qdeclarativebinding.cpp
@@ -128,7 +128,7 @@ void QDeclarativeBinding::update(QDeclarativeMetaProperty::WriteFlags flags)
if (!data->updating) {
data->updating = true;
- if (data->property.propertyCategory() == QDeclarativeMetaProperty::Bindable) {
+ if (data->property.propertyType() == qMetaTypeId<QDeclarativeBinding *>()) {
int idx = data->property.coreIndex();
Q_ASSERT(idx != -1);
diff --git a/src/declarative/qml/qdeclarativemetaproperty.cpp b/src/declarative/qml/qdeclarativemetaproperty.cpp
index 8fc3b56..00f37b9 100644
--- a/src/declarative/qml/qdeclarativemetaproperty.cpp
+++ b/src/declarative/qml/qdeclarativemetaproperty.cpp
@@ -264,13 +264,11 @@ QDeclarativeMetaProperty::QDeclarativeMetaProperty(const QDeclarativeMetaPropert
}
/*!
- \enum QDeclarativeMetaProperty::PropertyCategory
+ \enum QDeclarativeMetaProperty::PropertyTypeCategory
This enum specifies a category of QML property.
- \value Unknown The category is unknown. This will never be returned from propertyCategory()
- \value InvalidProperty The property is invalid.
- \value Bindable The property is a QDeclarativeBinding.
+ \value InvalidCategory The property is invalid.
\value List The property is a QList pointer
\value Object The property is a QObject derived type pointer
\value Normal The property is none of the above.
@@ -290,13 +288,13 @@ QDeclarativeMetaProperty::QDeclarativeMetaProperty(const QDeclarativeMetaPropert
/*!
Returns the property category.
*/
-QDeclarativeMetaProperty::PropertyCategory QDeclarativeMetaProperty::propertyCategory() const
+QDeclarativeMetaProperty::PropertyTypeCategory QDeclarativeMetaProperty::propertyTypeCategory() const
{
- return d->propertyCategory();
+ return d->propertyTypeCategory();
}
-QDeclarativeMetaProperty::PropertyCategory
-QDeclarativeMetaPropertyPrivate::propertyCategory() const
+QDeclarativeMetaProperty::PropertyTypeCategory
+QDeclarativeMetaPropertyPrivate::propertyTypeCategory() const
{
uint type = q->type();
@@ -305,11 +303,9 @@ QDeclarativeMetaPropertyPrivate::propertyCategory() const
} else if (type & QDeclarativeMetaProperty::Property) {
int type = propertyType();
if (type == QVariant::Invalid)
- return QDeclarativeMetaProperty::InvalidProperty;
+ return QDeclarativeMetaProperty::InvalidCategory;
else if ((uint)type < QVariant::UserType)
return QDeclarativeMetaProperty::Normal;
- else if (type == qMetaTypeId<QDeclarativeBinding *>())
- return QDeclarativeMetaProperty::Bindable;
else if (core.flags & QDeclarativePropertyCache::Data::IsQObjectDerived)
return QDeclarativeMetaProperty::Object;
else if (core.flags & QDeclarativePropertyCache::Data::IsQList)
@@ -317,7 +313,7 @@ QDeclarativeMetaPropertyPrivate::propertyCategory() const
else
return QDeclarativeMetaProperty::Normal;
} else {
- return QDeclarativeMetaProperty::InvalidProperty;
+ return QDeclarativeMetaProperty::InvalidCategory;
}
}
@@ -446,7 +442,7 @@ QDeclarativeMetaProperty &QDeclarativeMetaProperty::operator=(const QDeclarative
*/
bool QDeclarativeMetaProperty::isWritable() const
{
- QDeclarativeMetaProperty::PropertyCategory category = propertyCategory();
+ QDeclarativeMetaProperty::PropertyTypeCategory category = propertyTypeCategory();
if (!d->object)
return false;
diff --git a/src/declarative/qml/qdeclarativemetaproperty.h b/src/declarative/qml/qdeclarativemetaproperty.h
index dce0b4f..900d1cd 100644
--- a/src/declarative/qml/qdeclarativemetaproperty.h
+++ b/src/declarative/qml/qdeclarativemetaproperty.h
@@ -63,22 +63,31 @@ class QDeclarativeMetaPropertyPrivate;
class Q_DECLARATIVE_EXPORT QDeclarativeMetaProperty
{
public:
- enum PropertyCategory {
- Unknown,
- InvalidProperty,
- Bindable,
+ enum PropertyTypeCategory {
+ InvalidCategory,
List,
Object,
Normal
};
+
+ enum Type { Invalid = 0x00,
+ Property = 0x01,
+ SignalProperty = 0x02,
+ Default = 0x08,
+ ValueTypeProperty = 0x10
+ };
+
QDeclarativeMetaProperty();
+ ~QDeclarativeMetaProperty();
+
QDeclarativeMetaProperty(QObject *);
- QDeclarativeMetaProperty(QObject *, const QString &);
QDeclarativeMetaProperty(QObject *, QDeclarativeContext *);
+
+ QDeclarativeMetaProperty(QObject *, const QString &);
QDeclarativeMetaProperty(QObject *, const QString &, QDeclarativeContext *);
+
QDeclarativeMetaProperty(const QDeclarativeMetaProperty &);
QDeclarativeMetaProperty &operator=(const QDeclarativeMetaProperty &);
- ~QDeclarativeMetaProperty();
QString name() const;
@@ -96,12 +105,6 @@ public:
QMetaMethod method() const;
- enum Type { Invalid = 0x00,
- Property = 0x01,
- SignalProperty = 0x02,
- Default = 0x08,
- ValueTypeProperty = 0x10 };
-
Type type() const;
bool isProperty() const;
bool isDefault() const;
@@ -111,9 +114,8 @@ public:
bool isValid() const;
QObject *object() const;
- PropertyCategory propertyCategory() const;
-
int propertyType() const;
+ PropertyTypeCategory propertyTypeCategory() const;
const char *propertyTypeName() const;
bool operator==(const QDeclarativeMetaProperty &) const;
diff --git a/src/declarative/qml/qdeclarativemetaproperty_p.h b/src/declarative/qml/qdeclarativemetaproperty_p.h
index 5ebd2c5..937cfd7 100644
--- a/src/declarative/qml/qdeclarativemetaproperty_p.h
+++ b/src/declarative/qml/qdeclarativemetaproperty_p.h
@@ -95,7 +95,7 @@ public:
QMetaMethod findSignal(QObject *, const QString &);
int propertyType() const;
- QDeclarativeMetaProperty::PropertyCategory propertyCategory() const;
+ QDeclarativeMetaProperty::PropertyTypeCategory propertyTypeCategory() const;
QVariant readValueProperty();
bool writeValueProperty(const QVariant &, QDeclarativeMetaProperty::WriteFlags);