Changed name of qproperty functions

This commit is contained in:
Hugo Parente Lima 2010-10-06 15:28:20 -03:00
commit 9257cd1783
5 changed files with 43 additions and 43 deletions

View file

@ -159,39 +159,39 @@ uint PropertyData::flags() const
else if (!isQRealType(typeName)) else if (!isQRealType(typeName))
flags |= qvariant_nameToType(typeName) << 24; flags |= qvariant_nameToType(typeName) << 24;
if (qproperty_is_readble(m_data)) if (qpropertyIsReadable(m_data))
flags |= Readable; flags |= Readable;
if (qproperty_is_writable(m_data)) if (qpropertyIsWritable(m_data))
flags |= Writable; flags |= Writable;
if (qproperty_has_reset(m_data)) if (qpropertyHasReset(m_data))
flags |= Resettable; flags |= Resettable;
if (!qproperty_is_designable(m_data)) if (!qpropertyIsDesignable(m_data))
flags |= ResolveDesignable; flags |= ResolveDesignable;
else else
flags |= Designable; flags |= Designable;
if (!qproperty_is_scriptable(m_data)) if (!qpropertyIsScriptable(m_data))
flags |= ResolveScriptable; flags |= ResolveScriptable;
else else
flags |= Scriptable; flags |= Scriptable;
if (!qproperty_is_stored(m_data)) if (!qpropertyIsStored(m_data))
flags |= ResolveStored; flags |= ResolveStored;
else else
flags |= Stored; flags |= Stored;
if (!qproperty_is_user(m_data)) if (!qpropertyIsUser(m_data))
flags |= ResolveUser; flags |= ResolveUser;
else else
flags |= User; flags |= User;
if (qproperty_is_constant(m_data)) if (qpropertyIsConstant(m_data))
flags |= Constant; flags |= Constant;
if (qproperty_is_final(m_data)) if (qpropertyIsFinal(m_data))
flags |= Final; flags |= Final;
return flags; return flags;
@ -255,7 +255,7 @@ PropertyData::PropertyData(const char* name, PyObject* data)
QByteArray PropertyData::type() const QByteArray PropertyData::type() const
{ {
return QByteArray(qproperty_get_type(m_data)); return QByteArray(qpropertyGetType(m_data));
} }

View file

