From 63cacc4411cd52e359e1867532524ee816248b61 Mon Sep 17 00:00:00 2001 From: Renato Filho Date: Wed, 8 Sep 2010 19:32:33 -0300 Subject: Created module shutdown function necessary to avoid call python functions before module exit. Reviewer: Luciano Wolf Hugo Parente Lima --- PySide/CMakeLists.txt | 6 +++++- PySide/QtCore/typesystem_core.xml | 7 +++++++ PySide/__init__.py | 1 + PySide/private.py | 4 ++++ 4 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 PySide/private.py (limited to 'PySide') diff --git a/PySide/CMakeLists.txt b/PySide/CMakeLists.txt index e4b6a1d8c..66621befe 100644 --- a/PySide/CMakeLists.txt +++ b/PySide/CMakeLists.txt @@ -1,5 +1,5 @@ project(pyside) -install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/__init__.py" +install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/__init__.py" "${CMAKE_CURRENT_SOURCE_DIR}/private.py" DESTINATION "${SITE_PACKAGE}/${BINDING_NAME}") macro(execute_generator module sources typesystem_path) @@ -106,6 +106,10 @@ endmacro() execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/__init__.py" "${CMAKE_BINARY_DIR}/PySide/__init__.py") + +execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/private.py" + "${CMAKE_BINARY_DIR}/PySide/private.py") +# # Try to find QtMultimedia # TODO: Remove this hack when cmake support QtMultimedia module if (NOT QT_QTMULTIMEDIA_FOUND AND ${QTVERSION} VERSION_GREATER 4.5.9) diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml index 1e7d18329..8fdb0e5fd 100644 --- a/PySide/QtCore/typesystem_core.xml +++ b/PySide/QtCore/typesystem_core.xml @@ -520,6 +520,7 @@ + %PYARG_0 = %CONVERTTOPYTHON[double](qAbs(%1)); @@ -531,6 +532,12 @@ PyModule_AddStringConstant(module, "QT_VERSION_STR", QT_VERSION_STR); + + + PySide::SignalManager::instance().clear(); + + + diff --git a/PySide/__init__.py b/PySide/__init__.py index d9db08ea3..c93c5df6b 100644 --- a/PySide/__init__.py +++ b/PySide/__init__.py @@ -1 +1,2 @@ __all__ = ['QtCore', 'QtGui', 'QtNetwork', 'QtOpenGL', 'QtSql', 'QtSvg', 'QtTest', 'QtWebKit', 'QtScript'] +import private diff --git a/PySide/private.py b/PySide/private.py new file mode 100644 index 000000000..0fe1c1326 --- /dev/null +++ b/PySide/private.py @@ -0,0 +1,4 @@ +import atexit +from QtCore import __moduleShutdown + +atexit.register(__moduleShutdown) -- cgit v1.2.3