aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/generator
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2019-10-08 08:17:29 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2019-10-08 08:17:29 +0200
commit66a0fa21efb94ac7cc16032213c91a33c0670e2f (patch)
tree622759bac23da5d32d06aaa56805570698c10cdf /sources/shiboken2/generator
parent9698a678937c3dfd23e38b890a29b16ad6885d96 (diff)
parente2774ff5350fa94352858672aa165a8ff22aa3b1 (diff)
Merge remote-tracking branch 'origin/5.13' into 5.14
Diffstat (limited to 'sources/shiboken2/generator')
-rw-r--r--sources/shiboken2/generator/qtdoc/qtdocgenerator.cpp2
-rw-r--r--sources/shiboken2/generator/shiboken2/cppgenerator.cpp1
-rw-r--r--sources/shiboken2/generator/shiboken2/shibokengenerator.cpp8
3 files changed, 7 insertions, 4 deletions
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;
}
diff --git a/sources/shiboken2/generator/shiboken2/cppgenerator.cpp b/sources/shiboken2/generator/shiboken2/cppgenerator.cpp
index 5e9d9378e..547aecc61 100644
--- a/sources/shiboken2/generator/shiboken2/cppgenerator.cpp
+++ b/sources/shiboken2/generator/shiboken2/cppgenerator.cpp
@@ -6018,6 +6018,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_GetItem(Py_TYPE(self)->tp_dict, Shiboken::PyMagicName::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:
diff --git a/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp b/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp
index 6d94af248..a94d3c8a7 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 = arg->defaultValueExpression();
- 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());