From 27f7689d1156e38c79a3547117f6340e90d5e7c5 Mon Sep 17 00:00:00 2001 From: Iakov 'Jake' Kirilenko Date: Fri, 30 Aug 2024 18:34:46 +0300 Subject: [PATCH 1/3] Force c++17 for new Qt's, but c++11 for older compilers and Qt's For example, in AltLinux GCC does not know about -std=c++2b --- build/common.prf | 1 + src/src.pri | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/build/common.prf b/build/common.prf index 694e2562a..12df1de2f 100644 --- a/build/common.prf +++ b/build/common.prf @@ -55,6 +55,7 @@ isEmpty(PYTHONQT_GENERATED_PATH) { } VERSION = 3.2.0 +greaterThan(QT_MAJOR_VERSION, 5) | greaterThan(QT_MINOR_VERSION, 9): CONFIG += c++17 c++11 win32: CONFIG += skip_target_version_ext gcc|win32-clang-msvc:QMAKE_CXXFLAGS += -Wno-deprecated-declarations -Wuninitialized -Winit-self -pedantic win32-clang-msvc:QMAKE_CXXFLAGS += -Wno-unused-command-line-argument diff --git a/src/src.pri b/src/src.pri index 68f5bfb23..dbe3d43b7 100644 --- a/src/src.pri +++ b/src/src.pri @@ -2,7 +2,7 @@ DEFINES += PYTHONQT_EXPORTS INCLUDEPATH += $$PWD -CONFIG += c++11 +CONFIG += c++11 c++17 gcc:!no_warn:!clang:QMAKE_CXXFLAGS += -Wno-error=missing-field-initializers *-clang*:!no_warn:QMAKE_CXXFLAGS += -Wno-error=sometimes-uninitialized From 47c73c7ed9e4acdd2f09860888a9b802d2adec48 Mon Sep 17 00:00:00 2001 From: iakov Date: Sun, 15 Sep 2019 17:47:25 +0300 Subject: [PATCH 2/3] Return lost fix for class lookup --- src/PythonQt.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/PythonQt.cpp b/src/PythonQt.cpp index e5c4a93a6..b8fac6694 100644 --- a/src/PythonQt.cpp +++ b/src/PythonQt.cpp @@ -2643,6 +2643,24 @@ PythonQtClassInfo* PythonQtPrivate::getClassInfo( const QByteArray& className ) } } } + + if (!result) { + bool ambiguity = false; + for(auto &&key: _knownClassInfos.keys()) { + if (key.indexOf(QByteArray("::") + className) >= 0) { + if (!result) { + result = _knownClassInfos.value(key); + } else { + ambiguity = true; + std::cerr << "Multiple candidates found" << std::endl; + } + } + } + if (ambiguity) { + return nullptr; + } + } + return result; } From 9cdbd73f73444f5344fbba6306ef7bf0fa285b8c Mon Sep 17 00:00:00 2001 From: iakov Date: Fri, 30 Aug 2024 14:17:05 +0300 Subject: [PATCH 3/3] shell_path is a mistake In msys shell with MinGW Qt5 on GHA it converts path to `/c/hostedtoolscache` , but `gcc` does not recognize this path --- build/python.prf | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/build/python.prf b/build/python.prf index aec051e90..9d61cf109 100644 --- a/build/python.prf +++ b/build/python.prf @@ -66,11 +66,10 @@ contains(PKGCONFIG, "python.*"){ isEmpty(PYTHON_PATH):PYTHON_PATH=$(PYTHON_PATH) isEmpty(PYTHON_PATH)|!exists("$$PYTHON_PATH\\include") | !exists("$$PYTHON_PATH\\libs\\") { error("PYTHON_PATH must be set to correct folder with \\libs and \\include subfolders ") - } - - INCLUDEPATH += $$shell_path($${PYTHON_PATH}/include) + } + INCLUDEPATH += $${PYTHON_PATH}/include - LIBS += $$shell_path(-L$${PYTHON_PATH}/libs) + LIBS += -L$${PYTHON_PATH}/libs LIBS += -lpython$${PYTHON_VERSION_MAJOR}$${PYTHON_VERSION_MINOR}$${DEBUG_EXT} # Hack for "CONFIG+=testcase" and 'make check' to add python's dll to PATH