diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-10-06 10:55:34 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-10-06 10:55:34 +0200 |
commit | 0e3a58441644faa14698a44f2ed682150430529a (patch) | |
tree | de19c693a802abf6f020867f6ca8e912b0d019c6 /sources/shiboken2/generator | |
parent | 82934bc00c2de7ea51fd7e95601472fcdf7b6aea (diff) | |
parent | b57f329ecbf1fd0b29ae0e8284c885adc0eb4ed3 (diff) |
Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I7b4ff138799ee81940c36e68a105cb42bb38a3ff
Diffstat (limited to 'sources/shiboken2/generator')
-rw-r--r-- | sources/shiboken2/generator/main.cpp | 5 | ||||
-rw-r--r-- | sources/shiboken2/generator/shiboken2/shibokengenerator.h | 5 |
2 files changed, 7 insertions, 3 deletions
diff --git a/sources/shiboken2/generator/main.cpp b/sources/shiboken2/generator/main.cpp index 201603f38..3c5c5876c 100644 --- a/sources/shiboken2/generator/main.cpp +++ b/sources/shiboken2/generator/main.cpp @@ -612,7 +612,10 @@ int main(int argc, char *argv[]) extractor.setCppFileNames(cppFileNames); extractor.setTypeSystem(typeSystemFileName); - if (!extractor.run()) { + auto shibokenGenerator = dynamic_cast<const ShibokenGenerator *>(generators.constFirst().data()); + const bool usePySideExtensions = shibokenGenerator && shibokenGenerator->usePySideExtensions(); + + if (!extractor.run(usePySideExtensions)) { errorPrint(QLatin1String("Error running ApiExtractor.")); return EXIT_FAILURE; } diff --git a/sources/shiboken2/generator/shiboken2/shibokengenerator.h b/sources/shiboken2/generator/shiboken2/shibokengenerator.h index 33da01a3a..6d36026cd 100644 --- a/sources/shiboken2/generator/shiboken2/shibokengenerator.h +++ b/sources/shiboken2/generator/shiboken2/shibokengenerator.h @@ -90,6 +90,9 @@ public: /// Returns a list of all ancestor classes for the given class. AbstractMetaClassList getAllAncestors(const AbstractMetaClass *metaClass) const; + /// Returns true if the user enabled PySide extensions. + bool usePySideExtensions() const; + protected: bool doSetup() override; @@ -377,8 +380,6 @@ protected: bool useCtorHeuristic() const; /// Returns true if the user enabled the so called "return value heuristic". bool useReturnValueHeuristic() const; - /// Returns true if the user enabled PySide extensions. - bool usePySideExtensions() const; /// Returns true if the generator should use the result of isNull()const to compute boolean casts. bool useIsNullAsNbNonZero() const; /// Returns true if the generated code should use the "#define protected public" hack. |