diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-09-11 14:26:09 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-09-13 07:25:06 +0000 |
commit | 7b2025f542729b0c407519d2cb45688dd402eed7 (patch) | |
tree | 65b2c76142d13bdd30087450f985b39a5b04aee8 /sources/shiboken2/ApiExtractor | |
parent | 2bf3dcc98e6df1b434b0fb26b981302423c7ef87 (diff) |
shiboken: Refactor Generator::minimalConstructor(AbstractMetaClass)
Add some convenience functions returning the status of
default expressions to AbstractMetaArgument.
Rewrite the function to only insert suitable candidates into
an ordered multimap instead of looping twice over all candidates.
This unearthed a bug in the old algorithm trying to find the maximum
number of arguments: When no candidates were found, maxArgs was left
at 0, which caused it to assume default constructible. This triggered
for the QMatrixNxN classes inheriting QGenericMatrix<int, int, Type>
with (unsupported) non-type template parameters. For these, the
default constructor needs to be specified now.
Task-number: PYSIDE-62
Change-Id: I5ce2bed43001780553048d8af0addaba2b22410b
Reviewed-by: Christian Tismer <tismer@stackless.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'sources/shiboken2/ApiExtractor')
-rw-r--r-- | sources/shiboken2/ApiExtractor/abstractmetalang.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sources/shiboken2/ApiExtractor/abstractmetalang.h b/sources/shiboken2/ApiExtractor/abstractmetalang.h index f583d2c98..08ab49d91 100644 --- a/sources/shiboken2/ApiExtractor/abstractmetalang.h +++ b/sources/shiboken2/ApiExtractor/abstractmetalang.h @@ -668,6 +668,13 @@ public: m_originalExpression = expr; } + bool hasDefaultValueExpression() const + { return !m_originalExpression.isEmpty() || !m_expression.isEmpty(); } + bool hasUnmodifiedDefaultValueExpression() const + { return !m_originalExpression.isEmpty() && m_originalExpression == m_expression; } + bool hasModifiedDefaultValueExpression() const + { return !m_expression.isEmpty() && m_originalExpression != m_expression; } + QString toString() const { return type()->name() + QLatin1Char(' ') + AbstractMetaVariable::name() + |