diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-09-16 08:00:32 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-09-16 08:00:32 +0200 |
commit | 53181fb95d3884cc067d005f37accd92d128bccc (patch) | |
tree | 6b21bd8e6bdd3b80e21590219331d41f71975df1 /sources/pyside2/libpyside | |
parent | 2b0ea8856212b0320238f1c14091a1396039c0a4 (diff) | |
parent | 1d50a0a9f6691b2081e389bafa1f22d2fb6004ed (diff) |
Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I114a003e36bbe9eb7452f13c1515e3419648e228
Diffstat (limited to 'sources/pyside2/libpyside')
-rw-r--r-- | sources/pyside2/libpyside/pysideproperty.cpp | 20 | ||||
-rw-r--r-- | sources/pyside2/libpyside/pysideproperty.h | 18 |
2 files changed, 16 insertions, 22 deletions
diff --git a/sources/pyside2/libpyside/pysideproperty.cpp b/sources/pyside2/libpyside/pysideproperty.cpp index f169c63e1..c902afc0c 100644 --- a/sources/pyside2/libpyside/pysideproperty.cpp +++ b/sources/pyside2/libpyside/pysideproperty.cpp @@ -73,7 +73,7 @@ static PyMethodDef PySidePropertyMethods[] = { }; static PyGetSetDef PySidePropertyType_getset[] = { - {"__doc__", qPropertyDocGet, nullptr, nullptr, nullptr}, + {const_cast<char *>("__doc__"), qPropertyDocGet, nullptr, nullptr, nullptr}, {nullptr, nullptr, nullptr, nullptr, nullptr} }; @@ -158,7 +158,7 @@ static PyObject *qpropertyTpNew(PyTypeObject *subtype, PyObject * /* args */, Py return reinterpret_cast<PyObject *>(me); } -int qpropertyTpInit(PyObject *self, PyObject *args, PyObject *kwds) +static int qpropertyTpInit(PyObject *self, PyObject *args, PyObject *kwds) { PyObject *type = nullptr; auto data = reinterpret_cast<PySideProperty *>(self); @@ -209,7 +209,7 @@ int qpropertyTpInit(PyObject *self, PyObject *args, PyObject *kwds) return -1; } -void qpropertyDeAlloc(PyObject *self) +static void qpropertyDeAlloc(PyObject *self) { qpropertyClear(self); if (PepRuntime_38_flag) { @@ -220,7 +220,7 @@ void qpropertyDeAlloc(PyObject *self) Py_TYPE(self)->tp_free(self); } -PyObject *qPropertyCall(PyObject *self, PyObject *args, PyObject * /* kw */) +static PyObject *qPropertyCall(PyObject *self, PyObject *args, PyObject * /* kw */) { PyObject *callback = PyTuple_GetItem(args, 0); if (PyFunction_Check(callback)) { @@ -237,7 +237,7 @@ PyObject *qPropertyCall(PyObject *self, PyObject *args, PyObject * /* kw */) return nullptr; } -PyObject *qPropertySetter(PyObject *self, PyObject *callback) +static PyObject *qPropertySetter(PyObject *self, PyObject *callback) { if (PyFunction_Check(callback)) { PySideProperty *prop = reinterpret_cast<PySideProperty *>(self); @@ -253,7 +253,7 @@ PyObject *qPropertySetter(PyObject *self, PyObject *callback) return nullptr; } -PyObject *qPropertyGetter(PyObject *self, PyObject *callback) +static PyObject *qPropertyGetter(PyObject *self, PyObject *callback) { if (PyFunction_Check(callback)) { PySideProperty *prop = reinterpret_cast<PySideProperty *>(self); @@ -282,8 +282,7 @@ static PyObject *qPropertyDocGet(PyObject *self, void *) return PyString_FromString(doc); #endif } - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } @@ -424,11 +423,6 @@ PySideProperty *getObject(PyObject *source, PyObject *name) { PyObject *attr = nullptr; - if (Shiboken::Object::isUserType(source)) { - if (auto dict = reinterpret_cast<SbkObject *>(source)->ob_dict) - attr = PyDict_GetItem(dict, name); - } - attr = getFromType(Py_TYPE(source), name); if (attr && checkType(attr)) { Py_INCREF(attr); diff --git a/sources/pyside2/libpyside/pysideproperty.h b/sources/pyside2/libpyside/pysideproperty.h index a97b2a48f..4a467b186 100644 --- a/sources/pyside2/libpyside/pysideproperty.h +++ b/sources/pyside2/libpyside/pysideproperty.h @@ -62,7 +62,7 @@ namespace PySide { namespace Property { typedef void (*MetaCallHandler)(PySideProperty*,PyObject*,QMetaObject::Call, void**); -PYSIDE_API bool checkType(PyObject* pyObj); +PYSIDE_API bool checkType(PyObject *pyObj); /** * This function call set property function and pass value as arg @@ -73,7 +73,7 @@ PYSIDE_API bool checkType(PyObject* pyObj); * @param value The value to set in property * @return Return 0 if ok or -1 if this function fail **/ -PYSIDE_API int setValue(PySideProperty* self, PyObject* source, PyObject* value); +PYSIDE_API int setValue(PySideProperty *self, PyObject *source, PyObject *value); /** * This function call get property function @@ -83,7 +83,7 @@ PYSIDE_API int setValue(PySideProperty* self, PyObject* source, PyObject* value) * @param source The QObject witch has the property * @return Return the result of property get function or 0 if this fail **/ -PYSIDE_API PyObject* getValue(PySideProperty* self, PyObject* source); +PYSIDE_API PyObject *getValue(PySideProperty *self, PyObject *source); /** * This function return the notify name used on this property @@ -91,7 +91,7 @@ PYSIDE_API PyObject* getValue(PySideProperty* self, PyObject* source); * @param self The property object * @return Return a const char with the notify name used **/ -PYSIDE_API const char* getNotifyName(PySideProperty* self); +PYSIDE_API const char *getNotifyName(PySideProperty *self); /** @@ -101,14 +101,14 @@ PYSIDE_API const char* getNotifyName(PySideProperty* self); * @param name The property name * @return Return a new reference to property object **/ -PYSIDE_API PySideProperty* getObject(PyObject* source, PyObject* name); +PYSIDE_API PySideProperty *getObject(PyObject *source, PyObject *name); -PYSIDE_API void setMetaCallHandler(PySideProperty* self, MetaCallHandler handler); +PYSIDE_API void setMetaCallHandler(PySideProperty *self, MetaCallHandler handler); -PYSIDE_API void setTypeName(PySideProperty* self, const char* typeName); +PYSIDE_API void setTypeName(PySideProperty *self, const char *typeName); -PYSIDE_API void setUserData(PySideProperty* self, void* data); -PYSIDE_API void* userData(PySideProperty* self); +PYSIDE_API void setUserData(PySideProperty *self, void *data); +PYSIDE_API void* userData(PySideProperty *self); } //namespace Property } //namespace PySide |