diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-06-30 21:23:37 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-06-30 21:23:37 +0200 |
commit | fd7bd279b8fe45be70cca5ab8f2fdac97600bf9e (patch) | |
tree | b3311cb01d1246f6d3f98f6a8538f98d062a335b | |
parent | eb5c77caa313edd85b9ec61c537fdf35539b0c9f (diff) | |
parent | b2401231c0e6938c43f48fe90db8f775aeb04103 (diff) |
Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: Ie96254d3b2435f9001c8ab6f12569ce4ffa4c4ed
-rw-r--r-- | build_scripts/qp5_tool.py | 6 | ||||
-rw-r--r-- | sources/pyside2/PySide2/QtCore/typesystem_core_common.xml | 3 | ||||
-rw-r--r-- | sources/pyside2/PySide2/QtGui/CMakeLists.txt | 3 | ||||
-rw-r--r-- | sources/pyside2/PySide2/QtNetwork/CMakeLists.txt | 4 | ||||
-rw-r--r-- | sources/pyside2/PySide2/QtOpenGLFunctions/CMakeLists.txt | 2 | ||||
-rw-r--r-- | sources/pyside2/PySide2/glue/qtcore.cpp | 10 | ||||
-rw-r--r-- | sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp | 4 | ||||
-rw-r--r-- | sources/shiboken2/ApiExtractor/tests/testdroptypeentries.cpp | 10 | ||||
-rw-r--r-- | sources/shiboken2/ApiExtractor/typesystemparser.cpp | 38 | ||||
-rw-r--r-- | sources/shiboken2/doc/shibokengenerator.rst | 4 |
10 files changed, 56 insertions, 28 deletions
diff --git a/build_scripts/qp5_tool.py b/build_scripts/qp5_tool.py index 9fc37a99b..6871bb343 100644 --- a/build_scripts/qp5_tool.py +++ b/build_scripts/qp5_tool.py @@ -68,6 +68,8 @@ Modules-pyside-setup512=Core,Gui,Widgets,Network,Test Configuration keys: Acceleration Incredibuild or unset BuildArguments Arguments to setup.py +Generator Generator to be used for CMake. Currently, only Ninja is + supported. Jobs Number of jobs to be run simultaneously Modules Comma separated list of modules to be built (for --module-subset=) @@ -99,6 +101,7 @@ INCREDIBUILD_CONSOLE = 'BuildConsole' if IS_WINDOWS else '/opt/incredibuild/bin/ # Config file keys ACCELERATION_KEY = 'Acceleration' BUILDARGUMENTS_KEY = 'BuildArguments' +GENERATOR_KEY = 'Generator' JOBS_KEY = 'Jobs' MODULES_KEY = 'Modules' PYTHON_KEY = 'Python' @@ -304,6 +307,9 @@ def build(target): arguments.append('--avoid') # caching, v0.96.74 arguments.extend([read_config_python_binary(), 'setup.py', target]) arguments.extend(read_config_build_arguments()) + generator = read_config(GENERATOR_KEY) + if generator == 'Ninja': + arguments.extend(['--make-spec', 'ninja']) jobs = read_int_config(JOBS_KEY) if jobs > 1: arguments.extend(['-j', str(jobs)]) diff --git a/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml b/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml index 5d8a1c9c7..986356720 100644 --- a/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml +++ b/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml @@ -2322,6 +2322,9 @@ </value-type> <object-type name="QLibraryInfo"> <enum-type name="LibraryLocation"/> + <modify-function signature="build()"> + <inject-code class="target" position="end" file="../glue/qtcore.cpp" snippet="qlibraryinfo_build"/> + </modify-function> </object-type> <object-type name="QMutexLocker" copyable="no"> <!-- PYSIDE-1271: Creating locking capable objects inside sections that diff --git a/sources/pyside2/PySide2/QtGui/CMakeLists.txt b/sources/pyside2/PySide2/QtGui/CMakeLists.txt index 0001d51d6..dcc5e29cf 100644 --- a/sources/pyside2/PySide2/QtGui/CMakeLists.txt +++ b/sources/pyside2/PySide2/QtGui/CMakeLists.txt @@ -8,7 +8,8 @@ endif() set(QtGui_DROPPED_ENTRIES) -get_property(QtGui_enabled_features TARGET Qt${QT_MAJOR_VERSION}::Gui PROPERTY INTERFACE_QT_ENABLED_FEATURES) +get_property(QtGui_enabled_features TARGET Qt${QT_MAJOR_VERSION}::Gui + PROPERTY QT_ENABLED_PUBLIC_FEATURES) set(QtGui_SRC ${QtGui_GEN_DIR}/qabstractopenglfunctions_wrapper.cpp diff --git a/sources/pyside2/PySide2/QtNetwork/CMakeLists.txt b/sources/pyside2/PySide2/QtNetwork/CMakeLists.txt index 7a9dcc23f..9557c4a26 100644 --- a/sources/pyside2/PySide2/QtNetwork/CMakeLists.txt +++ b/sources/pyside2/PySide2/QtNetwork/CMakeLists.txt @@ -48,9 +48,9 @@ ${QtNetwork_GEN_DIR}/qtnetwork_module_wrapper.cpp ) get_property(QtNetwork_enabled_features TARGET Qt${QT_MAJOR_VERSION}::Network - PROPERTY INTERFACE_QT_ENABLED_FEATURES) + PROPERTY QT_ENABLED_PUBLIC_FEATURES) get_property(QtNetwork_disabled_features TARGET Qt${QT_MAJOR_VERSION}::Network - PROPERTY INTERFACE_QT_DISABLED_FEATURES) + PROPERTY QT_DISABLED_PUBLIC_FEATURES) # ### fixme: For cmake >= 3.3, use if( needle IN_LIST list) list(FIND QtNetwork_enabled_features "ssl" _sslEnabledIndex) diff --git a/sources/pyside2/PySide2/QtOpenGLFunctions/CMakeLists.txt b/sources/pyside2/PySide2/QtOpenGLFunctions/CMakeLists.txt index eab543b6a..383afb68f 100644 --- a/sources/pyside2/PySide2/QtOpenGLFunctions/CMakeLists.txt +++ b/sources/pyside2/PySide2/QtOpenGLFunctions/CMakeLists.txt @@ -3,7 +3,7 @@ project(QtOpenGLFunctions) set(QtOpenGLFunctions_DROPPED_ENTRIES) get_property(QtOpenGLFunctions_enabled_features TARGET Qt${QT_MAJOR_VERSION}::Gui - PROPERTY INTERFACE_QT_ENABLED_FEATURES) + PROPERTY QT_ENABLED_PUBLIC_FEATURES) set(QtOpenGLFunctions_SRC ${QtOpenGLFunctions_GEN_DIR}/qtopenglfunctions_module_wrapper.cpp) diff --git a/sources/pyside2/PySide2/glue/qtcore.cpp b/sources/pyside2/PySide2/glue/qtcore.cpp index d76f2980e..a0ca23662 100644 --- a/sources/pyside2/PySide2/glue/qtcore.cpp +++ b/sources/pyside2/PySide2/glue/qtcore.cpp @@ -2012,3 +2012,13 @@ pthread_cleanup_push(qthread_pthread_cleanup, &gil); pthread_cleanup_pop(0); #endif // @snippet qthread_pthread_cleanup_uninstall + +// @snippet qlibraryinfo_build +#if defined(IS_PY3K) && defined(Py_LIMITED_API) +auto suffix = PyUnicode_FromString(" [limited API]"); +auto oldResult = pyResult; +pyResult = PyUnicode_Concat(pyResult, suffix); +Py_DECREF(oldResult); +Py_DECREF(suffix); +#endif +// @snippet qlibraryinfo_build diff --git a/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp b/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp index 093b2fb68..2364cec7a 100644 --- a/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp +++ b/sources/shiboken2/ApiExtractor/abstractmetabuilder.cpp @@ -1863,7 +1863,9 @@ AbstractMetaFunction *AbstractMetaBuilderPrivate::traverseFunction(const Functio AbstractMetaType *metaType = translateType(arg->type(), currentClass, {}, &errorMessage); if (!metaType) { // If an invalid argument has a default value, simply remove it - if (arg->defaultValue()) { + // unless the function is virtual (since the override in the + // wrapper can then not correctly be generated). + if (arg->defaultValue() && !functionItem->isVirtual()) { if (!currentClass || (currentClass->typeEntry()->codeGeneration() & TypeEntry::GenerateTargetLang)) { diff --git a/sources/shiboken2/ApiExtractor/tests/testdroptypeentries.cpp b/sources/shiboken2/ApiExtractor/tests/testdroptypeentries.cpp index 6abebb922..7b3da182f 100644 --- a/sources/shiboken2/ApiExtractor/tests/testdroptypeentries.cpp +++ b/sources/shiboken2/ApiExtractor/tests/testdroptypeentries.cpp @@ -66,10 +66,12 @@ static const char* xmlCode = "\ void TestDropTypeEntries::testDropEntries() { - QStringList droppedEntries(QLatin1String("Foo.ValueB")); - droppedEntries << QLatin1String("Foo.ObjectB") << QLatin1String("Foo.NamespaceA.InnerClassA"); - droppedEntries << QLatin1String("Foo.NamespaceB") << QLatin1String("Foo.EnumB") << QLatin1String("Foo.funcB()"); - droppedEntries << QLatin1String("Foo.NamespaceA.InnerNamespaceA"); + const QStringList droppedEntries{QLatin1String("Foo.ValueB"), + QLatin1String("ObjectB"), // Check whether module can be omitted + QLatin1String("Foo.NamespaceA.InnerClassA"), + QLatin1String("Foo.NamespaceB"), QLatin1String("Foo.EnumB"), + QLatin1String("Foo.funcB()"), + QLatin1String("Foo.NamespaceA.InnerNamespaceA")}; QScopedPointer<AbstractMetaBuilder> builder(TestUtil::parse(cppCode, xmlCode, false, QString(), droppedEntries)); QVERIFY(!builder.isNull()); diff --git a/sources/shiboken2/ApiExtractor/typesystemparser.cpp b/sources/shiboken2/ApiExtractor/typesystemparser.cpp index ff8f1d59d..207c99c7a 100644 --- a/sources/shiboken2/ApiExtractor/typesystemparser.cpp +++ b/sources/shiboken2/ApiExtractor/typesystemparser.cpp @@ -1070,19 +1070,23 @@ static bool convertRemovalAttribute(QStringView remove, Modification& mod, QStri return false; } -static void getNamePrefixRecursive(StackElement* element, QStringList& names) -{ - if (!element->parent || !element->parent->entry) - return; - getNamePrefixRecursive(element->parent, names); - names << element->parent->entry->name(); -} - -static QString getNamePrefix(StackElement* element) -{ - QStringList names; - getNamePrefixRecursive(element, names); - return names.join(QLatin1Char('.')); +// Check whether an entry should be dropped, allowing for dropping the module +// name (match 'Class' and 'Module.Class'). +static bool shouldDropTypeEntry(const TypeDatabase *db, + const StackElement *element, + QString name) +{ + for (auto e = element->parent; e ; e = e->parent) { + if (e->entry) { + if (e->entry->type() == TypeEntry::TypeSystemType) { + if (db->shouldDropTypeEntry(name)) // Unqualified + return true; + } + name.prepend(QLatin1Char('.')); + name.prepend(e->entry->name()); + } + } + return db->shouldDropTypeEntry(name); } // Returns empty string if there's no error. @@ -2728,11 +2732,9 @@ bool TypeSystemParser::startElement(const QXmlStreamReader &reader) } if (m_database->hasDroppedTypeEntries()) { - QString identifier = getNamePrefix(element) + QLatin1Char('.'); - identifier += element->type == StackElement::FunctionTypeEntry - ? attributes.value(signatureAttribute()).toString() - : name; - if (m_database->shouldDropTypeEntry(identifier)) { + const QString identifier = element->type == StackElement::FunctionTypeEntry + ? attributes.value(signatureAttribute()).toString() : name; + if (shouldDropTypeEntry(m_database, element, identifier)) { m_currentDroppedEntry = element; m_currentDroppedEntryDepth = 1; if (ReportHandler::isDebug(ReportHandler::SparseDebug)) { diff --git a/sources/shiboken2/doc/shibokengenerator.rst b/sources/shiboken2/doc/shibokengenerator.rst index b15ad5ada..c3000ac09 100644 --- a/sources/shiboken2/doc/shibokengenerator.rst +++ b/sources/shiboken2/doc/shibokengenerator.rst @@ -123,7 +123,9 @@ Options ``--drop-type-entries="<TypeEntry0>[;TypeEntry1;...]"`` Semicolon separated list of type system entries (classes, namespaces, - global functions and enums) to be dropped from generation. + global functions and enums) to be dropped from generation. Values are + fully qualified Python type names ('Module.Class'), but the module can + be omitted ('Class'). .. _generation-set: |