summaryrefslogtreecommitdiffstats
path: root/sources/pyside2/libpyside/pysidesignal_p.h
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2019-05-03 09:44:52 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2019-05-06 11:44:20 +0000
commit06f97eca45ddadf4f04229cf14d5dc0bbd867316 (patch)
tree84c9daa0e963166e75663a370432feee911220f0 /sources/pyside2/libpyside/pysidesignal_p.h
parent06e53faac0b1bcdffc966e0676a39a5f50f93592 (diff)
Port property/signal/slot handling of libpyside to use QByteArray
Introduce C++ structs with QByteArray to be used for signal and slot names and signatures, removing a lot of code dealing with char * pointers, strdup() and reallocating. Change-Id: I28acf727bc6cf468285b153c85b0a342fd79f7d8 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/pyside2/libpyside/pysidesignal_p.h')
-rw-r--r--sources/pyside2/libpyside/pysidesignal_p.h45
1 files changed, 28 insertions, 17 deletions
diff --git a/sources/pyside2/libpyside/pysidesignal_p.h b/sources/pyside2/libpyside/pysidesignal_p.h
index 24cbde50..a5cd67f6 100644
--- a/sources/pyside2/libpyside/pysidesignal_p.h
+++ b/sources/pyside2/libpyside/pysidesignal_p.h
@@ -42,40 +42,51 @@
#include <sbkpython.h>
+#include <QtCore/QByteArray>
+#include <QtCore/QVector>
+
+struct PySideSignalData
+{
+ struct Signature
+ {
+ QByteArray signature;
+ int attributes;
+ };
+
+ QByteArray signalName;
+ QVector<Signature> signatures;
+};
+
extern "C"
{
extern PyTypeObject *PySideSignalTypeF(void);
struct PySideSignal {
PyObject_HEAD
- bool initialized;
- char* signalName;
- char** signatures;
- int* signatureAttributes;
- int signaturesSize;
+ PySideSignalData *data;
PyObject* homonymousMethod;
};
struct PySideSignalInstance;
- struct PySideSignalInstancePrivate {
- char* signalName;
- char* signature;
- int attributes;
- PyObject* source;
- PyObject* homonymousMethod;
- PySideSignalInstance* next;
- };
-
-
}; //extern "C"
+struct PySideSignalInstancePrivate
+{
+ QByteArray signalName;
+ QByteArray signature;
+ int attributes = 0;
+ PyObject *source = nullptr;
+ PyObject *homonymousMethod = nullptr;
+ PySideSignalInstance *next = nullptr;
+};
+
namespace PySide { namespace Signal {
void init(PyObject* module);
bool connect(PyObject* source, const char* signal, PyObject* callback);
- char* getTypeName(PyObject*);
- const char** getSignatures(PyObject* self, int *size);
+ QByteArray getTypeName(PyObject *);
QString codeCallbackName(PyObject* callback, const QString& funcName);
+ QByteArray voidType();
}} //namespace PySide