aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/libpysideqml
diff options
context:
space:
mode:
authorChristian Tismer <tismer@stackless.com>2022-01-17 13:20:46 +0100
committerChristian Tismer <tismer@stackless.com>2022-02-03 18:18:04 +0100
commit5a487a6f9f9861fc14458c770e61c66a63019184 (patch)
tree9af8ca3015ae585905a14bb5597f6309472c7b63 /sources/pyside6/libpysideqml
parentac1dbba1798bc72cf4e71142ec6f647b8b6ae25d (diff)
PyPySide: Rename interface functions and classes to simplify debugging
The names of certain interface functions are not always following a simple scheme. Especially it is not easy to see immediately if we are dealing with a method of SbkObjectType or SbkObject Do a few renamings to simplify debugging and make the code easier to understand. When a function is used in a type spec and there is no other important reason, it should be named like {Py_<tpname>: reinterpret_cast<void *>(<TypeName>_<tpname>)}, Rename also all type functions ending on "TypeF()" to end in "_TypeF()". This is not always the case. Examples: SbkObjectTpNew -> SbkObject_tp_new SbkObjecttypeTpNew -> SbkObjectType_tp_new PyClassPropertyTypeF -> PyClassProperty_TypeF Task-number: PYSIDE-535 Change-Id: Icbd118852f2ee732b55d944ed57c7a8ef7d26139 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/pyside6/libpysideqml')
-rw-r--r--sources/pyside6/libpysideqml/pysideqmllistproperty.cpp12
-rw-r--r--sources/pyside6/libpysideqml/pysideqmluncreatable.cpp14
-rw-r--r--sources/pyside6/libpysideqml/pysideqmluncreatable.h2
3 files changed, 14 insertions, 14 deletions
diff --git a/sources/pyside6/libpysideqml/pysideqmllistproperty.cpp b/sources/pyside6/libpysideqml/pysideqmllistproperty.cpp
index c698342b0..df3a0f1d0 100644
--- a/sources/pyside6/libpysideqml/pysideqmllistproperty.cpp
+++ b/sources/pyside6/libpysideqml/pysideqmllistproperty.cpp
@@ -137,9 +137,9 @@ static PyType_Spec PropertyListType_spec = {
};
-PyTypeObject *PropertyListTypeF(void)
+PyTypeObject *PropertyList_TypeF(void)
{
- static Shiboken::AutoDecRef bases(Py_BuildValue("(O)", PySidePropertyTypeF()));
+ static Shiboken::AutoDecRef bases(Py_BuildValue("(O)", PySideProperty_TypeF()));
static auto *type = SbkType_FromSpecWithBases(&PropertyListType_spec, bases);
return type;
}
@@ -306,7 +306,7 @@ namespace PySide::Qml {
void initQtQmlListProperty(PyObject *module)
{
// Export QmlListProperty type
- if (InitSignatureStrings(PropertyListTypeF(), PropertyList_SignatureStrings) < 0) {
+ if (InitSignatureStrings(PropertyList_TypeF(), PropertyList_SignatureStrings) < 0) {
PyErr_Print();
qWarning() << "Error initializing PropertyList type.";
return;
@@ -315,9 +315,9 @@ void initQtQmlListProperty(PyObject *module)
// Register QQmlListProperty metatype for use in QML
qRegisterMetaType<QQmlListProperty<QObject>>();
- Py_INCREF(reinterpret_cast<PyObject *>(PropertyListTypeF()));
- PyModule_AddObject(module, PepType_GetNameStr(PropertyListTypeF()),
- reinterpret_cast<PyObject *>(PropertyListTypeF()));
+ Py_INCREF(reinterpret_cast<PyObject *>(PropertyList_TypeF()));
+ PyModule_AddObject(module, PepType_GetNameStr(PropertyList_TypeF()),
+ reinterpret_cast<PyObject *>(PropertyList_TypeF()));
}
} // namespace PySide::Qml
diff --git a/sources/pyside6/libpysideqml/pysideqmluncreatable.cpp b/sources/pyside6/libpysideqml/pysideqmluncreatable.cpp
index 34f4bb72c..11edb931c 100644
--- a/sources/pyside6/libpysideqml/pysideqmluncreatable.cpp
+++ b/sources/pyside6/libpysideqml/pysideqmluncreatable.cpp
@@ -58,8 +58,8 @@ extern "C"
{
// The call operator is passed the class type and registers the reason
-// in QmlTypeInfo.
-static PyObject *classCall(PyObject *self, PyObject *args, PyObject * /* kw */)
+// in the uncreatableReasonMap()
+static PyObject *classInfo_tp_call(PyObject *self, PyObject *args, PyObject * /* kw */)
{
if (!PyTuple_Check(args) || PyTuple_Size(args) != 1) {
PyErr_Format(PyExc_TypeError,
@@ -138,7 +138,7 @@ static void qmlUncreatableFree(void *self)
}
static PyType_Slot PySideQmlUncreatableType_slots[] = {
- {Py_tp_call, reinterpret_cast<void *>(classCall)},
+ {Py_tp_call, reinterpret_cast<void *>(classInfo_tp_call)},
{Py_tp_init, reinterpret_cast<void *>(qmlUncreatableTpInit)},
{Py_tp_new, reinterpret_cast<void *>(qmlUncreatableTpNew)},
{Py_tp_free, reinterpret_cast<void *>(qmlUncreatableFree)},
@@ -154,7 +154,7 @@ static PyType_Spec PySideQmlUncreatableType_spec = {
PySideQmlUncreatableType_slots,
};
-PyTypeObject *PySideQmlUncreatableTypeF(void)
+PyTypeObject *PySideQmlUncreatable_TypeF(void)
{
static auto *type = SbkType_FromSpec(&PySideQmlUncreatableType_spec);
return type;
@@ -169,10 +169,10 @@ static const char *qmlUncreatable_SignatureStrings[] = {
void initQmlUncreatable(PyObject *module)
{
- if (InitSignatureStrings(PySideQmlUncreatableTypeF(), qmlUncreatable_SignatureStrings) < 0)
+ if (InitSignatureStrings(PySideQmlUncreatable_TypeF(), qmlUncreatable_SignatureStrings) < 0)
return;
- Py_INCREF(PySideQmlUncreatableTypeF());
+ Py_INCREF(PySideQmlUncreatable_TypeF());
PyModule_AddObject(module, "QmlUncreatable",
- reinterpret_cast<PyObject *>(PySideQmlUncreatableTypeF()));
+ reinterpret_cast<PyObject *>(PySideQmlUncreatable_TypeF()));
}
diff --git a/sources/pyside6/libpysideqml/pysideqmluncreatable.h b/sources/pyside6/libpysideqml/pysideqmluncreatable.h
index 0b011193a..fd0caaaaf 100644
--- a/sources/pyside6/libpysideqml/pysideqmluncreatable.h
+++ b/sources/pyside6/libpysideqml/pysideqmluncreatable.h
@@ -47,7 +47,7 @@
// QmlElement.
extern "C"
{
- extern PyTypeObject *PySideQmlUncreatableTypeF(void);
+ extern PyTypeObject *PySideQmlUncreatable_TypeF(void);
struct PySideQmlUncreatablePrivate;
struct PySideQmlUncreatable