diff options
| author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2023-05-02 16:15:13 +0200 |
|---|---|---|
| committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2023-05-03 13:54:33 +0200 |
| commit | 42be729770eeb5d40802cfc697bddd744ba2623f (patch) | |
| tree | 86234889332505a9ece2f0002f3b2aa779e6ce02 | |
| parent | 9e0da8e0288d4c87eaa6f8a22ec107e04d0cd305 (diff) | |
PySide6: Enable basic property arguments for QmlListProperty
Pick-to: 6.5
Task-number: PYSIDE-2206
Change-Id: Ia26104fba75cdba3e4d84e6fcfbffc94e4bfd3d7
Reviewed-by: Christian Tismer <tismer@stackless.com>
| -rw-r--r-- | sources/pyside6/libpysideqml/pysideqmllistproperty.cpp | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/sources/pyside6/libpysideqml/pysideqmllistproperty.cpp b/sources/pyside6/libpysideqml/pysideqmllistproperty.cpp index a23b1af42..37a2bc543 100644 --- a/sources/pyside6/libpysideqml/pysideqmllistproperty.cpp +++ b/sources/pyside6/libpysideqml/pysideqmllistproperty.cpp @@ -40,23 +40,44 @@ static PyObject *propList_tp_new(PyTypeObject *subtype, PyObject * /* args */, P static int propListTpInit(PyObject *self, PyObject *args, PyObject *kwds) { - static const char *kwlist[] = {"type", "append", "count", "at", "clear", "replace", "removeLast", 0}; + static const char *kwlist[] = {"type", "append", "count", "at", "clear", + "replace", "removeLast", + "doc", "notify", // PySideProperty + "designable", "scriptable", "stored", + "user", "constant", "final", + nullptr}; PySideProperty *pySelf = reinterpret_cast<PySideProperty *>(self); auto *data = static_cast<QmlListPropertyPrivate *>(pySelf->d); + char *doc{}; + if (!PyArg_ParseTupleAndKeywords(args, kwds, - "O|OOOOOO:QtQml.ListProperty", (char **) kwlist, + "O|OOOOOOsObbbbbb:QtQml.ListProperty", + const_cast<char **>(kwlist), &data->type, &data->append, &data->count, &data->at, &data->clear, &data->replace, - &data->removeLast)) { + &data->removeLast, + /*s*/ &doc, + /*O*/ &(data->notify), // PySideProperty + /*bbb*/ &(data->designable), + &(data->scriptable), + &(data->stored), + /*bbb*/ &(data->user), + &(data->constant), + &(data->final))) { return -1; } + if (doc) + data->doc = doc; + else + data->doc.clear(); + PyTypeObject *qobjectType = qObjectType(); if (!PySequence_Contains(data->type->tp_mro, reinterpret_cast<PyObject *>(qobjectType))) { |
