diff options
Diffstat (limited to 'sources/pyside6/PySide6/glue/qtgui.cpp')
| -rw-r--r-- | sources/pyside6/PySide6/glue/qtgui.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/sources/pyside6/PySide6/glue/qtgui.cpp b/sources/pyside6/PySide6/glue/qtgui.cpp index 22c5d70fc..52bf78151 100644 --- a/sources/pyside6/PySide6/glue/qtgui.cpp +++ b/sources/pyside6/PySide6/glue/qtgui.cpp @@ -306,10 +306,22 @@ if (_i < 0 || _i >= %CPPSELF.count()) { PyErr_SetString(PyExc_IndexError, "index out of bounds"); return 0; } -int item = (*%CPPSELF)[_i]; -return %CONVERTTOPYTHON[int](item); +QKeyCombination item = (*%CPPSELF)[_i]; +if (usingNewEnum()) + return %CONVERTTOPYTHON[QKeyCombination](item); +auto combined = item.toCombined(); +return %CONVERTTOPYTHON[int](combined); // @snippet qkeysequence-getitem +// @snippet qkeysequence-repr +auto ObTuple_Type = reinterpret_cast<PyObject *>(&PyTuple_Type); +auto ObSelf_Type = reinterpret_cast<PyObject *>(Py_TYPE(%PYSELF)); +Shiboken::AutoDecRef surrogate(PyObject_CallFunctionObjArgs(ObTuple_Type, %PYSELF, nullptr)); +Shiboken::AutoDecRef argstr(PyObject_Repr(surrogate)); +Shiboken::AutoDecRef name(PyObject_GetAttrString(ObSelf_Type, "__name__")); +return PyUnicode_Concat(name, argstr); +// @snippet qkeysequence-repr + // @snippet qpicture-data %PYARG_0 = Shiboken::Buffer::newObject(%CPPSELF.data(), %CPPSELF.size()); // @snippet qpicture-data |
