From 35bc1078b4c130cd24282ce6c770c195b1cfd76f Mon Sep 17 00:00:00 2001 From: Venugopal Shivashankar Date: Fri, 20 Sep 2019 10:15:03 +0200 Subject: Shiboken: Add check for 'external' link type MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Apparently, qdoc generates entries with 'external' type, which is ignored by Shiboken. This leads to treating such links as reference links, leading to broken links in the HTML output. Change-Id: I426f91661ba1cc0b0f17b2e30fbddcf9e1fee530 Reviewed-by: Topi Reiniƶ Reviewed-by: Friedemann Kleint --- sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sources/shiboken2/generator') diff --git a/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp b/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp index 9cad400f3..dd29c02f0 100644 --- a/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp +++ b/sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp @@ -1023,6 +1023,8 @@ QtXmlToSphinx::LinkContext *QtXmlToSphinx::handleLinkStart(const QString &type, result->type = LinkContext::External; else result->type = LinkContext::Reference; + } else if (type == QLatin1String("external")) { + result->type = LinkContext::External; } else { result->type = LinkContext::Reference; } -- cgit v1.2.3 From 45fdb9c06d8934e5c8de208e584d4c35943cd3b8 Mon Sep 17 00:00:00 2001 From: Andreas Beckermann Date: Thu, 12 Sep 2019 14:56:35 +0200 Subject: Remove trailing whitespace from __repr__ QDebug normally prints a trailing ' ', however the repr implementation does not expect so. Remove the trailing space, if it is there. This makes sure that e.g. PySide2.QtCore.QRegularExpression() is printed as instead of (note the double space before 'at') Change-Id: I6c088069a6a8ca42933a442cce7b576327a9d151 Reviewed-by: Christian Tismer Reviewed-by: Friedemann Kleint --- sources/shiboken2/generator/shiboken2/cppgenerator.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'sources/shiboken2/generator') diff --git a/sources/shiboken2/generator/shiboken2/cppgenerator.cpp b/sources/shiboken2/generator/shiboken2/cppgenerator.cpp index 68bcfe508..7de0cfc09 100644 --- a/sources/shiboken2/generator/shiboken2/cppgenerator.cpp +++ b/sources/shiboken2/generator/shiboken2/cppgenerator.cpp @@ -6030,6 +6030,7 @@ QString CppGenerator::writeReprFunction(QTextStream &s, GeneratorContext &contex Indentation indent(INDENT); s << INDENT << "str.replace(0, idx, Py_TYPE(self)->tp_name);" << endl; } + s << INDENT << "str = str.trimmed();" << endl; s << INDENT << "PyObject *mod = PyDict_GetItemString(Py_TYPE(self)->tp_dict, \"__module__\");" << endl; // PYSIDE-595: The introduction of heap types has the side effect that the module name // is always prepended to the type name. Therefore the strchr check: -- cgit v1.2.3 From e2774ff5350fa94352858672aa165a8ff22aa3b1 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 2 Oct 2019 14:05:57 +0200 Subject: shiboken: Fix handling of modified default expressions - Do not try to resolve modified default expressions (add enumeration scopes or similar) - Fix the signature parser to handle arbitrary expressions Fixes: PYSIDE-1095 Change-Id: I059c3a1f066687d7c2f0dad9ea7f0d93e292b1b5 Reviewed-by: Christian Tismer --- sources/shiboken2/generator/shiboken2/shibokengenerator.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sources/shiboken2/generator') diff --git a/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp b/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp index 34e43a4c7..2a8eefba6 100644 --- a/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp +++ b/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp @@ -573,11 +573,11 @@ QString ShibokenGenerator::guessScopeForDefaultValue(const AbstractMetaFunction { QString value = getDefaultValue(func, arg); - if (value.isEmpty()) - return QString(); - - if (isPointer(arg->type())) + if (value.isEmpty() + || arg->hasModifiedDefaultValueExpression() + || isPointer(arg->type())) { return value; + } static const QRegularExpression enumValueRegEx(QStringLiteral("^([A-Za-z_]\\w*)?$")); Q_ASSERT(enumValueRegEx.isValid()); -- cgit v1.2.3