diff options
author | Christian Tismer <tismer@stackless.com> | 2021-07-28 18:51:34 +0200 |
---|---|---|
committer | Christian Tismer <tismer@stackless.com> | 2021-08-05 14:42:55 +0200 |
commit | 521dc4b6dcdd7d04a9ef6afe273833016f7ba31c (patch) | |
tree | aeec8adc3e7ac9743cd99baf3e51aa2d8dbbe39a /sources/shiboken6/libshiboken/signature/signature.cpp | |
parent | f825ef2787d495b2aa1a4fd348ec1603d2a2d216 (diff) |
feature: move getFeatureSelectId to Shiboken and refactor
This function caused problems when extending the signature module:
For class methods, the signature module must become able to
distinguish class methods in properties (true_property) which are
static methods without a feature.
That means: The signature module must know the full info
about feature switching. Moving getFeatureSelectId into
Shiboken simplifies matters quite a lot.
The main feature switching code remains in PySide.
Task-number: PYSIDE-1019
Pick-to: 6.1
Change-Id: I99116eefc0faf24a6eb9a16d79b21a5cc7ae299e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/shiboken6/libshiboken/signature/signature.cpp')
-rw-r--r-- | sources/shiboken6/libshiboken/signature/signature.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sources/shiboken6/libshiboken/signature/signature.cpp b/sources/shiboken6/libshiboken/signature/signature.cpp index 624d55a3e..c844e2694 100644 --- a/sources/shiboken6/libshiboken/signature/signature.cpp +++ b/sources/shiboken6/libshiboken/signature/signature.cpp @@ -54,7 +54,7 @@ #include "sbkstring.h" #include "sbkstaticstrings.h" #include "sbkstaticstrings_p.h" - +#include "sbkfeature_base.h" #include "signature_p.h" #include <structmember.h> @@ -106,19 +106,22 @@ PyObject *GetTypeKey(PyObject *ob) * * PYSIDE-1286: We use correct __module__ and __qualname__, now. */ + // XXX we obtain also the current selection. + // from the current module name. AutoDecRef module_name(PyObject_GetAttr(ob, PyMagicName::module())); if (module_name.isNull()) { // We have no module_name because this is a module ;-) PyErr_Clear(); module_name.reset(PyObject_GetAttr(ob, PyMagicName::name())); - return Py_BuildValue("O", module_name.object()); + return Py_BuildValue("O"/*i"*/, module_name.object()/*, getFeatureSelectId()*/); } - AutoDecRef class_name(_get_qualname(ob)); + AutoDecRef class_name(PyObject_GetAttr(ob, PyMagicName::qualname())); if (class_name.isNull()) { Py_FatalError("Signature: missing class name in GetTypeKey"); return nullptr; } - return Py_BuildValue("(OO)", module_name.object(), class_name.object()); + return Py_BuildValue("(O"/*i*/"O)", module_name.object(), /*getFeatureSelectId(),*/ + class_name.object()); } static PyObject *empty_dict = nullptr; |