diff options
64 files changed, 920 insertions, 471 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 9810f7cc6..5ba7022bd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,8 @@ set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules/ ${CMAKE_MODULE_PATH}) find_package(PythonLibs REQUIRED) find_package(PythonInterpWithDebug REQUIRED) -find_package(Shiboken 0.4.0 REQUIRED) +find_package(GeneratorRunner 0.6 REQUIRED) +find_package(Shiboken 0.5 REQUIRED) find_package(Qt4 4.5.0 REQUIRED) find_program(XVFB_RUN NAMES xvfb-run) @@ -17,6 +18,7 @@ if (NOT ${XVFB_RUN} MATCHES "XVFB_RUN-NOTFOUND") message("Using xvfb-run to perform QtGui tests.") endif() +option(ENABLE_VERSION_SUFFIX "Used to use current version in suffix to generated files. This is used to allow multiples versions installed simultaneous." FALSE) set(LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)" ) set(LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}" CACHE PATH "The subdirectory relative to the install prefix where libraries will be installed (default is /lib${LIB_SUFFIX})" FORCE) if(CMAKE_HOST_APPLE) @@ -65,6 +67,10 @@ set(BINDING_API_MAJOR_VERSION "0") set(BINDING_API_MINOR_VERSION "4") set(BINDING_API_MICRO_VERSION "1") set(BINDING_API_VERSION "${BINDING_API_MAJOR_VERSION}.${BINDING_API_MINOR_VERSION}.${BINDING_API_MICRO_VERSION}" CACHE STRING "PySide version" FORCE) +set(PYSIDE_QT_VERSION "${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}" CACHE STRING "Qt version used to compile PySide" FORCE) +if(ENABLE_VERSION_SUFFIX) + set(pyside_SUFFIX "-${BINDING_API_MAJOR_VERSION}.${BINDING_API_MINOR_VERSION}") +endif() include(${QT_USE_FILE}) if (${QTVERSION} VERSION_LESS 4.5.0) @@ -111,11 +117,6 @@ else() endif() set(BINDING_VERSION ${BINDING_API_VERSION}.${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}) -find_program(GENERATOR generatorrunner REQUIRED) - -if (NOT GENERATOR) - message(FATAL_ERROR "You need to specify GENERATOR variable (-DGENERATOR=value)") -endif() # uninstall target configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake" diff --git a/PySide/CMakeLists.txt b/PySide/CMakeLists.txt index 522d1eca7..8769d3a63 100644 --- a/PySide/CMakeLists.txt +++ b/PySide/CMakeLists.txt @@ -1,10 +1,6 @@ project(pyside) -install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/__init__.py" - DESTINATION "${SITE_PACKAGE}/${BINDING_NAME}") - -macro(execute_generator module sources typesystem_path) - message("Running generator for ${module}...") -endmacro() +install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/__init__.py" "${CMAKE_CURRENT_SOURCE_DIR}/private.py" + DESTINATION "${SITE_PACKAGE}/${BINDING_NAME}${pyside_SUFFIX}") macro(create_pyside_module module_name module_include_dir module_libraries module_deps module_typesystem_path module_sources typesystem_name) string(TOLOWER ${module_name} _module) @@ -16,7 +12,7 @@ macro(create_pyside_module module_name module_include_dir module_libraries modul endif() add_custom_command(OUTPUT ${${module_sources}} - COMMAND ${GENERATOR} ${GENERATOR_EXTRA_FLAGS} + COMMAND ${GENERATORRUNNER_BINARY} ${GENERATOR_EXTRA_FLAGS} ${CMAKE_BINARY_DIR}/PySide/global.h --include-paths=${pyside_SOURCE_DIR}${PATH_SEP}${QT_INCLUDE_DIR} --typesystem-paths=${pyside_SOURCE_DIR}${PATH_SEP}${${module_typesystem_path}} @@ -46,9 +42,9 @@ macro(create_pyside_module module_name module_include_dir module_libraries modul install(TARGETS ${module_name} LIBRARY DESTINATION ${SITE_PACKAGE}/PySide) string(TOLOWER ${module_name} lower_module_name) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/PySide/${module_name}/pyside_${lower_module_name}_python.h - DESTINATION include/PySide/${module_name}/) + DESTINATION include/PySide${pyside_SUFFIX}/${module_name}/) file(GLOB typesystem_files ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_*.xml ${typesystem_path}) - install(FILES ${typesystem_files} DESTINATION share/PySide/typesystems) + install(FILES ${typesystem_files} DESTINATION share/PySide${pyside_SUFFIX}/typesystems) endmacro() macro(check_qt_class module class global_sources) @@ -105,6 +101,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) @@ -166,5 +166,5 @@ HAS_QT_MODULE(QT_QTDECLARATIVE_FOUND QtDeclarative) # install install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_templates.xml - DESTINATION share/PySide/typesystems) + DESTINATION share/PySide${pyside_SUFFIX}/typesystems) diff --git a/PySide/QtCore/qvariant_conversions.h b/PySide/QtCore/qvariant_conversions.h index 1e1c70578..06a8368cd 100644 --- a/PySide/QtCore/qvariant_conversions.h +++ b/PySide/QtCore/qvariant_conversions.h @@ -56,14 +56,13 @@ struct Converter<QVariant> Shiboken::SbkBaseWrapperType *objType = reinterpret_cast<Shiboken::SbkBaseWrapperType*>(pyObj->ob_type); const char* typeName = objType->original_name; uint typeCode = QMetaType::type(typeName); - if (!typeCode) {// Try with star at end, for QObject*, QWidget* and QAbstractKinectScroller* - QString stypeName(typeName); - stypeName += '*'; - typeCode = QMetaType::type(stypeName.toAscii()); - return QVariant(typeCode, reinterpret_cast<SbkBaseWrapper*>(pyObj)->cptr); + if (typeCode) { + void** data = reinterpret_cast<SbkBaseWrapper*>(pyObj)->cptr; + if (typeName[strlen(typeName)-1] == '*') + return QVariant(typeCode, data); + else + return QVariant(typeCode, data[0]); } - if (typeCode) - return QVariant(typeCode, reinterpret_cast<SbkBaseWrapper*>(pyObj)->cptr[0]); } // Is a shiboken type not known by Qt return QVariant::fromValue<PySide::PyObjectWrapper>(pyObj); diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml index 1e7d18329..5464ae089 100644 --- a/PySide/QtCore/typesystem_core.xml +++ b/PySide/QtCore/typesystem_core.xml @@ -1,4 +1,23 @@ <?xml version="1.0"?> +<!-- + This file is part of PySide project. + Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). + Contact: PySide team <contact@pyside.org> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +--> <typesystem package="PySide.QtCore"> <load-typesystem name="typesystem_templates.xml" generate="no"/> @@ -520,6 +539,7 @@ <include file-name="QTextDocument" location="global"/> </extra-includes> </namespace-type> + <add-function signature="qAbs(double)" return-type="double"> <inject-code class="target" position="beginning"> %PYARG_0 = %CONVERTTOPYTHON[double](qAbs(%1)); @@ -531,6 +551,12 @@ PyModule_AddStringConstant(module, "QT_VERSION_STR", QT_VERSION_STR); </inject-code> + <add-function signature="__moduleShutdown()"> + <inject-code class="target" position="beginning"> + PySide::SignalManager::instance().clear(); + </inject-code> + </add-function> + <enum-type name="QtMsgType"/> <enum-type name="QSystemSemaphore::AccessMode"/> <enum-type name="QSystemSemaphore::SystemSemaphoreError"/> diff --git a/PySide/QtDeclarative/typesystem_declarative.xml b/PySide/QtDeclarative/typesystem_declarative.xml index 7a80e4866..3d0f56cea 100644 --- a/PySide/QtDeclarative/typesystem_declarative.xml +++ b/PySide/QtDeclarative/typesystem_declarative.xml @@ -1,4 +1,23 @@ <?xml version="1.0"?> +<!-- + This file is part of PySide project. + Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). + Contact: PySide team <contact@pyside.org> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +--> <typesystem package="PySide.QtDeclarative"> <load-typesystem name="typesystem_core.xml" generate="no"/> <load-typesystem name="typesystem_network.xml" generate="no"/> diff --git a/PySide/QtGui/typesystem_gui.xml.in b/PySide/QtGui/typesystem_gui.xml.in index 88a6e9986..210b1dc6c 100644 --- a/PySide/QtGui/typesystem_gui.xml.in +++ b/PySide/QtGui/typesystem_gui.xml.in @@ -1,4 +1,23 @@ <?xml version="1.0"?> +<!-- + This file is part of PySide project. + Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). + Contact: PySide team <contact@pyside.org> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +--> <typesystem package="PySide.QtGui"> <load-typesystem name="typesystem_core.xml" generate="no"/> <load-typesystem name="typesystem_gui_@AUTO_OS@.xml" generate="yes"/> diff --git a/PySide/QtGui/typesystem_gui_common.xml b/PySide/QtGui/typesystem_gui_common.xml index b21750987..a3ed01d16 100644 --- a/PySide/QtGui/typesystem_gui_common.xml +++ b/PySide/QtGui/typesystem_gui_common.xml @@ -1,4 +1,23 @@ <?xml version="1.0"?> +<!-- + This file is part of PySide project. + Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). + Contact: PySide team <contact@pyside.org> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +--> <typesystem package="PySide.QtGui"> <load-typesystem name="typesystem_core.xml" generate="no"/> diff --git a/PySide/QtGui/typesystem_gui_mac.xml b/PySide/QtGui/typesystem_gui_mac.xml index 336032323..2f4ac4c41 100644 --- a/PySide/QtGui/typesystem_gui_mac.xml +++ b/PySide/QtGui/typesystem_gui_mac.xml @@ -1,4 +1,23 @@ <?xml version="1.0"?> +<!-- + This file is part of PySide project. + Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). + Contact: PySide team <contact@pyside.org> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +--> <typesystem package="PySide.QtGui"> <rejection class="*" function-name="qt_mac_set_cursor"/> <rejection class="*" function-name="macMenu"/> diff --git a/PySide/QtGui/typesystem_gui_maemo.xml b/PySide/QtGui/typesystem_gui_maemo.xml index 0a06c7755..99ccb2e8d 100644 --- a/PySide/QtGui/typesystem_gui_maemo.xml +++ b/PySide/QtGui/typesystem_gui_maemo.xml @@ -1,4 +1,23 @@ <?xml version="1.0"?> +<!-- + This file is part of PySide project. + Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). + Contact: PySide team <contact@pyside.org> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +--> <typesystem package="PySide.QtGui"> <enum-type name="QAbstractKineticScroller::Mode"/> diff --git a/PySide/QtGui/typesystem_gui_simulator.xml b/PySide/QtGui/typesystem_gui_simulator.xml index 8b10c22b4..065e44deb 100644 --- a/PySide/QtGui/typesystem_gui_simulator.xml +++ b/PySide/QtGui/typesystem_gui_simulator.xml @@ -1,4 +1,23 @@ <?xml version="1.0"?> +<!-- + This file is part of PySide project. + Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). + Contact: PySide team <contact@pyside.org> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +--> <typesystem package="PySide.QtGui"> <!-- These classes are not present in Qt Simulator build, even though QT_NO_PRINTER is *not* set --> diff --git a/PySide/QtGui/typesystem_gui_win.xml b/PySide/QtGui/typesystem_gui_win.xml index f19521eca..bc4690925 100644 --- a/PySide/QtGui/typesystem_gui_win.xml +++ b/PySide/QtGui/typesystem_gui_win.xml @@ -1,4 +1,23 @@ <?xml version="1.0"?> +<!-- + This file is part of PySide project. + Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). + Contact: PySide team <contact@pyside.org> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +--> <typesystem package="PySide.QtGui"> <primitive-type name="Qt::HANDLE" target-lang-api-name="PyObject"/> <enum-type name="QPixmap::HBitmapFormat" /> diff --git a/PySide/QtGui/typesystem_gui_x11.xml b/PySide/QtGui/typesystem_gui_x11.xml index 073104510..0fd36280b 100644 --- a/PySide/QtGui/typesystem_gui_x11.xml +++ b/PySide/QtGui/typesystem_gui_x11.xml @@ -1,4 +1,23 @@ <?xml version="1.0"?> +<!-- + This file is part of PySide project. + Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). + Contact: PySide team <contact@pyside.org> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +--> <typesystem package="PySide.QtGui"> <rejection class="" function-name="qt_x11_getX11InfoForWindow"/> diff --git a/PySide/QtHelp/typesystem_help.xml b/PySide/QtHelp/typesystem_help.xml index e78153f90..b853c046e 100644 --- a/PySide/QtHelp/typesystem_help.xml +++ b/PySide/QtHelp/typesystem_help.xml @@ -1,4 +1,23 @@ <?xml version="1.0"?> +<!-- + This file is part of PySide project. + Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). + Contact: PySide team <contact@pyside.org> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +--> <typesystem package="PySide.QtHelp"> <load-typesystem name="typesystem_gui.xml" generate="no" /> diff --git a/PySide/QtMaemo5/typesystem_maemo5.xml b/PySide/QtMaemo5/typesystem_maemo5.xml index 9f9279396..94adaa113 100644 --- a/PySide/QtMaemo5/typesystem_maemo5.xml +++ b/PySide/QtMaemo5/typesystem_maemo5.xml @@ -1,4 +1,23 @@ <?xml version="1.0"?> +<!-- + This file is part of PySide project. + Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). + Contact: PySide team <contact@pyside.org> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +--> <typesystem package="PySide.QtMaemo5"> <load-typesystem name="typesystem_gui.xml" generate="no"/> @@ -13,7 +32,7 @@ </object-type> <object-type name="QMaemo5DatePickSelector"/> - + <object-type name="QMaemo5EditBar"> <modify-function signature="addButton(QAbstractButton*)"> <modify-argument index="1"> @@ -67,5 +86,5 @@ <modify-argument index="1" invalidate-after-use="yes"/> </modify-function> </object-type> - + </typesystem> diff --git a/PySide/QtMultimedia/typesystem_multimedia.xml b/PySide/QtMultimedia/typesystem_multimedia.xml index 1786e7073..bd0f6adf0 100644 --- a/PySide/QtMultimedia/typesystem_multimedia.xml +++ b/PySide/QtMultimedia/typesystem_multimedia.xml @@ -1,4 +1,23 @@ <?xml version="1.0"?> +<!-- + This file is part of PySide project. + Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). + Contact: PySide team <contact@pyside.org> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +--> <typesystem package="PySide.QtMultimedia"> <load-typesystem name="typesystem_gui.xml" generate="no" /> diff --git a/PySide/QtNetwork/typesystem_network.xml b/PySide/QtNetwork/typesystem_network.xml index bfe9ad2d2..89cea3910 100644 --- a/PySide/QtNetwork/typesystem_network.xml +++ b/PySide/QtNetwork/typesystem_network.xml @@ -1,4 +1,23 @@ <?xml version="1.0"?> +<!-- + This file is part of PySide project. + Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). + Contact: PySide team <contact@pyside.org> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +--> <typesystem package="PySide.QtNetwork"> <load-typesystem name="typesystem_core.xml" generate="no"/> diff --git a/PySide/QtOpenGL/typesystem_opengl.xml b/PySide/QtOpenGL/typesystem_opengl.xml index e1402f70b..43e097ff3 100644 --- a/PySide/QtOpenGL/typesystem_opengl.xml +++ b/PySide/QtOpenGL/typesystem_opengl.xml @@ -1,4 +1,23 @@ <?xml version="1.0"?> +<!-- + This file is part of PySide project. + Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). + Contact: PySide team <contact@pyside.org> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +--> <typesystem package="PySide.QtOpenGL"> <load-typesystem name="typesystem_gui.xml" generate="no" /> diff --git a/PySide/QtScript/typesystem_script.xml b/PySide/QtScript/typesystem_script.xml index 822b3d577..a37e6fb14 100644 --- a/PySide/QtScript/typesystem_script.xml +++ b/PySide/QtScript/typesystem_script.xml @@ -1,4 +1,23 @@ <?xml version="1.0"?> +<!-- + This file is part of PySide project. + Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). + Contact: PySide team <contact@pyside.org> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +--> <typesystem package="PySide.QtScript"> <load-typesystem name="typesystem_core.xml" generate="no" /> diff --git a/PySide/QtScriptTools/typesystem_scripttools.xml b/PySide/QtScriptTools/typesystem_scripttools.xml index 45bc04b4f..ad68aedba 100644 --- a/PySide/QtScriptTools/typesystem_scripttools.xml +++ b/PySide/QtScriptTools/typesystem_scripttools.xml @@ -1,4 +1,23 @@ <?xml version="1.0"?> +<!-- + This file is part of PySide project. + Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). + Contact: PySide team <contact@pyside.org> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +--> <typesystem package="PySide.QtScriptTools"> <load-typesystem name="typesystem_script.xml" generate="no" /> <load-typesystem name="typesystem_gui.xml" generate="no" /> diff --git a/PySide/QtSql/typesystem_sql.xml b/PySide/QtSql/typesystem_sql.xml index 7c15c69ec..40beff042 100644 --- a/PySide/QtSql/typesystem_sql.xml +++ b/PySide/QtSql/typesystem_sql.xml @@ -1,4 +1,23 @@ <?xml version="1.0"?> +<!-- + This file is part of PySide project. + Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). + Contact: PySide team <contact@pyside.org> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +--> <typesystem package="PySide.QtSql"> <load-typesystem name="typesystem_gui.xml" generate="no"/> diff --git a/PySide/QtSvg/typesystem_svg.xml b/PySide/QtSvg/typesystem_svg.xml index 5cc1b5174..484864e0b 100644 --- a/PySide/QtSvg/typesystem_svg.xml +++ b/PySide/QtSvg/typesystem_svg.xml @@ -1,4 +1,23 @@ <?xml version="1.0"?> +<!-- + This file is part of PySide project. + Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). + Contact: PySide team <contact@pyside.org> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +--> <typesystem package="PySide.QtSvg"> <load-typesystem name="typesystem_gui.xml" generate="no"/> diff --git a/PySide/QtTest/typesystem_test.xml b/PySide/QtTest/typesystem_test.xml index 734bbbb58..a1dfa83ca 100644 --- a/PySide/QtTest/typesystem_test.xml +++ b/PySide/QtTest/typesystem_test.xml @@ -1,4 +1,23 @@ <?xml version="1.0"?> +<!-- + This file is part of PySide project. + Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). + Contact: PySide team <contact@pyside.org> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +--> <typesystem package="PySide.QtTest"> <load-typesystem name="typesystem_gui.xml" generate="no"/> diff --git a/PySide/QtUiTools/typesystem_uitools.xml b/PySide/QtUiTools/typesystem_uitools.xml index 664fbdf0a..7ea988b3d 100644 --- a/PySide/QtUiTools/typesystem_uitools.xml +++ b/PySide/QtUiTools/typesystem_uitools.xml @@ -1,5 +1,24 @@ -<typesystem package="PySide.QtUiTools"> +<?xml version="1.0"?> +<!-- + This file is part of PySide project. + Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). + Contact: PySide team <contact@pyside.org> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +--> +<typesystem package="PySide.QtUiTools"> <load-typesystem name="typesystem_gui.xml" generate="no" /> <load-typesystem name="typesystem_xml.xml" generate="no" /> diff --git a/PySide/QtWebKit/typesystem_webkit.xml b/PySide/QtWebKit/typesystem_webkit.xml index 845eeb4f5..2ba3d8cd2 100644 --- a/PySide/QtWebKit/typesystem_webkit.xml +++ b/PySide/QtWebKit/typesystem_webkit.xml @@ -1,4 +1,23 @@ <?xml version="1.0"?> +<!-- + This file is part of PySide project. + Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). + Contact: PySide team <contact@pyside.org> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +--> <typesystem package="PySide.QtWebKit"> <load-typesystem name="typesystem_core.xml" generate="no"/> <load-typesystem name="typesystem_gui.xml" generate="no"/> @@ -30,7 +49,12 @@ <object-type name="QWebView"> <modify-function signature="setPage(QWebPage*)"> <modify-argument index="1"> - <define-ownership class="target" owner="c++"/> + <reference-count action="add"/> + </modify-argument> + </modify-function> + <modify-function signature="page() const"> + <modify-argument index="return"> + <define-ownership class="target" owner="default"/> </modify-argument> </modify-function> <modify-function signature="print(QPrinter*)const" rename="print_" /> diff --git a/PySide/QtWebKit/typesystem_webkit_simulator.xml b/PySide/QtWebKit/typesystem_webkit_simulator.xml index f2a40f284..ff195be23 100644 --- a/PySide/QtWebKit/typesystem_webkit_simulator.xml +++ b/PySide/QtWebKit/typesystem_webkit_simulator.xml @@ -1,4 +1,23 @@ <?xml version="1.0"?> +<!-- + This file is part of PySide project. + Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). + Contact: PySide team <contact@pyside.org> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +--> <typesystem package="PySide.QtWebKit"> <object-type name="QWebFrame"> <modify-function signature="print(QPrinter*)const" remove="all"/> diff --git a/PySide/QtXml/typesystem_xml.xml b/PySide/QtXml/typesystem_xml.xml index e31f80878..3db64b570 100644 --- a/PySide/QtXml/typesystem_xml.xml +++ b/PySide/QtXml/typesystem_xml.xml @@ -1,4 +1,23 @@ <?xml version="1.0"?> +<!-- + This file is part of PySide project. + Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). + Contact: PySide team <contact@pyside.org> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +--> <typesystem package="PySide.QtXml"> <load-typesystem name="typesystem_templates.xml" generate="no" /> <load-typesystem name="typesystem_core.xml" generate="no" /> diff --git a/PySide/QtXmlPatterns/typesystem_xmlpatterns.xml b/PySide/QtXmlPatterns/typesystem_xmlpatterns.xml index 4f10bda67..c2e2b528f 100644 --- a/PySide/QtXmlPatterns/typesystem_xmlpatterns.xml +++ b/PySide/QtXmlPatterns/typesystem_xmlpatterns.xml @@ -1,4 +1,23 @@ <?xml version="1.0"?> +<!-- + This file is part of PySide project. + Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). + Contact: PySide team <contact@pyside.org> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +--> <typesystem package="PySide.QtXmlPatterns"> <load-typesystem name="typesystem_core.xml" generate="no"/> 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/global.h.in b/PySide/global.h.in index 7a4c650c6..7266fe1cd 100644 --- a/PySide/global.h.in +++ b/PySide/global.h.in @@ -5,12 +5,6 @@ ** This file is part of the QtCore module of the Qt Toolkit, plus some ** modifications by PySide team. ** -** Commercial Usage -** Licensees holding valid Qt Commercial licenses may use this file in -** accordance with the Qt Commercial License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Nokia. -** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software @@ -19,19 +13,6 @@ ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** ** If you are unsure which license is appropriate for your use, please ** contact the sales department at qt-sales@nokia.com. ** diff --git a/PySide/licensecomment.txt b/PySide/licensecomment.txt index fdf974576..cbfe04e1d 100644 --- a/PySide/licensecomment.txt +++ b/PySide/licensecomment.txt @@ -1,7 +1,7 @@ /* * This file is part of PySide: Python for Qt * - * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). + * Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). * * Contact: PySide team <contact@pyside.org> * diff --git a/PySide/phonon/typesystem_phonon.xml b/PySide/phonon/typesystem_phonon.xml index 1a2a486e6..2bb9c2099 100644 --- a/PySide/phonon/typesystem_phonon.xml +++ b/PySide/phonon/typesystem_phonon.xml @@ -1,4 +1,23 @@ <?xml version="1.0"?> +<!-- + This file is part of PySide project. + Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). + Contact: PySide team <contact@pyside.org> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +--> <typesystem package="PySide.phonon"> <load-typesystem name="typesystem_gui.xml" generate="no" /> 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) diff --git a/PySide/qpytextobject.h b/PySide/qpytextobject.h index 80c5b7ebd..6616270b2 100644 --- a/PySide/qpytextobject.h +++ b/PySide/qpytextobject.h @@ -1,3 +1,25 @@ +/* + * This file is part of the PySide project. + * + * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). + * + * Contact: PySide team <contact@pyside.org> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + #ifndef QPYTEXTOBJECT #define QPYTEXTOBJECT @@ -13,4 +35,6 @@ public: void drawObject(QPainter* painter, const QRectF& rect, QTextDocument* doc, int posInDocument, const QTextFormat& format ) = 0; QSizeF intrinsicSize(QTextDocument* doc, int posInDocument, const QTextFormat& format ) = 0; }; -#endif
\ No newline at end of file +#endif + + diff --git a/PySide/typesystem_templates.xml b/PySide/typesystem_templates.xml index b8c43eebe..e2e6fc4a8 100644 --- a/PySide/typesystem_templates.xml +++ b/PySide/typesystem_templates.xml @@ -1,4 +1,23 @@ <?xml version="1.0"?> +<!-- + This file is part of PySide project. + Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). + Contact: PySide team <contact@pyside.org> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +--> <typesystem> <template name="replace_child"> $CHILD_TYPE* oldChild = %CPPSELF.$FUNCTION_GET_OLD(); diff --git a/doc/pyhtml2devhelp.py b/doc/pyhtml2devhelp.py index 895c7e728..60df32986 100644 --- a/doc/pyhtml2devhelp.py +++ b/doc/pyhtml2devhelp.py @@ -10,15 +10,6 @@ Public License version 2.1 requirements will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. - As a special exception to the GNU Lesser General Public License - version 2.1, the object code form of a "work that uses the Library" - may incorporate material from a header file that is part of the - Library. You may distribute such object code under terms of your - choice, provided that the incorporated material (i) does not exceed - more than 5% of the total size of the Library; and (ii) is limited to - numerical parameters, data structure layouts, accessors, macros, - inline functions and templates. - This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU diff --git a/libpyside/CMakeLists.txt b/libpyside/CMakeLists.txt index 284a38487..11196f831 100644 --- a/libpyside/CMakeLists.txt +++ b/libpyside/CMakeLists.txt @@ -24,6 +24,7 @@ target_link_libraries(pyside set_target_properties(pyside PROPERTIES VERSION ${BINDING_API_VERSION} SOVERSION "${BINDING_API_MAJOR_VERSION}.${BINDING_API_MINOR_VERSION}" + OUTPUT_NAME "pyside${pyside_SUFFIX}" DEFINE_SYMBOL PYSIDE_EXPORTS) # @@ -43,18 +44,18 @@ set(libpyside_HEADERS # create pkg-config file configure_file("${CMAKE_CURRENT_SOURCE_DIR}/pyside.pc.in" - "${CMAKE_CURRENT_BINARY_DIR}/pyside.pc" @ONLY) + "${CMAKE_CURRENT_BINARY_DIR}/pyside${pyside_SUFFIX}.pc" @ONLY) # create cmake-config files configure_file("${CMAKE_CURRENT_SOURCE_DIR}/PySideConfig.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/PySideConfig.cmake" @ONLY) configure_file("${CMAKE_CURRENT_SOURCE_DIR}/PySideConfigVersion.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/PySideConfigVersion.cmake" @ONLY) install(FILES ${libpyside_HEADERS} - DESTINATION include/${BINDING_NAME}) + DESTINATION include/${BINDING_NAME}${pyside_SUFFIX}) install(TARGETS pyside EXPORT pyside LIBRARY DESTINATION "${LIB_INSTALL_DIR}" ARCHIVE DESTINATION "${LIB_INSTALL_DIR}" RUNTIME DESTINATION bin) -install(FILES "${CMAKE_CURRENT_BINARY_DIR}/pyside.pc" DESTINATION "${LIB_INSTALL_DIR}/pkgconfig") +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/pyside${pyside_SUFFIX}.pc" DESTINATION "${LIB_INSTALL_DIR}/pkgconfig") install(FILES "${CMAKE_CURRENT_BINARY_DIR}/PySideConfig.cmake" DESTINATION "${LIB_INSTALL_DIR}/cmake/PySide-${BINDING_API_VERSION}") install(FILES "${CMAKE_CURRENT_BINARY_DIR}/PySideConfigVersion.cmake" diff --git a/libpyside/PySideConfig.cmake.in b/libpyside/PySideConfig.cmake.in index 6d618a5b3..9e0f42e9d 100644 --- a/libpyside/PySideConfig.cmake.in +++ b/libpyside/PySideConfig.cmake.in @@ -2,6 +2,6 @@ # PYSIDE_LIBRARIES - Files to link against to use PySide # PYSIDE_TYPESYSTEMS - Type system files that should be used by other bindings extending PySide -SET(PYSIDE_INCLUDE_DIR "@CMAKE_INSTALL_PREFIX@/include/PySide") -SET(PYSIDE_LIBRARY "@LIB_INSTALL_DIR@/@CMAKE_SHARED_LIBRARY_PREFIX@pyside@CMAKE_SHARED_LIBRARY_SUFFIX@") -SET(PYSIDE_TYPESYSTEMS "@CMAKE_INSTALL_PREFIX@/share/PySide/typesystems") +SET(PYSIDE_INCLUDE_DIR "@CMAKE_INSTALL_PREFIX@/include/PySide@pyside_SUFFIX@") +SET(PYSIDE_LIBRARY "@LIB_INSTALL_DIR@/@CMAKE_SHARED_LIBRARY_PREFIX@pyside@pyside_SUFFIX@@CMAKE_SHARED_LIBRARY_SUFFIX@") +SET(PYSIDE_TYPESYSTEMS "@CMAKE_INSTALL_PREFIX@/share/PySide@pyside_SUFFFIX@/typesystems") diff --git a/libpyside/autoarraypointer.h b/libpyside/autoarraypointer.h index 433401c43..47eda60b0 100644 --- a/libpyside/autoarraypointer.h +++ b/libpyside/autoarraypointer.h @@ -1,35 +1,23 @@ /* - * This file is part of the Shiboken Python Bindings Generator project. + * This file is part of the PySide project. * - * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). + * Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). * * Contact: PySide team <contact@pyside.org> * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * version 2.1 as published by the Free Software Foundation. Please - * review the following information to ensure the GNU Lesser General - * Public License version 2.1 requirements will be met: - * http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. * - * As a special exception to the GNU Lesser General Public License - * version 2.1, the object code form of a "work that uses the Library" - * may incorporate material from a header file that is part of the - * Library. You may distribute such object code under terms of your - * choice, provided that the incorporated material (i) does not exceed - * more than 5% of the total size of the Library; and (ii) is limited to - * numerical parameters, data structure layouts, accessors, macros, - * inline functions and templates. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef AUTOARRAYPOINTER_H diff --git a/libpyside/dynamicqmetaobject.cpp b/libpyside/dynamicqmetaobject.cpp index 0e545faa0..8ca983ed7 100644 --- a/libpyside/dynamicqmetaobject.cpp +++ b/libpyside/dynamicqmetaobject.cpp @@ -1,35 +1,23 @@ /* -* This file is part of the Shiboken Python Bindings Generator project. +* This file is part of the PySide project. * -* Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). * * Contact: PySide team <contact@pyside.org> * -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public License -* version 2.1 as published by the Free Software Foundation. Please -* review the following information to ensure the GNU Lesser General -* Public License version 2.1 requirements will be met: -* http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; either +* version 2.1 of the License, or (at your option) any later version. * -* As a special exception to the GNU Lesser General Public License -* version 2.1, the object code form of a "work that uses the Library" -* may incorporate material from a header file that is part of the -* Library. You may distribute such object code under terms of your -* choice, provided that the incorporated material (i) does not exceed -* more than 5% of the total size of the Library; and (ii) is limited to -* numerical parameters, data structure layouts, accessors, macros, -* inline functions and templates. -* -* This program is distributed in the hope that it will be useful, but -* WITHOUT ANY WARRANTY; without even the implied warranty of +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public -* License along with this program; if not, write to the Free Software -* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA -* 02110-1301 USA +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "dynamicqmetaobject.h" diff --git a/libpyside/dynamicqmetaobject.h b/libpyside/dynamicqmetaobject.h index f8c120b4f..22387a6e3 100644 --- a/libpyside/dynamicqmetaobject.h +++ b/libpyside/dynamicqmetaobject.h @@ -1,35 +1,23 @@ /* -* This file is part of the Shiboken Python Bindings Generator project. +* This file is part of the PySide project. * -* Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). * * Contact: PySide team <contact@pyside.org> * -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public License -* version 2.1 as published by the Free Software Foundation. Please -* review the following information to ensure the GNU Lesser General -* Public License version 2.1 requirements will be met: -* http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; either +* version 2.1 of the License, or (at your option) any later version. * -* As a special exception to the GNU Lesser General Public License -* version 2.1, the object code form of a "work that uses the Library" -* may incorporate material from a header file that is part of the -* Library. You may distribute such object code under terms of your -* choice, provided that the incorporated material (i) does not exceed -* more than 5% of the total size of the Library; and (ii) is limited to -* numerical parameters, data structure layouts, accessors, macros, -* inline functions and templates. -* -* This program is distributed in the hope that it will be useful, but -* WITHOUT ANY WARRANTY; without even the implied warranty of +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public -* License along with this program; if not, write to the Free Software -* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA -* 02110-1301 USA +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef DYNAMICQMETAOBJECT_H diff --git a/libpyside/globalreceiver.cpp b/libpyside/globalreceiver.cpp index e37235d5e..1b658e230 100644 --- a/libpyside/globalreceiver.cpp +++ b/libpyside/globalreceiver.cpp @@ -1,35 +1,23 @@ /* -* This file is part of the Shiboken Python Bindings Generator project. +* This file is part of the PySide project. * -* Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). * * Contact: PySide team <contact@pyside.org> * -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public License -* version 2.1 as published by the Free Software Foundation. Please -* review the following information to ensure the GNU Lesser General -* Public License version 2.1 requirements will be met: -* http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; either +* version 2.1 of the License, or (at your option) any later version. * -* As a special exception to the GNU Lesser General Public License -* version 2.1, the object code form of a "work that uses the Library" -* may incorporate material from a header file that is part of the -* Library. You may distribute such object code under terms of your -* choice, provided that the incorporated material (i) does not exceed -* more than 5% of the total size of the Library; and (ii) is limited to -* numerical parameters, data structure layouts, accessors, macros, -* inline functions and templates. -* -* This program is distributed in the hope that it will be useful, but -* WITHOUT ANY WARRANTY; without even the implied warranty of +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public -* License along with this program; if not, write to the Free Software -* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA -* 02110-1301 USA +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "globalreceiver.h" diff --git a/libpyside/globalreceiver.h b/libpyside/globalreceiver.h index 605003603..616d8d3a4 100644 --- a/libpyside/globalreceiver.h +++ b/libpyside/globalreceiver.h @@ -1,35 +1,23 @@ /* -* This file is part of the Shiboken Python Bindings Generator project. +* This file is part of the PySide project. * -* Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). * * Contact: PySide team <contact@pyside.org> * -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public License -* version 2.1 as published by the Free Software Foundation. Please -* review the following information to ensure the GNU Lesser General -* Public License version 2.1 requirements will be met: -* http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; either +* version 2.1 of the License, or (at your option) any later version. * -* As a special exception to the GNU Lesser General Public License -* version 2.1, the object code form of a "work that uses the Library" -* may incorporate material from a header file that is part of the -* Library. You may distribute such object code under terms of your -* choice, provided that the incorporated material (i) does not exceed -* more than 5% of the total size of the Library; and (ii) is limited to -* numerical parameters, data structure layouts, accessors, macros, -* inline functions and templates. -* -* This program is distributed in the hope that it will be useful, but -* WITHOUT ANY WARRANTY; without even the implied warranty of +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public -* License along with this program; if not, write to the Free Software -* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA -* 02110-1301 USA +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef GLOBALRECEIVER_H diff --git a/libpyside/proxyslot.cpp b/libpyside/proxyslot.cpp index 885232574..e480f7674 100644 --- a/libpyside/proxyslot.cpp +++ b/libpyside/proxyslot.cpp @@ -1,35 +1,23 @@ /* -* This file is part of the Shiboken Python Bindings Generator project. +* This file is part of the PySide project. * -* Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). * * Contact: PySide team <contact@pyside.org> * -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public License -* version 2.1 as published by the Free Software Foundation. Please -* review the following information to ensure the GNU Lesser General -* Public License version 2.1 requirements will be met: -* http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; either +* version 2.1 of the License, or (at your option) any later version. * -* As a special exception to the GNU Lesser General Public License -* version 2.1, the object code form of a "work that uses the Library" -* may incorporate material from a header file that is part of the -* Library. You may distribute such object code under terms of your -* choice, provided that the incorporated material (i) does not exceed -* more than 5% of the total size of the Library; and (ii) is limited to -* numerical parameters, data structure layouts, accessors, macros, -* inline functions and templates. -* -* This program is distributed in the hope that it will be useful, but -* WITHOUT ANY WARRANTY; without even the implied warranty of +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public -* License along with this program; if not, write to the Free Software -* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA -* 02110-1301 USA +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <Python.h> diff --git a/libpyside/pyside.cpp b/libpyside/pyside.cpp index 744dfee3a..bfb9889b1 100644 --- a/libpyside/pyside.cpp +++ b/libpyside/pyside.cpp @@ -1,35 +1,23 @@ /* - * This file is part of the Shiboken Python Bindings Generator project. + * This file is part of the PySide project. * - * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). + * Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). * * Contact: PySide team <contact@pyside.org> * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * version 2.1 as published by the Free Software Foundation. Please - * review the following information to ensure the GNU Lesser General - * Public License version 2.1 requirements will be met: - * http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. * - * As a special exception to the GNU Lesser General Public License - * version 2.1, the object code form of a "work that uses the Library" - * may incorporate material from a header file that is part of the - * Library. You may distribute such object code under terms of your - * choice, provided that the incorporated material (i) does not exceed - * more than 5% of the total size of the Library; and (ii) is limited to - * numerical parameters, data structure layouts, accessors, macros, - * inline functions and templates. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ diff --git a/libpyside/pyside.h b/libpyside/pyside.h index 52aeec17e..21515c8d1 100644 --- a/libpyside/pyside.h +++ b/libpyside/pyside.h @@ -1,35 +1,23 @@ /* - * This file is part of the Shiboken Python Bindings Generator project. + * This file is part of the PySide project. * - * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). + * Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). * * Contact: PySide team <contact@pyside.org> * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * version 2.1 as published by the Free Software Foundation. Please - * review the following information to ensure the GNU Lesser General - * Public License version 2.1 requirements will be met: - * http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. * - * As a special exception to the GNU Lesser General Public License - * version 2.1, the object code form of a "work that uses the Library" - * may incorporate material from a header file that is part of the - * Library. You may distribute such object code under terms of your - * choice, provided that the incorporated material (i) does not exceed - * more than 5% of the total size of the Library; and (ii) is limited to - * numerical parameters, data structure layouts, accessors, macros, - * inline functions and templates. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef PYSIDE_H diff --git a/libpyside/pyside.pc.in b/libpyside/pyside.pc.in index ca7a0a5e2..516f8e1eb 100644 --- a/libpyside/pyside.pc.in +++ b/libpyside/pyside.pc.in @@ -1,12 +1,12 @@ prefix=@CMAKE_INSTALL_PREFIX@ exec_prefix=@CMAKE_INSTALL_PREFIX@ libdir=@LIB_INSTALL_DIR@ -includedir=@CMAKE_INSTALL_PREFIX@/include/PySide -typesystemdir=@CMAKE_INSTALL_PREFIX@/share/PySide/typesystems +includedir=@CMAKE_INSTALL_PREFIX@/include/PySide@pyside_SUFFIX@ +typesystemdir=@CMAKE_INSTALL_PREFIX@/share/PySide@pyside_SUFFIX@/typesystems -Name: PySide +Name: PySide@pyside_SUFFIX@ Description: Support library for Python bindings of Qt-based libraries. Version: @BINDING_API_VERSION@ -Libs: -L${libdir} -lpython -lpyside +Libs: -L${libdir} -lpython -lpyside@pyside_SUFFIX@ Cflags: -I${includedir} diff --git a/libpyside/pysideconversions.h b/libpyside/pysideconversions.h index 35fa687df..e92828a9d 100644 --- a/libpyside/pysideconversions.h +++ b/libpyside/pysideconversions.h @@ -1,35 +1,23 @@ /* -* This file is part of the Shiboken Python Bindings Generator project. +* This file is part of the PySide project. * * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). * * Contact: PySide team <contact@pyside.org> * -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public License -* version 2.1 as published by the Free Software Foundation. Please -* review the following information to ensure the GNU Lesser General -* Public License version 2.1 requirements will be met: -* http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; either +* version 2.1 of the License, or (at your option) any later version. * -* As a special exception to the GNU Lesser General Public License -* version 2.1, the object code form of a "work that uses the Library" -* may incorporate material from a header file that is part of the -* Library. You may distribute such object code under terms of your -* choice, provided that the incorporated material (i) does not exceed -* more than 5% of the total size of the Library; and (ii) is limited to -* numerical parameters, data structure layouts, accessors, macros, -* inline functions and templates. -* -* This program is distributed in the hope that it will be useful, but -* WITHOUT ANY WARRANTY; without even the implied warranty of +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public -* License along with this program; if not, write to the Free Software -* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA -* 02110-1301 USA +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef PYSIDECONVERSIONS_H diff --git a/libpyside/pysidemacros.h b/libpyside/pysidemacros.h index ccf8e379a..24c9496b5 100644 --- a/libpyside/pysidemacros.h +++ b/libpyside/pysidemacros.h @@ -1,35 +1,23 @@ /* -* This file is part of the Shiboken Python Bindings Generator project. +* This file is part of the PySide project. * -* Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). * * Contact: PySide team <contact@pyside.org> * -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public License -* version 2.1 as published by the Free Software Foundation. Please -* review the following information to ensure the GNU Lesser General -* Public License version 2.1 requirements will be met: -* http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; either +* version 2.1 of the License, or (at your option) any later version. * -* As a special exception to the GNU Lesser General Public License -* version 2.1, the object code form of a "work that uses the Library" -* may incorporate material from a header file that is part of the -* Library. You may distribute such object code under terms of your -* choice, provided that the incorporated material (i) does not exceed -* more than 5% of the total size of the Library; and (ii) is limited to -* numerical parameters, data structure layouts, accessors, macros, -* inline functions and templates. -* -* This program is distributed in the hope that it will be useful, but -* WITHOUT ANY WARRANTY; without even the implied warranty of +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public -* License along with this program; if not, write to the Free Software -* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA -* 02110-1301 USA +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef PYSIDEMACROS_H diff --git a/libpyside/qproperty.cpp b/libpyside/qproperty.cpp index c4b728ac5..dc36e3e9f 100644 --- a/libpyside/qproperty.cpp +++ b/libpyside/qproperty.cpp @@ -1,35 +1,23 @@ /* - * This file is part of the Shiboken Python Bindings Generator project. + * This file is part of the PySide project. * - * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). + * Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). * * Contact: PySide team <contact@pyside.org> * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * version 2.1 as published by the Free Software Foundation. Please - * review the following information to ensure the GNU Lesser General - * Public License version 2.1 requirements will be met: - * http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. * - * As a special exception to the GNU Lesser General Public License - * version 2.1, the object code form of a "work that uses the Library" - * may incorporate material from a header file that is part of the - * Library. You may distribute such object code under terms of your - * choice, provided that the incorporated material (i) does not exceed - * more than 5% of the total size of the Library; and (ii) is limited to - * numerical parameters, data structure layouts, accessors, macros, - * inline functions and templates. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <shiboken.h> diff --git a/libpyside/qproperty.h b/libpyside/qproperty.h index f561d47b7..56ed32f51 100644 --- a/libpyside/qproperty.h +++ b/libpyside/qproperty.h @@ -1,35 +1,23 @@ /* - * This file is part of the Shiboken Python Bindings Generator project. + * This file is part of the PySide project. * - * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). + * Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). * * Contact: PySide team <contact@pyside.org> * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * version 2.1 as published by the Free Software Foundation. Please - * review the following information to ensure the GNU Lesser General - * Public License version 2.1 requirements will be met: - * http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. - * - * As a special exception to the GNU Lesser General Public License - * version 2.1, the object code form of a "work that uses the Library" - * may incorporate material from a header file that is part of the - * Library. You may distribute such object code under terms of your - * choice, provided that the incorporated material (i) does not exceed - * more than 5% of the total size of the Library; and (ii) is limited to - * numerical parameters, data structure layouts, accessors, macros, - * inline functions and templates. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef PYSIDE_PROPERTY_H diff --git a/libpyside/qsignal.cpp b/libpyside/qsignal.cpp index 41cc71dfa..67f58fa57 100644 --- a/libpyside/qsignal.cpp +++ b/libpyside/qsignal.cpp @@ -1,35 +1,23 @@ /* - * This file is part of the Shiboken Python Bindings Generator project. + * This file is part of the PySide project. * - * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). + * Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). * * Contact: PySide team <contact@pyside.org> * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * version 2.1 as published by the Free Software Foundation. Please - * review the following information to ensure the GNU Lesser General - * Public License version 2.1 requirements will be met: - * http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. * - * As a special exception to the GNU Lesser General Public License - * version 2.1, the object code form of a "work that uses the Library" - * may incorporate material from a header file that is part of the - * Library. You may distribute such object code under terms of your - * choice, provided that the incorporated material (i) does not exceed - * more than 5% of the total size of the Library; and (ii) is limited to - * numerical parameters, data structure layouts, accessors, macros, - * inline functions and templates. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <shiboken.h> @@ -112,7 +100,7 @@ PyTypeObject Signal_Type = { 0, /*tp_descr_get */ 0, /*tp_descr_set */ 0, /*tp_dictoffset */ - (initproc)signal_init, /*tp_init */ + signal_init, /*tp_init */ 0, /*tp_alloc */ PyType_GenericNew, /*tp_new */ signal_free, /*tp_free */ @@ -126,10 +114,10 @@ PyTypeObject Signal_Type = { }; static PyMethodDef SignalInstance_methods[] = { - {"connect", (PyCFunction)signal_instance_connect, METH_VARARGS|METH_KEYWORDS}, - {"disconnect", (PyCFunction)signal_instance_disconnect, METH_VARARGS}, - {"emit", (PyCFunction)signal_instance_emit, METH_VARARGS}, - {NULL} /* Sentinel */ + {"connect", (PyCFunction)signal_instance_connect, METH_VARARGS|METH_KEYWORDS, 0}, + {"disconnect", signal_instance_disconnect, METH_VARARGS, 0}, + {"emit", signal_instance_emit, METH_VARARGS, 0}, + {0} /* Sentinel */ }; static PyMappingMethods SignalInstance_as_mapping = { @@ -234,11 +222,11 @@ void signalUpdateSource(PyObject* source) { Shiboken::AutoDecRef attrs(PyObject_Dir(source)); - for(int i = 0, i_max = PyList_GET_SIZE(attrs.object()); i < i_max; i++) { + for(int i = 0, iMax = PyList_GET_SIZE(attrs.object()); i < iMax; ++i) { PyObject *attrName = PyList_GET_ITEM(attrs.object(), i); - Shiboken::AutoDecRef attr(PyObject_GetAttr((PyObject*)source->ob_type, attrName)); - if (!attr.isNull() && (attr->ob_type == &Signal_Type)) { - Shiboken::AutoDecRef signalInstance(reinterpret_cast<PyObject*>(PyObject_New(SignalInstanceData, &SignalInstance_Type))); + Shiboken::AutoDecRef attr(PyObject_GetAttr(reinterpret_cast<PyObject*>(source->ob_type), attrName)); + if (attr->ob_type == &Signal_Type) { + Shiboken::AutoDecRef signalInstance((PyObject*)PyObject_New(SignalInstanceData, &SignalInstance_Type)); signal_instance_initialize(signalInstance, attrName, reinterpret_cast<SignalData*>(attr.object()), source, 0); PyObject_SetAttr(source, attrName, signalInstance); } @@ -377,9 +365,9 @@ void signal_instance_free(void* self) free(data->signalName); free(data->signature); - while(data) { + if (data->next) { Py_XDECREF(data->next); - data = reinterpret_cast<SignalInstanceData*>(data->next); + data->next = 0; } pySelf->ob_type->tp_base->tp_free(self); } diff --git a/libpyside/qsignal.h b/libpyside/qsignal.h index fe4d5ff07..54fa8f03a 100644 --- a/libpyside/qsignal.h +++ b/libpyside/qsignal.h @@ -1,35 +1,23 @@ /* - * This file is part of the Shiboken Python Bindings Generator project. + * This file is part of the PySide project. * - * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). + * Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). * * Contact: PySide team <contact@pyside.org> * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * version 2.1 as published by the Free Software Foundation. Please - * review the following information to ensure the GNU Lesser General - * Public License version 2.1 requirements will be met: - * http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. * - * As a special exception to the GNU Lesser General Public License - * version 2.1, the object code form of a "work that uses the Library" - * may incorporate material from a header file that is part of the - * Library. You may distribute such object code under terms of your - * choice, provided that the incorporated material (i) does not exceed - * more than 5% of the total size of the Library; and (ii) is limited to - * numerical parameters, data structure layouts, accessors, macros, - * inline functions and templates. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef PYSIDE_SIGNAL_H @@ -42,13 +30,14 @@ namespace PySide { -typedef struct { +struct SignalInstanceData +{ PyObject_HEAD char* signalName; char* signature; PyObject* source; PyObject* next; -} SignalInstanceData; +}; extern "C" diff --git a/libpyside/qslot.cpp b/libpyside/qslot.cpp index c471cbb30..c89f0423b 100644 --- a/libpyside/qslot.cpp +++ b/libpyside/qslot.cpp @@ -1,35 +1,23 @@ /* - * This file is part of the Shiboken Python Bindings Generator project. + * This file is part of the PySide project. * - * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). + * Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). * * Contact: PySide team <contact@pyside.org> * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * version 2.1 as published by the Free Software Foundation. Please - * review the following information to ensure the GNU Lesser General - * Public License version 2.1 requirements will be met: - * http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. * - * As a special exception to the GNU Lesser General Public License - * version 2.1, the object code form of a "work that uses the Library" - * may incorporate material from a header file that is part of the - * Library. You may distribute such object code under terms of your - * choice, provided that the incorporated material (i) does not exceed - * more than 5% of the total size of the Library; and (ii) is limited to - * numerical parameters, data structure layouts, accessors, macros, - * inline functions and templates. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include <shiboken.h> diff --git a/libpyside/signalmanager.cpp b/libpyside/signalmanager.cpp index ed1573207..f9c36eeae 100644 --- a/libpyside/signalmanager.cpp +++ b/libpyside/signalmanager.cpp @@ -1,35 +1,23 @@ /* -* This file is part of the Shiboken Python Bindings Generator project. +* This file is part of the PySide project. * -* Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). * * Contact: PySide team <contact@pyside.org> * -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public License -* version 2.1 as published by the Free Software Foundation. Please -* review the following information to ensure the GNU Lesser General -* Public License version 2.1 requirements will be met: -* http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; either +* version 2.1 of the License, or (at your option) any later version. * -* As a special exception to the GNU Lesser General Public License -* version 2.1, the object code form of a "work that uses the Library" -* may incorporate material from a header file that is part of the -* Library. You may distribute such object code under terms of your -* choice, provided that the incorporated material (i) does not exceed -* more than 5% of the total size of the Library; and (ii) is limited to -* numerical parameters, data structure layouts, accessors, macros, -* inline functions and templates. -* -* This program is distributed in the hope that it will be useful, but -* WITHOUT ANY WARRANTY; without even the implied warranty of +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public -* License along with this program; if not, write to the Free Software -* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA -* 02110-1301 USA +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "signalmanager.h" diff --git a/libpyside/signalmanager.h b/libpyside/signalmanager.h index 08160a5a1..53e5f6e2d 100644 --- a/libpyside/signalmanager.h +++ b/libpyside/signalmanager.h @@ -1,35 +1,23 @@ /* -* This file is part of the Shiboken Python Bindings Generator project. +* This file is part of the PySide project. * -* Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). * * Contact: PySide team <contact@pyside.org> * -* This program is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public License -* version 2.1 as published by the Free Software Foundation. Please -* review the following information to ensure the GNU Lesser General -* Public License version 2.1 requirements will be met: -* http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; either +* version 2.1 of the License, or (at your option) any later version. * -* As a special exception to the GNU Lesser General Public License -* version 2.1, the object code form of a "work that uses the Library" -* may incorporate material from a header file that is part of the -* Library. You may distribute such object code under terms of your -* choice, provided that the incorporated material (i) does not exceed -* more than 5% of the total size of the Library; and (ii) is limited to -* numerical parameters, data structure layouts, accessors, macros, -* inline functions and templates. -* -* This program is distributed in the hope that it will be useful, but -* WITHOUT ANY WARRANTY; without even the implied warranty of +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public -* License along with this program; if not, write to the Free Software -* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA -* 02110-1301 USA +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef SIGNALMANAGER_H diff --git a/tests/QtCore/CMakeLists.txt b/tests/QtCore/CMakeLists.txt index 4e7e8ec6b..f364f4c43 100644 --- a/tests/QtCore/CMakeLists.txt +++ b/tests/QtCore/CMakeLists.txt @@ -1,5 +1,4 @@ PYSIDE_TEST(bug_278_test.py) -PYSIDE_TEST(bug_300_test.py) PYSIDE_TEST(blocking_signals_test.py) PYSIDE_TEST(child_event_test.py) PYSIDE_TEST(deletelater_test.py) diff --git a/tests/QtCore/translation_test.py b/tests/QtCore/translation_test.py index 6b75bee36..7b5c5d633 100644 --- a/tests/QtCore/translation_test.py +++ b/tests/QtCore/translation_test.py @@ -4,6 +4,7 @@ '''Unit tests to test QTranslator and translation in general.''' import os +import glob import unittest from PySide.QtCore import * @@ -16,10 +17,12 @@ class TranslationTest(UsesQCoreApplication): super(TranslationTest, self).setUp() self.trdir = os.path.join(os.path.dirname(__file__), 'translations') # os.system is probably not the best way to do it - os.system('lrelease %s/*.ts > /dev/null' % self.trdir) + for file in glob.glob('%s/*.ts' % self.trdir): + self.assertFalse(os.system('lrelease -silent %s' % file)) def tearDown(self): - os.system('rm %s/*.qm > /dev/null' % self.trdir) + for file in glob.glob('%s/*.qm' % self.trdir): + os.remove(file) super(TranslationTest, self).tearDown() def testLatin(self): diff --git a/tests/QtGui/CMakeLists.txt b/tests/QtGui/CMakeLists.txt index 80d415a0d..887caa62e 100644 --- a/tests/QtGui/CMakeLists.txt +++ b/tests/QtGui/CMakeLists.txt @@ -2,8 +2,10 @@ PYSIDE_TEST(api2_test.py) PYSIDE_TEST(bug_243.py) +PYSIDE_TEST(bug_300_test.py) PYSIDE_TEST(bug_307.py) PYSIDE_TEST(bug_324.py) +PYSIDE_TEST(bug_338.py) PYSIDE_TEST(add_action_test.py) PYSIDE_TEST(customproxywidget_test.py) PYSIDE_TEST(float_to_int_implicit_conversion_test.py) diff --git a/tests/QtCore/bug_300_test.py b/tests/QtGui/bug_300_test.py index ec02cdf02..ec02cdf02 100644 --- a/tests/QtCore/bug_300_test.py +++ b/tests/QtGui/bug_300_test.py diff --git a/tests/QtGui/bug_338.py b/tests/QtGui/bug_338.py new file mode 100644 index 000000000..a419fdbe3 --- /dev/null +++ b/tests/QtGui/bug_338.py @@ -0,0 +1,24 @@ +''' Test bug 338: http://bugs.openbossa.org/show_bug.cgi?id=338''' + +import sys +import unittest +from PySide import QtCore,QtGui + +class DiagramItem(QtGui.QGraphicsPolygonItem): + def __init__(self, parent=None, scene=None): + super(DiagramItem, self).__init__(parent, scene) + + def itemChange(self, change, value): + return value + + +class BugTest(unittest.TestCase): + def test(self): + app = QtGui.QApplication(sys.argv) + scene = QtGui.QGraphicsScene() + item = DiagramItem() + item2 = DiagramItem() + #this cause segfault + scene.addItem(item) + scene.addItem(item2) + diff --git a/tests/QtNetwork/accessManager_test.py b/tests/QtNetwork/accessManager_test.py index 9a00e7e79..172dab8c8 100644 --- a/tests/QtNetwork/accessManager_test.py +++ b/tests/QtNetwork/accessManager_test.py @@ -6,18 +6,33 @@ import unittest from PySide.QtCore import * from PySide.QtNetwork import * -from helper import UsesQApplication +from helper import UsesQCoreApplication +from httpd import TestServer + +class AccessManagerCase(UsesQCoreApplication): + + def setUp(self): + super(AccessManagerCase, self).setUp() + self.httpd = TestServer() + self.httpd.start() + self.called = False + + def tearDown(self): + super(AccessManagerCase, self).tearDown() + self.httpd.shutdown() -class AccessManagerCase(UsesQApplication): def slot_replyFinished(self, reply): self.assertEqual(type(reply), QNetworkReply) + self.called = True self.app.quit() def testNetworkRequest(self): manager = QNetworkAccessManager() manager.finished.connect(self.slot_replyFinished) - manager.get(QNetworkRequest(QUrl("http://qt.nokia.com"))) + manager.get(QNetworkRequest(QUrl("http://localhost:%s" % self.httpd.port()))) self.app.exec_() + self.assert_(self.called) + self.httpd.shutdown() if __name__ == '__main__': unittest.main() diff --git a/tests/QtNetwork/basic_auth_test.py b/tests/QtNetwork/basic_auth_test.py index 8087eeda6..3f1b87b7c 100644 --- a/tests/QtNetwork/basic_auth_test.py +++ b/tests/QtNetwork/basic_auth_test.py @@ -3,10 +3,10 @@ from PySide.QtCore import * from PySide.QtNetwork import * -from helper import UsesQApplication +from helper import UsesQCoreApplication from httpd import TestServer -class testAuthenticationSignal(UsesQApplication): +class testAuthenticationSignal(UsesQCoreApplication): def setUp(self): super(testAuthenticationSignal, self).setUp() @@ -34,5 +34,15 @@ class testAuthenticationSignal(UsesQApplication): self.app.exec_() self.assert_(self._resultOk) + def testwaitSignal2(self): + http = QHttp() + http.setHost("localhost", self.httpd.port()) + # Using new signal slot syntax causes a segfault + http.authenticationRequired.connect(self.onAuthRequest) + path = QUrl.toPercentEncoding("/index.html", "!$&'()*+,;=:@/") + data = http.get(path) + self.app.exec_() + self.assert_(self._resultOk) + if __name__ == '__main__': unittest.main() diff --git a/tests/QtWebKit/webview_test.py b/tests/QtWebKit/webview_test.py index c06e437c3..a6a40fd5c 100644 --- a/tests/QtWebKit/webview_test.py +++ b/tests/QtWebKit/webview_test.py @@ -2,13 +2,18 @@ '''Test cases for QWebView''' import unittest +import sys from PySide.QtCore import QObject, SIGNAL, QUrl -from PySide.QtWebKit import QWebView +from PySide.QtWebKit import * from helper import adjust_filename, TimedQApplication +class testWebPage(QWebPage): + def sayMyName(self): + return 'testWebPage' + class TestLoadFinished(TimedQApplication): '''Test case for signal QWebView.loadFinished(bool)''' @@ -33,6 +38,23 @@ class TestLoadFinished(TimedQApplication): self.assert_(self.called) + def testSetPageAndGetPage(self): + twp = testWebPage() + self.view.setPage(twp) + del twp + p = self.view.page() + self.assertEqual(p.sayMyName(), 'testWebPage') + + # Setting the same webpage should not incref the python obj + refCount = sys.getrefcount(p) + self.view.setPage(p) + self.assertEquals(sys.getrefcount(p), refCount) + + # Changing the webpage obj should decref the old one + twp2 = testWebPage() + self.view.setPage(twp2) + self.assertEquals(sys.getrefcount(p), refCount - 1) + def load_finished(self, ok): #Callback to check if load was successful self.app.quit() diff --git a/tests/util/httpd.py b/tests/util/httpd.py index 96750f01c..03b44d654 100644 --- a/tests/util/httpd.py +++ b/tests/util/httpd.py @@ -1,10 +1,11 @@ import SocketServer import BaseHTTPServer +import os +import sys +import threading +import select import random -from threading import Thread - - class TestHandler(BaseHTTPServer.BaseHTTPRequestHandler): DATA = "PySide Server" @@ -42,22 +43,90 @@ class TestSecureHandler(BaseHTTPServer.BaseHTTPRequestHandler): self.send_header("Content-Length", str(len(TestHandler.DATA))) self.end_headers() +# Workaround for the missing shutdown method in python2.5 +class CompatTCPServer(SocketServer.TCPServer): + def __init__(self, server_address, RequestHandlerClass): + SocketServer.TCPServer.__init__(self, server_address, RequestHandlerClass) + + self.isPy25 = sys.version_info[0] == 2 and sys.version_info[1] == 5 + if self.isPy25: + self.__is_shut_down = threading.Event() + self.__serving = False + + def serve_forever(self, poll_interval=0.5): + """Handle one request at a time until shutdown. + + Polls for shutdown every poll_interval seconds. Ignores + self.timeout. If you need to do periodic tasks, do them in + another thread. + """ + if self.isPy25: + self.__serving = True + self.__is_shut_down.clear() + while self.__serving: + # XXX: Consider using another file descriptor or + # connecting to the socket to wake this up instead of + # polling. Polling reduces our responsiveness to a + # shutdown request and wastes cpu at all other times. + r, w, e = select.select([self], [], [], poll_interval) + if r: + self.py25_handle_request_noblock() + self.__is_shut_down.set() + else: + SocketServer.TCPServer.serve_forever(self, poll_interval) + + def py25_handle_request_noblock(self): + """Handle one request, without blocking. + + I assume that select.select has returned that the socket is + readable before this function was called, so there should be + no risk of blocking in get_request(). + """ + if self.isPy25: + try: + request, client_address = self.get_request() + except socket.error: + return + if self.verify_request(request, client_address): + try: + self.process_request(request, client_address) + except: + self.handle_error(request, client_address) + self.close_request(request) -class TestServer(Thread): + def shutdown(self): + """Stops the serve_forever loop. + + Blocks until the loop has finished. This must be called while + serve_forever() is running in another thread, or it will + deadlock. + """ + if self.isPy25: + self.__serving = False + if not self.__is_shut_down: + self.__is_shut_down.wait() + else: + SocketServer.TCPServer.shutdown(self) + + +class TestServer(threading.Thread): def __init__(self, secure=False): - Thread.__init__(self) + threading.Thread.__init__(self) - self._port = 8000 + random.randint(0, 100) + self._port = int(os.getenv("PYSIDE_TESTSERVER_PORT") or 12321) self.keep_running = True - server = SocketServer.TCPServer if secure: handle = TestSecureHandler else: handle = TestHandler - self.httpd = SocketServer.TCPServer(('' , self._port), handle) + try: + self.httpd = CompatTCPServer(('' , self._port), handle) + except: + self._port = self._port + random.randint(1, 100) + self.httpd = CompatTCPServer(('' , self._port), handle) def port(self): return self._port |