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/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 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; } 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