aboutsummaryrefslogtreecommitdiffstats
path: root/libpyside/dynamicqmetaobject.cpp
diff options
context:
space:
mode:
authorRenato Araujo Oliveira Filho <renato.filho@openbossa.org>2010-11-21 18:08:46 -0300
committerRenato Araujo Oliveira Filho <renato.filho@openbossa.org>2010-11-22 10:43:01 -0300
commite12197e2822a8cca0022d0843057548246930c16 (patch)
treed20410a30e1f82b9ff5976bff1a6ef685d84eb1b /libpyside/dynamicqmetaobject.cpp
parent3bc0d023c848be0d8e7e7337a92980647e11804a (diff)
Fix generated property flags on metaobject.
Fixes bug #478 Reviewer: Luciano Wolf <luciano.wolf@openbossa.org> Marcelo Lira <marcelo.lira@openbossa.org>
Diffstat (limited to 'libpyside/dynamicqmetaobject.cpp')
-rw-r--r--libpyside/dynamicqmetaobject.cpp47
1 files changed, 24 insertions, 23 deletions
diff --git a/libpyside/dynamicqmetaobject.cpp b/libpyside/dynamicqmetaobject.cpp
index 14fbe864e..43aeae66d 100644
--- a/libpyside/dynamicqmetaobject.cpp
+++ b/libpyside/dynamicqmetaobject.cpp
@@ -132,7 +132,6 @@ static bool isQRealType(const char *type)
}
-
/*
* Avoid API break keep this on cpp
*/
@@ -164,25 +163,31 @@ uint PropertyData::flags() const
if (PySide::Property::hasReset(m_data))
flags |= Resettable;
- if (!PySide::Property::isDesignable(m_data))
- flags |= ResolveDesignable;
- else
+ if (PySide::Property::isDesignable(m_data))
flags |= Designable;
-
- if (!PySide::Property::isScriptable(m_data))
- flags |= ResolveScriptable;
else
- flags |= Scriptable;
+ flags |= ResolveDesignable;
- if (!PySide::Property::isStored(m_data))
- flags |= ResolveStored;
+ if (PySide::Property::isScriptable(m_data))
+ flags |= Scriptable;
else
- flags |= Stored;
+ flags |= ResolveScriptable;
- if (!PySide::Property::isUser(m_data))
- flags |= ResolveUser;
+ if (PySide::Property::isStored(m_data))
+ flags |= Stored;
else
+ flags |= ResolveStored;
+
+ //EDITABLE
+ flags |= ResolveEditable;
+
+ if (PySide::Property::isUser(m_data))
flags |= User;
+ else
+ flags |= ResolveUser;
+
+ if (m_notifyId != -1)
+ flags |= Notify;
if (PySide::Property::isConstant(m_data))
flags |= Constant;
@@ -190,9 +195,6 @@ uint PropertyData::flags() const
if (PySide::Property::isFinal(m_data))
flags |= Final;
- if (m_notifyId)
- flags |= Notify;
-
return flags;
}
@@ -247,7 +249,7 @@ PropertyData::PropertyData()
{
}
-PropertyData::PropertyData(const char* name, uint notifyId, PySideProperty* data)
+PropertyData::PropertyData(const char* name, int notifyId, PySideProperty* data)
: m_name(name), m_notifyId(notifyId), m_data(data)
{
}
@@ -268,7 +270,7 @@ QByteArray PropertyData::name() const
return m_name;
}
-uint PropertyData::notifyId() const
+int PropertyData::notifyId() const
{
return m_notifyId;
}
@@ -370,10 +372,10 @@ void DynamicQMetaObject::addProperty(const char* propertyName, PyObject* data)
// retrieve notifyId
PySideProperty* property = reinterpret_cast<PySideProperty*>(data);
const char* signalNotify = PySide::Property::getNotifyName(property);
- uint notifyId = 0;
+ int notifyId = -1;
if (signalNotify) {
QByteArray signalSignature(signalNotify);
- notifyId = m_d->m_signals.indexOf(signalNotify) + 1;
+ notifyId = m_d->m_signals.indexOf(signalNotify);
}
//search for a empty space
@@ -553,9 +555,8 @@ void DynamicQMetaObject::DynamicQMetaObjectPrivate::updateMetaObject(QMetaObject
}
//write properties notify
- foreach(PropertyData pp, m_properties) {
- data[index++] = pp.notifyId(); //signal notify index
- }
+ foreach(PropertyData pp, m_properties)
+ data[index++] = pp.notifyId() >= 0 ? pp.notifyId() : 0; //signal notify index
data[index++] = 0; // the end