mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 02:36:34 +01:00
Build with pyside6.
This commit is contained in:
parent
d10379268b
commit
73554c230b
@ -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()
|
||||
|
@ -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.
|
||||
|
@ -21,7 +21,11 @@
|
||||
|
||||
// PYSIDE-711
|
||||
#include <QHstsPolicy>
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||
#include <QWebEngineContextMenuData>
|
||||
#else
|
||||
#include <QWebEngineContextMenuRequest>
|
||||
#endif
|
||||
|
||||
// 3rdparty
|
||||
#include "lineedit.h"
|
||||
|
@ -125,7 +125,9 @@
|
||||
</object-type>
|
||||
<object-type name="NavigationBar"/>
|
||||
|
||||
<object-type name="NetworkManager"/>
|
||||
<object-type name="NetworkManager">
|
||||
<modify-function signature="certificateError(QWebEngineCertificateError&, QWidget*)" remove="all"/>
|
||||
</object-type>
|
||||
<object-type name="UrlInterceptor"/>
|
||||
<object-type name="ExtensionSchemeHandler">
|
||||
<include file-name="schemehandlers/extensionschemehandler.h" location="global"/>
|
||||
@ -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);
|
||||
</inject-code>
|
||||
|
Loading…
Reference in New Issue
Block a user