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/pysideproperty.cpp | |
parent | 2b0ea8856212b0320238f1c14091a1396039c0a4 (diff) | |
parent | 1d50a0a9f6691b2081e389bafa1f22d2fb6004ed (diff) |
Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I114a003e36bbe9eb7452f13c1515e3419648e228
Diffstat (limited to 'sources/pyside2/libpyside/pysideproperty.cpp')
-rw-r--r-- | sources/pyside2/libpyside/pysideproperty.cpp | 20 |
1 files changed, 7 insertions, 13 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); |