Create checkType for libpyside objects.
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org>
Hugo Parente Lima <hugo.pl@gmail.com>
This commit is contained in:
parent
cef6db9548
commit
fe06dba43c
4 changed files with 17 additions and 1 deletions
|
|
@ -205,7 +205,7 @@ void init(PyObject* module)
|
||||||
PyModule_AddObject(module, QPROPERTY_CLASS_NAME, ((PyObject*)&PySidePropertyType));
|
PyModule_AddObject(module, QPROPERTY_CLASS_NAME, ((PyObject*)&PySidePropertyType));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isPropertyType(PyObject* pyObj)
|
bool checkType(PyObject* pyObj)
|
||||||
{
|
{
|
||||||
if (pyObj) {
|
if (pyObj) {
|
||||||
return PyType_IsSubtype(pyObj->ob_type, &PySidePropertyType);
|
return PyType_IsSubtype(pyObj->ob_type, &PySidePropertyType);
|
||||||
|
|
@ -213,6 +213,11 @@ bool isPropertyType(PyObject* pyObj)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool isPropertyType(PyObject* pyObj)
|
||||||
|
{
|
||||||
|
return checkType(pyObj);
|
||||||
|
}
|
||||||
|
|
||||||
int setValue(PySideProperty* self, PyObject* source, PyObject* value)
|
int setValue(PySideProperty* self, PyObject* source, PyObject* value)
|
||||||
{
|
{
|
||||||
PyObject* fset = self->d->fset;
|
PyObject* fset = self->d->fset;
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,9 @@ namespace PySide { namespace Property {
|
||||||
|
|
||||||
typedef void (*MetaCallHandler)(PySideProperty*,PyObject*,QMetaObject::Call, void**);
|
typedef void (*MetaCallHandler)(PySideProperty*,PyObject*,QMetaObject::Call, void**);
|
||||||
|
|
||||||
|
PYSIDE_API bool checkType(PyObject* pyObj);
|
||||||
|
|
||||||
|
//Deprecated (use checkType)
|
||||||
PYSIDE_API bool isPropertyType(PyObject* pyObj);
|
PYSIDE_API bool isPropertyType(PyObject* pyObj);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -473,6 +473,13 @@ void init(PyObject* module)
|
||||||
Py_INCREF(&PySideSignalInstanceType);
|
Py_INCREF(&PySideSignalInstanceType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool checkType(PyObject* pyObj)
|
||||||
|
{
|
||||||
|
if (pyObj)
|
||||||
|
return PyType_IsSubtype(pyObj->ob_type, &PySideSignalType);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
void updateSourceObject(PyObject* source)
|
void updateSourceObject(PyObject* source)
|
||||||
{
|
{
|
||||||
PyTypeObject * objType = reinterpret_cast<PyTypeObject *>(PyObject_Type(source));
|
PyTypeObject * objType = reinterpret_cast<PyTypeObject *>(PyObject_Type(source));
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,8 @@ extern "C"
|
||||||
|
|
||||||
namespace PySide { namespace Signal {
|
namespace PySide { namespace Signal {
|
||||||
|
|
||||||
|
PYSIDE_API bool checkType(PyObject* type);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function creates a Signal object which stay attached to QObject class
|
* This function creates a Signal object which stay attached to QObject class
|
||||||
*
|
*
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue