diff --git a/CMakeLists.txt b/CMakeLists.txt index a2ab8bde2..9ca37dab7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -154,11 +154,13 @@ if (BUILD_PYTHON_SUPPORT) # Optional: PySide6 find_package(PySide6 "6.4.0") find_package(Shiboken6 "6.4.0") + find_package(Shiboken6Tools "6.4.0") find_package(Python3 COMPONENTS Development) set_package_properties(PySide6 PROPERTIES DESCRIPTION "Python plugins" TYPE OPTIONAL) set_package_properties(Shiboken6 PROPERTIES DESCRIPTION "Python plugins" TYPE OPTIONAL) + set_package_properties(Shiboken6Tools PROPERTIES DESCRIPTION "Python plugins" TYPE OPTIONAL) set_package_properties(Python3 PROPERTIES DESCRIPTION "Python plugins" TYPE OPTIONAL) - if (PySide6_FOUND AND Shiboken6_FOUND AND Python3_FOUND) + if (PySide6_FOUND AND Shiboken6_FOUND AND Shiboken6Tools_FOUND AND Python3_FOUND) set(ENABLE_PYTHON_PLUGINS TRUE) endif() else() diff --git a/src/plugins/PyFalkon/CMakeLists.txt b/src/plugins/PyFalkon/CMakeLists.txt index b0edcd924..e94bafcfe 100644 --- a/src/plugins/PyFalkon/CMakeLists.txt +++ b/src/plugins/PyFalkon/CMakeLists.txt @@ -20,6 +20,10 @@ set(QT_INCLUDE_DIRS ${QT_WEBENGINECORE_INCLUDE_DIRS} ${QT_WEBENGINEWIDGETS_INCLUDE_DIRS} ) +if (QT_MAJOR_VERSION STREQUAL "6") + get_property(QT_PRINTSUPPORT_INCLUDE_DIRS TARGET Qt${QT_MAJOR_VERSION}::PrintSupport PROPERTY INTERFACE_INCLUDE_DIRECTORIES) + list(APPEND QT_INCLUDE_DIRS ${QT_PRINTSUPPORT_INCLUDE_DIRS}) +endif() set(INCLUDES "") foreach(INCLUDE_DIR ${QT_INCLUDE_DIRS}) list(APPEND INCLUDES "-I${INCLUDE_DIR}") @@ -33,13 +37,19 @@ endforeach() set(GLOBAL_HEADER ${CMAKE_CURRENT_SOURCE_DIR}/pyfalkon_global.h) set(TYPESYSTEM_FILE ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_pyfalkon.xml) +if (QT_MAJOR_VERSION STREQUAL "6") + set(API_VERSION "${Qt6_VERSION_MAJOR}.${Qt6_VERSION_MINOR}") +else() + set(API_VERSION "${Qt5_VERSION_MAJOR}.${Qt5_VERSION_MINOR}") +endif() + set(SHIBOKEN_OPTIONS --generator-set=shiboken --enable-parent-ctor-heuristic --enable-pyside-extensions --enable-return-value-heuristic --use-isnull-as-nb_nonzero --avoid-protected-hack ${INCLUDES} -T${PYSIDE_TYPESYSTEMS} --output-directory=${CMAKE_CURRENT_BINARY_DIR} - --api-version="${Qt5_VERSION_MAJOR}.${Qt5_VERSION_MINOR}" + --api-version="${API_VERSION}" ) # Specify which sources will be generated by shiboken, and their dependencies. diff --git a/src/plugins/PyFalkon/pyfalkon_global.h b/src/plugins/PyFalkon/pyfalkon_global.h index b064dce0c..1b139a3bc 100644 --- a/src/plugins/PyFalkon/pyfalkon_global.h +++ b/src/plugins/PyFalkon/pyfalkon_global.h @@ -21,7 +21,11 @@ // PYSIDE-711 #include +#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) #include +#else +#include +#endif // 3rdparty #include "lineedit.h" diff --git a/src/plugins/PyFalkon/typesystem_pyfalkon.xml b/src/plugins/PyFalkon/typesystem_pyfalkon.xml index 006bb0083..e48017957 100644 --- a/src/plugins/PyFalkon/typesystem_pyfalkon.xml +++ b/src/plugins/PyFalkon/typesystem_pyfalkon.xml @@ -125,7 +125,9 @@ - + + + @@ -256,7 +258,7 @@ QList<QByteArray> version = QByteArray(Qz::VERSION).split('.'); PyObject *pyFalkonVersion = PyTuple_New(3); for (int i = 0; i < 3; ++i) - PyTuple_SET_ITEM(pyFalkonVersion, i, PyInt_FromLong(version[i].toInt())); + PyTuple_SET_ITEM(pyFalkonVersion, i, PyLong_FromLong(version[i].toInt())); PyModule_AddObject(module, "__version_info__", pyFalkonVersion); PyModule_AddStringConstant(module, "__version__", Qz::VERSION);