aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/ApiExtractor
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2020-09-21 08:43:01 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2020-09-21 08:43:01 +0200
commit98eb59226aca550ae086c00b9c8023f47c44d2b2 (patch)
tree7e8a136347b5eb52ca0592b33aea09af97bf978a /sources/shiboken2/ApiExtractor
parent968e9adeccddfc7e3bc376e7b7606b376d8feecf (diff)
parent8728594d6b2e0f3df3e3726b67cf23715dfdcbe3 (diff)
Merge remote-tracking branch 'origin/5.15' into dev
Diffstat (limited to 'sources/shiboken2/ApiExtractor')
-rw-r--r--sources/shiboken2/ApiExtractor/typesystem.h4
-rw-r--r--sources/shiboken2/ApiExtractor/typesystemparser.cpp14
2 files changed, 7 insertions, 11 deletions
diff --git a/sources/shiboken2/ApiExtractor/typesystem.h b/sources/shiboken2/ApiExtractor/typesystem.h
index 3fb326b76..f82b0a2ba 100644
--- a/sources/shiboken2/ApiExtractor/typesystem.h
+++ b/sources/shiboken2/ApiExtractor/typesystem.h
@@ -1527,6 +1527,9 @@ public:
void formatDebug(QDebug &d) const override;
#endif
+ bool generateUsing() const { return m_generateUsing; }
+ void setGenerateUsing(bool generateUsing) { m_generateUsing = generateUsing; }
+
protected:
NamespaceTypeEntry(const NamespaceTypeEntry &);
@@ -1536,6 +1539,7 @@ private:
TypeSystem::Visibility m_visibility = TypeSystem::Visibility::Auto;
bool m_hasPattern = false;
bool m_inlineNamespace = false;
+ bool m_generateUsing = true; // Whether to generate "using namespace" into wrapper
};
class ValueTypeEntry : public ComplexTypeEntry
diff --git a/sources/shiboken2/ApiExtractor/typesystemparser.cpp b/sources/shiboken2/ApiExtractor/typesystemparser.cpp
index d23e96c77..948a28796 100644
--- a/sources/shiboken2/ApiExtractor/typesystemparser.cpp
+++ b/sources/shiboken2/ApiExtractor/typesystemparser.cpp
@@ -67,6 +67,7 @@ static inline QString flagsAttribute() { return QStringLiteral("flags"); }
static inline QString forceAbstractAttribute() { return QStringLiteral("force-abstract"); }
static inline QString forceIntegerAttribute() { return QStringLiteral("force-integer"); }
static inline QString formatAttribute() { return QStringLiteral("format"); }
+static inline QString generateUsingAttribute() { return QStringLiteral("generate-using"); }
static inline QString classAttribute() { return QStringLiteral("class"); }
static inline QString generateAttribute() { return QStringLiteral("generate"); }
static inline QString genericClassAttribute() { return QStringLiteral("generic-class"); }
@@ -1020,7 +1021,6 @@ bool TypeSystemParser::importFileElement(const QXmlStreamAttributes &atts)
static bool convertBoolean(QStringView value, const QString &attributeName, bool defaultValue)
{
-#ifdef QTBUG_69389_FIXED
if (value.compare(trueAttributeValue(), Qt::CaseInsensitive) == 0
|| value.compare(yesAttributeValue(), Qt::CaseInsensitive) == 0) {
return true;
@@ -1029,16 +1029,6 @@ static bool convertBoolean(QStringView value, const QString &attributeName, bool
|| value.compare(noAttributeValue(), Qt::CaseInsensitive) == 0) {
return false;
}
-#else
- if (QtPrivate::compareStrings(value, trueAttributeValue(), Qt::CaseInsensitive) == 0
- || QtPrivate::compareStrings(value, yesAttributeValue(), Qt::CaseInsensitive) == 0) {
- return true;
- }
- if (QtPrivate::compareStrings(value, falseAttributeValue(), Qt::CaseInsensitive) == 0
- || QtPrivate::compareStrings(value, noAttributeValue(), Qt::CaseInsensitive) == 0) {
- return false;
- }
-#endif
const QString warn = QStringLiteral("Boolean value '%1' not supported in attribute '%2'. Use 'yes' or 'no'. Defaulting to '%3'.")
.arg(value)
.arg(attributeName,
@@ -1376,6 +1366,8 @@ NamespaceTypeEntry *
} else if (attributeName == generateAttribute()) {
if (!convertBoolean(attributes->takeAt(i).value(), generateAttribute(), true))
visibility = TypeSystem::Visibility::Invisible;
+ } else if (attributeName == generateUsingAttribute()) {
+ result->setGenerateUsing(convertBoolean(attributes->takeAt(i).value(), generateUsingAttribute(), true));
}
}