aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/generator/generator.cpp
diff options
context:
space:
mode:
authorSimo Fält <simo.falt@qt.io>2023-05-25 11:23:00 +0300
committerSimo Fält <simo.falt@qt.io>2023-05-25 11:23:00 +0300
commite31990ada911989dbcef3d4833f77dd054030e2c (patch)
treee08ea7c0808e1468b3c8bbd83fb189a81d8ebeb0 /sources/shiboken2/generator/generator.cpp
parent40fdea15e6545292212ea6c4acc78c3b2975cbd8 (diff)
parentd135bcccdb609d312993e26b466a853b8d1b3f43 (diff)
Merge tag 'v5.15.7-lts' into tqtc/lts-5.15-opensourcev5.15.7-lts-lgpl
Qt For Python Release 5.15.7 Change-Id: I49808098e3ba42be4be438cb3536fc25672c7127
Diffstat (limited to 'sources/shiboken2/generator/generator.cpp')
-rw-r--r--sources/shiboken2/generator/generator.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/sources/shiboken2/generator/generator.cpp b/sources/shiboken2/generator/generator.cpp
index f90cd312f..60282828a 100644
--- a/sources/shiboken2/generator/generator.cpp
+++ b/sources/shiboken2/generator/generator.cpp
@@ -43,6 +43,8 @@
#include <QDebug>
#include <typedatabase.h>
+static const char ENABLE_PYSIDE_EXTENSIONS[] = "enable-pyside-extensions";
+
/**
* DefaultValue is used for storing default values of types for which code is
* generated in different contexts:
@@ -169,6 +171,7 @@ struct Generator::GeneratorPrivate
QVector<const AbstractMetaType *> instantiatedContainers;
QVector<const AbstractMetaType *> instantiatedSmartPointers;
AbstractMetaClassList m_invisibleTopNamespaces;
+ bool m_usePySideExtensions = false;
};
Generator::Generator() : m_d(new GeneratorPrivate)
@@ -339,11 +342,17 @@ QVector<const AbstractMetaType *> Generator::instantiatedSmartPointers() const
Generator::OptionDescriptions Generator::options() const
{
- return OptionDescriptions();
+ return {
+ {QLatin1String(ENABLE_PYSIDE_EXTENSIONS),
+ QLatin1String("Enable PySide extensions, such as support for signal/slots,\n"
+ "use this if you are creating a binding for a Qt-based library.")}
+ };
}
-bool Generator::handleOption(const QString & /* key */, const QString & /* value */)
+bool Generator::handleOption(const QString & key, const QString & /* value */)
{
+ if (key == QLatin1String(ENABLE_PYSIDE_EXTENSIONS))
+ return ( m_d->m_usePySideExtensions = true);
return false;
}
@@ -615,6 +624,11 @@ bool Generator::isVoidPointer(const AbstractMetaType *type)
&& type->name() == QLatin1String("void");
}
+bool Generator::usePySideExtensions() const
+{
+ return m_d->m_usePySideExtensions;
+}
+
QString Generator::getFullTypeName(const TypeEntry *type) const
{
QString result = type->qualifiedCppName();