From 3e27ac59852d49418fddb6642121a21787ed8cb6 Mon Sep 17 00:00:00 2001 From: Julien Cabieces Date: Thu, 7 Dec 2023 11:51:32 +0100 Subject: [PATCH] [PyQt6] Build PyQt6 --- CMakeLists.txt | 2 +- cmake/SIPMacros.cmake | 2 +- python/3d/__init__.py.in | 2 ++ python/CMakeLists.txt | 33 ++++++++++++------- python/PyQt6/3d/pyproject.toml.in | 2 +- python/PyQt6/analysis/__init__.py.in | 3 ++ python/PyQt6/analysis/pyproject.toml.in | 2 +- python/PyQt6/core/__init__.py.in | 7 ++-- python/PyQt6/core/pyproject.toml.in | 2 +- python/PyQt6/gui/__init__.py.in | 4 ++- python/PyQt6/gui/pyproject.toml.in | 2 +- python/PyQt6/server/__init__.py.in | 2 ++ python/PyQt6/server/pyproject.toml.in | 2 +- python/analysis/__init__.py.in | 2 ++ python/core/__init__.py.in | 2 ++ python/gui/__init__.py.in | 4 ++- ...sole_pap.py => generate_console_pap.py.in} | 12 ++++--- python/server/__init__.py.in | 2 ++ 18 files changed, 57 insertions(+), 30 deletions(-) rename python/qsci_apis/{generate_console_pap.py => generate_console_pap.py.in} (91%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 751b94b361f..c40151076df 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1086,7 +1086,7 @@ if (WITH_CORE AND WITH_BINDINGS) include(SIPMacros) set(SIP_INCLUDES ${PYQT_SIP_DIR} ${CMAKE_SOURCE_DIR}/python) - set(SIP_CONCAT_PARTS 22) + set(SIP_CONCAT_PARTS 26) if (NOT BINDINGS_GLOBAL_INSTALL) set(Python_SITEARCH ${QGIS_DATA_DIR}/python) diff --git a/cmake/SIPMacros.cmake b/cmake/SIPMacros.cmake index a0bfb1e6e22..24426130e93 100644 --- a/cmake/SIPMacros.cmake +++ b/cmake/SIPMacros.cmake @@ -60,7 +60,7 @@ MACRO(GENERATE_SIP_PYTHON_MODULE_CODE MODULE_NAME MODULE_SIP SIP_FILES CPP_FILES FOREACH (_sip_file ${SIP_FILES}) GET_FILENAME_COMPONENT(_sip_file_path ${_sip_file} PATH) GET_FILENAME_COMPONENT(_sip_file_name_we ${_sip_file} NAME_WE) - FILE(RELATIVE_PATH _sip_file_relpath ${CMAKE_CURRENT_SOURCE_DIR} "${_sip_file_path}/${_sip_file_name_we}") + FILE(RELATIVE_PATH _sip_file_relpath ${BINDING_FILES_ROOT_DIR} "${_sip_file_path}/${_sip_file_name_we}") SET(_out_sip_file "${CMAKE_CURRENT_BINARY_DIR}/${_sip_file_relpath}.sip") CONFIGURE_FILE(${_sip_file} ${_out_sip_file}) ENDFOREACH (_sip_file) diff --git a/python/3d/__init__.py.in b/python/3d/__init__.py.in index 6035e780882..df723918120 100644 --- a/python/3d/__init__.py.in +++ b/python/3d/__init__.py.in @@ -24,6 +24,8 @@ __copyright__ = '(C) 2014, Nathan Woodrow' from qgis.PyQt import QtCore from qgis._3d import * +@MONKEYPATCH_INJECTIONS@ + from qgis.core import Qgis # manual monkey patching for old enum values Qgs3DTypes.AltitudeClamping = Qgis.AltitudeClamping diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 01075332d7d..978b37e8812 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -136,14 +136,16 @@ endif() IF(BUILD_WITH_QT6) SET(QSCI_SIP_MOD_NAME Qsci/qscimod6.sip) + SET(BINDING_FILES_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/PyQt6) ELSE() SET(QSCI_SIP_MOD_NAME Qsci/qscimod5.sip) + SET(BINDING_FILES_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}) ENDIF() set(QGIS_PYTHON_DIR ${Python_SITEARCH}/qgis) # core module -file(GLOB_RECURSE sip_files_core core/*.sip core/*.sip.in) +file(GLOB_RECURSE sip_files_core ${BINDING_FILES_ROOT_DIR}/core/*.sip ${BINDING_FILES_ROOT_DIR}/core/*.sip.in) set(SIP_EXTRA_FILES_DEPEND ${sip_files_core}) set(SIP_EXTRA_OPTIONS ${PYQT_SIP_FLAGS} -g -o -a ${CMAKE_BINARY_DIR}/python/qgis.core.api) if((${SIP_VERSION_STR} VERSION_EQUAL 4.19.11) OR (${SIP_VERSION_STR} VERSION_GREATER 4.19.11)) @@ -202,7 +204,7 @@ endif() if (WITH_GUI) set(PY_MODULES ${PY_MODULES} gui) - file(GLOB_RECURSE sip_files_gui gui/*.sip gui/*.sip.in) + file(GLOB_RECURSE sip_files_gui ${BINDING_FILES_ROOT_DIR}/gui/*.sip ${BINDING_FILES_ROOT_DIR}/gui/*.sip.in) set(SIP_EXTRA_FILES_DEPEND ${sip_files_core} ${sip_files_gui}) set(SIP_EXTRA_OPTIONS ${PYQT_SIP_FLAGS} -g -o -a ${CMAKE_BINARY_DIR}/python/qgis.gui.api) if((${SIP_VERSION_STR} VERSION_EQUAL 4.19.11) OR (${SIP_VERSION_STR} VERSION_GREATER 4.19.11)) @@ -239,7 +241,7 @@ if (WITH_3D) ) set(PY_MODULES ${PY_MODULES} 3d) - file(GLOB_RECURSE sip_files_3d 3d/*.sip 3d/*.sip.in) + file(GLOB_RECURSE sip_files_3d ${BINDING_FILES_ROOT_DIR}/3d/*.sip ${BINDING_FILES_ROOT_DIR}/3d/*.sip.in) set(SIP_EXTRA_FILES_DEPEND ${sip_files_core} ${sip_files_3d}) set(SIP_EXTRA_OPTIONS ${PYQT_SIP_FLAGS} -g -o -a ${CMAKE_BINARY_DIR}/python/qgis.3d.api) if((${SIP_VERSION_STR} VERSION_EQUAL 4.19.11) OR (${SIP_VERSION_STR} VERSION_GREATER 4.19.11)) @@ -267,7 +269,7 @@ if (WITH_SERVER AND WITH_SERVER_PLUGINS) set(PY_MODULES ${PY_MODULES} server) - file(GLOB_RECURSE sip_files_server server/*.sip server/*.sip.in) + file(GLOB_RECURSE sip_files_server ${BINDING_FILES_ROOT_DIR}/server/*.sip ${BINDING_FILES_ROOT_DIR}/server/*.sip.in) set(SIP_EXTRA_FILES_DEPEND ${sip_files_core} ${sip_files_server}) set(SIP_EXTRA_OPTIONS ${PYQT_SIP_FLAGS} -g -o -a ${CMAKE_BINARY_DIR}/python/qgis.server.api) if((${SIP_VERSION_STR} VERSION_EQUAL 4.19.11) OR (${SIP_VERSION_STR} VERSION_GREATER 4.19.11)) @@ -303,7 +305,7 @@ if(WITH_ANALYSIS) ) # analysis module - file(GLOB_RECURSE sip_files_analysis analysis/*.sip analysis/*.sip.in) + file(GLOB_RECURSE sip_files_analysis ${BINDING_FILES_ROOT_DIR}/analysis/*.sip ${BINDING_FILES_ROOT_DIR}/analysis/*.sip.in) set(SIP_EXTRA_FILES_DEPEND ${sip_files_core} ${sip_files_analysis}) set(SIP_EXTRA_OPTIONS ${PYQT_SIP_FLAGS} -g -o -a ${CMAKE_BINARY_DIR}/python/qgis.analysis.api) @@ -356,10 +358,13 @@ if(WITH_QSCIAPI) else() set(_python ${Python_EXECUTABLE}) endif() + + configure_file("${APIS_SRC_DIR}/generate_console_pap.py.in" ${CMAKE_BINARY_DIR}/generate_console_pap.py) + add_custom_command( OUTPUT "${QGIS_PYTHON_PAP_FILE}" DEPENDS "${QGIS_PYTHON_API_FILE}" - COMMAND ${_python} "${APIS_SRC_DIR}/generate_console_pap.py" -platform offscreen "${QGIS_PYTHON_PAP_FILE}" "${APIS_SRC_DIR}" "${APIS_OUT_DIR}" + COMMAND ${_python} "${CMAKE_BINARY_DIR}/generate_console_pap.py" -platform offscreen "${QGIS_PYTHON_PAP_FILE}" "${APIS_SRC_DIR}" "${APIS_OUT_DIR}" WORKING_DIRECTORY "${CMAKE_BINARY_DIR}" COMMENT "Generating pap file for console auto-completion" VERBATIM) @@ -399,21 +404,25 @@ foreach(module ${PY_MODULES}) add_dependencies(py${module} python_module_qgis__${module}) # concat auto_additions/*.py in _module_/__init__.py - file(GLOB PY_FILES_AUTO_ADDITIONS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${module}/auto_additions/*.py) - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${module}/__init__.py.in ${QGIS_PYTHON_OUTPUT_DIRECTORY}/${module}/__init__.py COPYONLY) + file(GLOB PY_FILES_AUTO_ADDITIONS ${BINDING_FILES_ROOT_DIR}/${module}/auto_additions/*.py) + set(MONKEYPATCH_INJECTIONS "") foreach(pyfile ${PY_FILES_AUTO_ADDITIONS}) file(READ ${pyfile} CONTENTS) - file(APPEND ${QGIS_PYTHON_OUTPUT_DIRECTORY}/${module}/__init__.py "${CONTENTS}") + string(APPEND MONKEYPATCH_INJECTIONS "${CONTENTS}") endforeach(pyfile) + configure_file(${BINDING_FILES_ROOT_DIR}/${module}/__init__.py.in ${QGIS_PYTHON_OUTPUT_DIRECTORY}/${module}/__init__.py @ONLY) install(FILES ${QGIS_PYTHON_OUTPUT_DIRECTORY}/${module}/__init__.py DESTINATION "${QGIS_PYTHON_DIR}/${module}") - file(GLOB PY_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${module}/*.py) + file(GLOB PY_FILES ${BINDING_FILES_ROOT_DIR}/${module}/*.py) install(FILES ${PY_FILES} DESTINATION "${QGIS_PYTHON_DIR}/${module}") - file(GLOB PY_FILES_ADDITIONS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${module}/additions/*.py) + file(GLOB PY_FILES_ADDITIONS ${BINDING_FILES_ROOT_DIR}/${module}/additions/*.py) + install(FILES ${PY_FILES_ADDITIONS} DESTINATION "${QGIS_PYTHON_DIR}/${module}/additions") set(PY_FILES ${PY_FILES} ${PY_FILES_ADDITIONS}) foreach(pyfile ${PY_FILES}) - get_filename_component(subdir ${pyfile} DIRECTORY) + file(RELATIVE_PATH rel_pyfile ${BINDING_FILES_ROOT_DIR} ${pyfile}) + get_filename_component(subdir ${rel_pyfile} DIRECTORY) + add_custom_command(TARGET py${module} POST_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory "${QGIS_PYTHON_OUTPUT_DIRECTORY}/${subdir}" diff --git a/python/PyQt6/3d/pyproject.toml.in b/python/PyQt6/3d/pyproject.toml.in index 9c58a933b89..b2bede3ac03 100644 --- a/python/PyQt6/3d/pyproject.toml.in +++ b/python/PyQt6/3d/pyproject.toml.in @@ -11,4 +11,4 @@ summary = "Python bindings for QGIS" home-page = "https://qgis.org" author = "The QGIS Community" license = "GPL v2" -requires-dist = "PyQt5" +requires-dist = "PyQt6" diff --git a/python/PyQt6/analysis/__init__.py.in b/python/PyQt6/analysis/__init__.py.in index 55f7a7cc9c4..e9c6442b73d 100644 --- a/python/PyQt6/analysis/__init__.py.in +++ b/python/PyQt6/analysis/__init__.py.in @@ -27,6 +27,7 @@ from qgis._analysis import * # preserve API compatibility following QgsExifTools moved to core from qgis.core import QgsExifTools + # preserve API compatibility as QgsAlignRaster.Item moved to QgsAlignRasterData.RasterItem from qgis.core import QgsAlignRasterData @@ -74,3 +75,5 @@ QgsAlignRaster.RA_Q3.__doc__ = "Third quartile (selects the third quartile of al Qgis.GdalResampleAlgorithm.__doc__ = "Resampling algorithm to be used (equivalent to GDAL's enum GDALResampleAlg)\n\n.. note::\n\n RA_Max, RA_Min, RA_Median, RA_Q1 and RA_Q3 are available on GDAL >= 2.0 builds only\n\n.. versionadded:: 3.34\n\n" + '* ``RA_NearestNeighbour``: ' + Qgis.GdalResampleAlgorithm.RA_NearestNeighbour.__doc__ + '\n' + '* ``RA_Bilinear``: ' + Qgis.GdalResampleAlgorithm.RA_Bilinear.__doc__ + '\n' + '* ``RA_Cubic``: ' + Qgis.GdalResampleAlgorithm.RA_Cubic.__doc__ + '\n' + '* ``RA_CubicSpline``: ' + Qgis.GdalResampleAlgorithm.RA_CubicSpline.__doc__ + '\n' + '* ``RA_Lanczos``: ' + Qgis.GdalResampleAlgorithm.RA_Lanczos.__doc__ + '\n' + '* ``RA_Average``: ' + Qgis.GdalResampleAlgorithm.RA_Average.__doc__ + '\n' + '* ``RA_Mode``: ' + Qgis.GdalResampleAlgorithm.RA_Mode.__doc__ + '\n' + '* ``RA_Max``: ' + Qgis.GdalResampleAlgorithm.RA_Max.__doc__ + '\n' + '* ``RA_Min``: ' + Qgis.GdalResampleAlgorithm.RA_Min.__doc__ + '\n' + '* ``RA_Median``: ' + Qgis.GdalResampleAlgorithm.RA_Median.__doc__ + '\n' + '* ``RA_Q1``: ' + Qgis.GdalResampleAlgorithm.RA_Q1.__doc__ + '\n' + '* ``RA_Q3``: ' + Qgis.GdalResampleAlgorithm.RA_Q3.__doc__ # -- Qgis.GdalResampleAlgorithm.baseClass = Qgis + +@MONKEYPATCH_INJECTIONS@ diff --git a/python/PyQt6/analysis/pyproject.toml.in b/python/PyQt6/analysis/pyproject.toml.in index 9c58a933b89..b2bede3ac03 100644 --- a/python/PyQt6/analysis/pyproject.toml.in +++ b/python/PyQt6/analysis/pyproject.toml.in @@ -11,4 +11,4 @@ summary = "Python bindings for QGIS" home-page = "https://qgis.org" author = "The QGIS Community" license = "GPL v2" -requires-dist = "PyQt5" +requires-dist = "PyQt6" diff --git a/python/PyQt6/core/__init__.py.in b/python/PyQt6/core/__init__.py.in index 0b55cfc9fa2..3273d4bf0f2 100644 --- a/python/PyQt6/core/__init__.py.in +++ b/python/PyQt6/core/__init__.py.in @@ -24,6 +24,8 @@ __copyright__ = '(C) 2014, Nathan Woodrow' from qgis.PyQt.QtCore import NULL from qgis._core import * +@MONKEYPATCH_INJECTIONS@ + from .additions.edit import edit, QgsEditError from .additions.fromfunction import fromFunction from .additions.metaenum import metaEnumFromType, metaEnumFromValue @@ -92,11 +94,6 @@ QgsVectorLayer.NoMarker = Qgis.VertexMarkerType.NoMarker QgsVectorLayer.NoMarker.is_monkey_patched = True QgsVectorLayer.NoMarker.__doc__ = "No marker" -QgsSymbol.RenderHints = Qgis.SymbolRenderHints -QgsSymbol.PreviewFlags = Qgis.SymbolPreviewFlags -QgsDataItem.Capabilities = Qgis.BrowserItemCapabilities -QgsGeometry.ValidityFlags = Qgis.GeometryValidityFlags - # Monkey patch static const "QgsDataProvider.SUBLAYER_SEPARATOR" which was removed for QGIS 3.12 QgsDataProvider.SUBLAYER_SEPARATOR = QgsDataProvider.sublayerSeparator() diff --git a/python/PyQt6/core/pyproject.toml.in b/python/PyQt6/core/pyproject.toml.in index 9c58a933b89..b2bede3ac03 100644 --- a/python/PyQt6/core/pyproject.toml.in +++ b/python/PyQt6/core/pyproject.toml.in @@ -11,4 +11,4 @@ summary = "Python bindings for QGIS" home-page = "https://qgis.org" author = "The QGIS Community" license = "GPL v2" -requires-dist = "PyQt5" +requires-dist = "PyQt6" diff --git a/python/PyQt6/gui/__init__.py.in b/python/PyQt6/gui/__init__.py.in index acbe197441d..f1e54c39e48 100644 --- a/python/PyQt6/gui/__init__.py.in +++ b/python/PyQt6/gui/__init__.py.in @@ -23,7 +23,9 @@ __copyright__ = '(C) 2014, Nathan Woodrow' from qgis.PyQt import QtCore from qgis._gui import * -from qgis._core import Qgis +from qgis.core import Qgis + +@MONKEYPATCH_INJECTIONS@ # monkey patching scoped based enum QgsMapToolCapture.CaptureTechnique = Qgis.CaptureTechnique diff --git a/python/PyQt6/gui/pyproject.toml.in b/python/PyQt6/gui/pyproject.toml.in index 9c58a933b89..b2bede3ac03 100644 --- a/python/PyQt6/gui/pyproject.toml.in +++ b/python/PyQt6/gui/pyproject.toml.in @@ -11,4 +11,4 @@ summary = "Python bindings for QGIS" home-page = "https://qgis.org" author = "The QGIS Community" license = "GPL v2" -requires-dist = "PyQt5" +requires-dist = "PyQt6" diff --git a/python/PyQt6/server/__init__.py.in b/python/PyQt6/server/__init__.py.in index 9eb97a19a82..30f7ab0e671 100644 --- a/python/PyQt6/server/__init__.py.in +++ b/python/PyQt6/server/__init__.py.in @@ -24,3 +24,5 @@ __copyright__ = '(C) 2014, Alessandro Pasotti' from qgis.PyQt import QtCore # NOQA from qgis._server import * # NOQA + +@MONKEYPATCH_INJECTIONS@ diff --git a/python/PyQt6/server/pyproject.toml.in b/python/PyQt6/server/pyproject.toml.in index 9c58a933b89..b2bede3ac03 100644 --- a/python/PyQt6/server/pyproject.toml.in +++ b/python/PyQt6/server/pyproject.toml.in @@ -11,4 +11,4 @@ summary = "Python bindings for QGIS" home-page = "https://qgis.org" author = "The QGIS Community" license = "GPL v2" -requires-dist = "PyQt5" +requires-dist = "PyQt6" diff --git a/python/analysis/__init__.py.in b/python/analysis/__init__.py.in index 55f7a7cc9c4..9bab743870c 100644 --- a/python/analysis/__init__.py.in +++ b/python/analysis/__init__.py.in @@ -74,3 +74,5 @@ QgsAlignRaster.RA_Q3.__doc__ = "Third quartile (selects the third quartile of al Qgis.GdalResampleAlgorithm.__doc__ = "Resampling algorithm to be used (equivalent to GDAL's enum GDALResampleAlg)\n\n.. note::\n\n RA_Max, RA_Min, RA_Median, RA_Q1 and RA_Q3 are available on GDAL >= 2.0 builds only\n\n.. versionadded:: 3.34\n\n" + '* ``RA_NearestNeighbour``: ' + Qgis.GdalResampleAlgorithm.RA_NearestNeighbour.__doc__ + '\n' + '* ``RA_Bilinear``: ' + Qgis.GdalResampleAlgorithm.RA_Bilinear.__doc__ + '\n' + '* ``RA_Cubic``: ' + Qgis.GdalResampleAlgorithm.RA_Cubic.__doc__ + '\n' + '* ``RA_CubicSpline``: ' + Qgis.GdalResampleAlgorithm.RA_CubicSpline.__doc__ + '\n' + '* ``RA_Lanczos``: ' + Qgis.GdalResampleAlgorithm.RA_Lanczos.__doc__ + '\n' + '* ``RA_Average``: ' + Qgis.GdalResampleAlgorithm.RA_Average.__doc__ + '\n' + '* ``RA_Mode``: ' + Qgis.GdalResampleAlgorithm.RA_Mode.__doc__ + '\n' + '* ``RA_Max``: ' + Qgis.GdalResampleAlgorithm.RA_Max.__doc__ + '\n' + '* ``RA_Min``: ' + Qgis.GdalResampleAlgorithm.RA_Min.__doc__ + '\n' + '* ``RA_Median``: ' + Qgis.GdalResampleAlgorithm.RA_Median.__doc__ + '\n' + '* ``RA_Q1``: ' + Qgis.GdalResampleAlgorithm.RA_Q1.__doc__ + '\n' + '* ``RA_Q3``: ' + Qgis.GdalResampleAlgorithm.RA_Q3.__doc__ # -- Qgis.GdalResampleAlgorithm.baseClass = Qgis + +@MONKEYPATCH_INJECTIONS@ diff --git a/python/core/__init__.py.in b/python/core/__init__.py.in index 0b55cfc9fa2..8bc3b7cbf86 100644 --- a/python/core/__init__.py.in +++ b/python/core/__init__.py.in @@ -24,6 +24,8 @@ __copyright__ = '(C) 2014, Nathan Woodrow' from qgis.PyQt.QtCore import NULL from qgis._core import * +@MONKEYPATCH_INJECTIONS@ + from .additions.edit import edit, QgsEditError from .additions.fromfunction import fromFunction from .additions.metaenum import metaEnumFromType, metaEnumFromValue diff --git a/python/gui/__init__.py.in b/python/gui/__init__.py.in index acbe197441d..f1e54c39e48 100644 --- a/python/gui/__init__.py.in +++ b/python/gui/__init__.py.in @@ -23,7 +23,9 @@ __copyright__ = '(C) 2014, Nathan Woodrow' from qgis.PyQt import QtCore from qgis._gui import * -from qgis._core import Qgis +from qgis.core import Qgis + +@MONKEYPATCH_INJECTIONS@ # monkey patching scoped based enum QgsMapToolCapture.CaptureTechnique = Qgis.CaptureTechnique diff --git a/python/qsci_apis/generate_console_pap.py b/python/qsci_apis/generate_console_pap.py.in similarity index 91% rename from python/qsci_apis/generate_console_pap.py rename to python/qsci_apis/generate_console_pap.py.in index 82b0eafb488..dd03deb656e 100644 --- a/python/qsci_apis/generate_console_pap.py +++ b/python/qsci_apis/generate_console_pap.py.in @@ -22,9 +22,9 @@ Portions of this file contain code from Eric4 APIsManager module. import sys import os -from PyQt5.Qsci import QsciLexerPython, QsciAPIs -from PyQt5.QtWidgets import QApplication -from PyQt5.QtCore import QObject +from PyQt@QT_VERSION_MAJOR@.Qsci import QsciLexerPython, QsciAPIs +from PyQt@QT_VERSION_MAJOR@.QtWidgets import QApplication +from PyQt@QT_VERSION_MAJOR@.QtCore import QObject class PrepareAPIs(QObject): @@ -92,4 +92,8 @@ if __name__ == '__main__': prepap = PrepareAPIs(api_lexer, api_files, pap_file) prepap.prepareAPI() - sys.exit(app.exec_()) + # TODO QGIS 4.0: remove + if (@QT_VERSION_MAJOR@ < 6): + sys.exit(app.exec_()) + else: + sys.exit(app.exec()) diff --git a/python/server/__init__.py.in b/python/server/__init__.py.in index 9eb97a19a82..30f7ab0e671 100644 --- a/python/server/__init__.py.in +++ b/python/server/__init__.py.in @@ -24,3 +24,5 @@ __copyright__ = '(C) 2014, Alessandro Pasotti' from qgis.PyQt import QtCore # NOQA from qgis._server import * # NOQA + +@MONKEYPATCH_INJECTIONS@