@ -69,7 +69,7 @@ bool fillQtProperties(PyObject* qObj, const QMetaObject* metaObj, PyObject* kwds
} else { } else {
PyObject* attr = PyObject_GenericGetAttr(qObj, key); PyObject* attr = PyObject_GenericGetAttr(qObj, key);
if (isQPropertyType(attr)) if (isQPropertyType(attr))
PySide::qproperty_set(attr, qObj, value); PySide::qpropertySet(attr, qObj, value);
} }
} else { } else {
propName.append("()"); propName.append("()");

View file

@ -164,7 +164,7 @@ bool isQPropertyType(PyObject* pyObj)
return false; return false;
} }
int qproperty_set(PyObject* self, PyObject* source, PyObject* value) int qpropertySet(PyObject* self, PyObject* source, PyObject* value)
{ {
QPropertyData *data = reinterpret_cast<QPropertyData*>(self); QPropertyData *data = reinterpret_cast<QPropertyData*>(self);
if (data->fset) { if (data->fset) {
@ -181,7 +181,7 @@ int qproperty_set(PyObject* self, PyObject* source, PyObject* value)
return -1; return -1;
} }
PyObject* qproperty_get(PyObject* self, PyObject* source) PyObject* qpropertyGet(PyObject* self, PyObject* source)
{ {
QPropertyData *data = reinterpret_cast<QPropertyData*>(self); QPropertyData *data = reinterpret_cast<QPropertyData*>(self);
if (data->fget) { if (data->fget) {
@ -193,7 +193,7 @@ PyObject* qproperty_get(PyObject* self, PyObject* source)
return 0; return 0;
} }
int qproperty_reset(PyObject* self, PyObject* source) int qpropertyReset(PyObject* self, PyObject* source)
{ {
QPropertyData *data = reinterpret_cast<QPropertyData*>(self); QPropertyData *data = reinterpret_cast<QPropertyData*>(self);
if (data->freset) { if (data->freset) {
@ -207,13 +207,13 @@ int qproperty_reset(PyObject* self, PyObject* source)
} }
const char* qproperty_get_type(PyObject* self) const char* qpropertyGetType(PyObject* self)
{ {
QPropertyData *data = reinterpret_cast<QPropertyData*>(self); QPropertyData *data = reinterpret_cast<QPropertyData*>(self);
return data->typeName; return data->typeName;
} }
PyObject* qproperty_get_object(PyObject* source, PyObject* name) PyObject* qpropertyGetObject(PyObject* source, PyObject* name)
{ {
PyObject* attr = PyObject_GenericGetAttr(source, name); PyObject* attr = PyObject_GenericGetAttr(source, name);
if (attr && isQPropertyType(attr)) if (attr && isQPropertyType(attr))
@ -249,55 +249,55 @@ char* translate_type_name(PyObject* type)
return 0; return 0;
} }
bool qproperty_is_readble(PyObject* self) bool qpropertyIsReadable(PyObject* self)
{ {
QPropertyData *data = reinterpret_cast<QPropertyData*>(self); QPropertyData *data = reinterpret_cast<QPropertyData*>(self);
return (data->fget != 0); return (data->fget != 0);
} }
bool qproperty_is_writable(PyObject* self) bool qpropertyIsWritable(PyObject* self)
{ {
QPropertyData *data = reinterpret_cast<QPropertyData*>(self); QPropertyData *data = reinterpret_cast<QPropertyData*>(self);
return (data->fset != 0); return (data->fset != 0);
} }
bool qproperty_has_reset(PyObject* self) bool qpropertyHasReset(PyObject* self)
{ {
QPropertyData *data = reinterpret_cast<QPropertyData*>(self); QPropertyData *data = reinterpret_cast<QPropertyData*>(self);
return (data->freset != 0); return (data->freset != 0);
} }
bool qproperty_is_designable(PyObject* self) bool qpropertyIsDesignable(PyObject* self)
{ {
QPropertyData *data = reinterpret_cast<QPropertyData*>(self); QPropertyData *data = reinterpret_cast<QPropertyData*>(self);
return data->designable; return data->designable;
} }
bool qproperty_is_scriptable(PyObject* self) bool qpropertyIsScriptable(PyObject* self)
{ {
QPropertyData *data = reinterpret_cast<QPropertyData*>(self); QPropertyData *data = reinterpret_cast<QPropertyData*>(self);
return data->scriptable; return data->scriptable;
} }
bool qproperty_is_stored(PyObject* self) bool qpropertyIsStored(PyObject* self)
{ {
QPropertyData *data = reinterpret_cast<QPropertyData*>(self); QPropertyData *data = reinterpret_cast<QPropertyData*>(self);
return data->stored; return data->stored;
} }
bool qproperty_is_user(PyObject* self) bool qpropertyIsUser(PyObject* self)
{ {
QPropertyData *data = reinterpret_cast<QPropertyData*>(self); QPropertyData *data = reinterpret_cast<QPropertyData*>(self);
return data->user; return data->user;
} }
bool qproperty_is_constant(PyObject* self) bool qpropertyIsConstant(PyObject* self)
{ {
QPropertyData *data = reinterpret_cast<QPropertyData*>(self); QPropertyData *data = reinterpret_cast<QPropertyData*>(self);
return data->constant; return data->constant;
} }
bool qproperty_is_final(PyObject* self) bool qpropertyIsFinal(PyObject* self)
{ {
QPropertyData *data = reinterpret_cast<QPropertyData*>(self); QPropertyData *data = reinterpret_cast<QPropertyData*>(self);
return data->final; return data->final;

View file

@ -46,7 +46,7 @@ PYSIDE_API bool isQPropertyType(PyObject* pyObj);
* @param value The value to set in property * @param value The value to set in property
* @return Return 0 if ok or -1 if this function fail * @return Return 0 if ok or -1 if this function fail
**/ **/
PYSIDE_API int qproperty_set(PyObject* self, PyObject* source, PyObject* value); PYSIDE_API int qpropertySet(PyObject* self, PyObject* source, PyObject* value);
/** /**
* This function call get property function * This function call get property function
@ -56,7 +56,7 @@ PYSIDE_API int qproperty_set(PyObject* self, PyObject* source, PyObject* value);
* @param source The QObject witch has the property * @param source The QObject witch has the property
* @return Return the result of property get function or 0 if this fail * @return Return the result of property get function or 0 if this fail
**/ **/
PYSIDE_API PyObject* qproperty_get(PyObject* self, PyObject* source); PYSIDE_API PyObject* qpropertyGet(PyObject* self, PyObject* source);
/** /**
* This function call reset property function * This function call reset property function
@ -66,7 +66,7 @@ PYSIDE_API PyObject* qproperty_get(PyObject* self, PyObject* source);
* @param source The QObject witch has the property * @param source The QObject witch has the property
* @return Return 0 if ok or -1 if this function fail * @return Return 0 if ok or -1 if this function fail
**/ **/
PYSIDE_API int qproperty_reset(PyObject* self, PyObject* source); PYSIDE_API int qpropertyReset(PyObject* self, PyObject* source);
/** /**
@ -76,7 +76,7 @@ PYSIDE_API int qproperty_reset(PyObject* self, PyObject* source);
* @param self The property object * @param self The property object
* @return Return the property type name * @return Return the property type name
**/ **/
PYSIDE_API const char* qproperty_get_type(PyObject* self); PYSIDE_API const char* qpropertyGetType(PyObject* self);
/** /**
* This function search in the source object for desired property * This function search in the source object for desired property
@ -85,7 +85,7 @@ PYSIDE_API const char* qproperty_get_type(PyObject* self);
* @param name The property name * @param name The property name
* @return Return a new reference to property object * @return Return a new reference to property object
**/ **/
PYSIDE_API PyObject* qproperty_get_object(PyObject* source, PyObject* name); PYSIDE_API PyObject* qpropertyGetObject(PyObject* source, PyObject* name);
/** /**
@ -95,7 +95,7 @@ PYSIDE_API PyObject* qproperty_get_object(PyObject* source, PyObject* name);
* @param self The property object * @param self The property object
* @return Return a boolean value * @return Return a boolean value
**/ **/
PYSIDE_API bool qproperty_is_readble(PyObject* self); PYSIDE_API bool qpropertyIsReadable(PyObject* self);
/** /**
* This function check if property has write function * This function check if property has write function
@ -104,7 +104,7 @@ PYSIDE_API bool qproperty_is_readble(PyObject* self);
* @param self The property object * @param self The property object
* @return Return a boolean value * @return Return a boolean value
**/ **/
PYSIDE_API bool qproperty_is_writable(PyObject* self); PYSIDE_API bool qpropertyIsWritable(PyObject* self);
/** /**
* This function check if property has reset function * This function check if property has reset function
@ -113,7 +113,7 @@ PYSIDE_API bool qproperty_is_writable(PyObject* self);
* @param self The property object * @param self The property object
* @return Return a boolean value * @return Return a boolean value
**/ **/
PYSIDE_API bool qproperty_has_reset(PyObject* self); PYSIDE_API bool qpropertyHasReset(PyObject* self);
/** /**
* This function check if property has the flag DESIGNABLE setted * This function check if property has the flag DESIGNABLE setted
@ -122,7 +122,7 @@ PYSIDE_API bool qproperty_has_reset(PyObject* self);
* @param self The property object * @param self The property object
* @return Return a boolean value * @return Return a boolean value
**/ **/
PYSIDE_API bool qproperty_is_designable(PyObject* self); PYSIDE_API bool qpropertyIsDesignable(PyObject* self);
/** /**
* This function check if property has the flag SCRIPTABLE setted * This function check if property has the flag SCRIPTABLE setted
@ -131,7 +131,7 @@ PYSIDE_API bool qproperty_is_designable(PyObject* self);
* @param self The property object * @param self The property object
* @return Return a boolean value * @return Return a boolean value
**/ **/
PYSIDE_API bool qproperty_is_scriptable(PyObject* self); PYSIDE_API bool qpropertyIsScriptable(PyObject* self);
/** /**
* This function check if property has the flag STORED setted * This function check if property has the flag STORED setted
@ -140,7 +140,7 @@ PYSIDE_API bool qproperty_is_scriptable(PyObject* self);
* @param self The property object * @param self The property object
* @return Return a boolean value * @return Return a boolean value
**/ **/
PYSIDE_API bool qproperty_is_stored(PyObject* self); PYSIDE_API bool qpropertyIsStored(PyObject* self);
/** /**
* This function check if property has the flag USER setted * This function check if property has the flag USER setted
@ -149,7 +149,7 @@ PYSIDE_API bool qproperty_is_stored(PyObject* self);
* @param self The property object * @param self The property object
* @return Return a boolean value * @return Return a boolean value
**/ **/
PYSIDE_API bool qproperty_is_user(PyObject* self); PYSIDE_API bool qpropertyIsUser(PyObject* self);
/** /**
* This function check if property has the flag CONSTANT setted * This function check if property has the flag CONSTANT setted
@ -158,7 +158,7 @@ PYSIDE_API bool qproperty_is_user(PyObject* self);
* @param self The property object * @param self The property object
* @return Return a boolean value * @return Return a boolean value
**/ **/
PYSIDE_API bool qproperty_is_constant(PyObject* self); PYSIDE_API bool qpropertyIsConstant(PyObject* self);
/** /**
* This function check if property has the flag FINAL setted * This function check if property has the flag FINAL setted
@ -167,7 +167,7 @@ PYSIDE_API bool qproperty_is_constant(PyObject* self);
* @param self The property object * @param self The property object
* @return Return a boolean value * @return Return a boolean value
**/ **/
PYSIDE_API bool qproperty_is_final(PyObject* self); PYSIDE_API bool qpropertyIsFinal(PyObject* self);
} //namespace PySide } //namespace PySide

View file

@ -363,7 +363,7 @@ int SignalManager::qt_metacall(QObject* object, QMetaObject::Call call, int id,
return id - metaObject->methodCount(); return id - metaObject->methodCount();
pp_name = PyString_FromString(mp.name()); pp_name = PyString_FromString(mp.name());
pp = qproperty_get_object(pySelf, pp_name); pp = qpropertyGetObject(pySelf, pp_name);
if (!pp) { if (!pp) {
qWarning("Invalid property."); qWarning("Invalid property.");
Py_XDECREF(pp_name); Py_XDECREF(pp_name);
@ -376,7 +376,7 @@ int SignalManager::qt_metacall(QObject* object, QMetaObject::Call call, int id,
#ifndef QT_NO_PROPERTIES #ifndef QT_NO_PROPERTIES
case QMetaObject::ReadProperty: case QMetaObject::ReadProperty:
{ {
PyObject* value = qproperty_get(pp, pySelf); PyObject* value = qpropertyGet(pp, pySelf);
if (value) { if (value) {
void *data = typeResolver->toCpp(value); void *data = typeResolver->toCpp(value);
if (Shiboken::TypeResolver::getType(mp.typeName()) == Shiboken::TypeResolver::ObjectType) if (Shiboken::TypeResolver::getType(mp.typeName()) == Shiboken::TypeResolver::ObjectType)
@ -394,12 +394,12 @@ int SignalManager::qt_metacall(QObject* object, QMetaObject::Call call, int id,
case QMetaObject::WriteProperty: case QMetaObject::WriteProperty:
{ {
Shiboken::AutoDecRef value(typeResolver->toPython(args[0])); Shiboken::AutoDecRef value(typeResolver->toPython(args[0]));
qproperty_set(pp, pySelf, value); qpropertySet(pp, pySelf, value);
break; break;
} }
case QMetaObject::ResetProperty: case QMetaObject::ResetProperty:
qproperty_reset(pp, pp_name); qpropertyReset(pp, pp_name);
break; break;
case QMetaObject::QueryPropertyDesignable: case QMetaObject::QueryPropertyDesignable: