diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-01-19 11:45:49 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-01-19 11:46:14 +0100 |
commit | 1a15c93a220e07c12870d0cdff2eae1aff8eaeaf (patch) | |
tree | 5a847dc2eedec1201abc3f3dbede4b6590b31b55 /sources/pyside2 | |
parent | 04af851b4b886675fc68e0f8e637d9e399d4000c (diff) | |
parent | d3b003f4f63a82f4cca6f4f14cd3ebb2095b1ce8 (diff) |
Merge remote-tracking branch 'origin/5.9' into dev
Change-Id: I0bebba45aa05c2eb02c35bf76b63bb7eaa67b562
Diffstat (limited to 'sources/pyside2')
25 files changed, 209 insertions, 337 deletions
diff --git a/sources/pyside2/CMakeLists.txt b/sources/pyside2/CMakeLists.txt index 6a8c612f3..bfd8eb5be 100644 --- a/sources/pyside2/CMakeLists.txt +++ b/sources/pyside2/CMakeLists.txt @@ -227,6 +227,9 @@ macro(COLLECT_MODULE_IF_FOUND shortname) set(name "Qt5${shortname}") find_package(${name}) set(_name_found "${name}_FOUND") + set(_name_dir "${name}_DIR") + get_filename_component(_qt_dir ${QT_INCLUDE_DIR} DIRECTORY) + get_filename_component(_module_dir "${${_name_dir}}/../../../" ABSOLUTE) # Determine essential/optional/missing set(module_state "missing") @@ -240,7 +243,7 @@ macro(COLLECT_MODULE_IF_FOUND shortname) set(module_state "essential") endif() - if(${_name_found}) + if(${${_name_found}} AND ${_qt_dir} STREQUAL ${_module_dir}) message(STATUS "${module_state} module ${name} found (${ARGN})") # record the shortnames for the tests list(APPEND all_module_shortnames ${shortname}) diff --git a/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml b/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml index 88d262ab7..fc2fc3013 100644 --- a/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml +++ b/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml @@ -216,17 +216,6 @@ <include file-name="signalmanager.h" location="global"/> </primitive-type> - <!-- Among other use cases, these types are necessary for OpenGL "GLint"-like typedefs on macOS. - --> - <primitive-type name="int64_t" /> - <primitive-type name="int32_t" /> - <primitive-type name="int16_t" /> - <primitive-type name="int8_t" /> - <primitive-type name="uint64_t" /> - <primitive-type name="uint32_t" /> - <primitive-type name="uint16_t" /> - <primitive-type name="uint8_t" /> - <primitive-type name="bool" target-lang-api-name="PyBool"> <conversion-rule> <native-to-target> @@ -2922,7 +2911,7 @@ QByteArray ba; ba.resize(%2); %CPPSELF.%FUNCTION_NAME(ba.data(), ba.size()); - %PYARG_0 = %CONVERTTOPYTHON[QByteArray](ba); + %PYARG_0 = Shiboken::String::fromCString(ba.constData()); </inject-code> <modify-argument index="1"> <remove-argument /> @@ -2946,7 +2935,7 @@ QByteArray ba; ba.resize(%2); %CPPSELF.%FUNCTION_NAME(ba.data(), ba.size()); - %PYARG_0 = %CONVERTTOPYTHON[QByteArray](ba); + %PYARG_0 = Shiboken::String::fromCString(ba.constData()); </inject-code> <modify-argument index="1"> <remove-argument /> @@ -2954,12 +2943,13 @@ <modify-argument index="return"> <replace-type modified-type="PyObject"/> <conversion-rule class="native"> - %RETURN_TYPE %out; - if (!PyBytes_Check(%PYARG_0)) { - %out = -1; - } else { + %RETURN_TYPE %out = 0; + if (PyBytes_Check(%PYARG_0)) { %out = PyBytes_GET_SIZE((PyObject*)%PYARG_0); memcpy(%1, PyBytes_AS_STRING((PyObject*)%PYARG_0), %out); + } else if (Shiboken::String::check(%PYARG_0)) { + %out = Shiboken::String::len((PyObject*)%PYARG_0); + memcpy(%1, Shiboken::String::toCString((PyObject*)%PYARG_0), %out); } </conversion-rule> </modify-argument> diff --git a/sources/pyside2/PySide2/QtHelp/CMakeLists.txt b/sources/pyside2/PySide2/QtHelp/CMakeLists.txt index 6e3334a80..342863a4f 100644 --- a/sources/pyside2/PySide2/QtHelp/CMakeLists.txt +++ b/sources/pyside2/PySide2/QtHelp/CMakeLists.txt @@ -11,6 +11,7 @@ ${QtHelp_GEN_DIR}/qhelpindexwidget_wrapper.cpp ${QtHelp_GEN_DIR}/qhelpsearchengine_wrapper.cpp ${QtHelp_GEN_DIR}/qhelpsearchquerywidget_wrapper.cpp ${QtHelp_GEN_DIR}/qhelpsearchquery_wrapper.cpp +${QtHelp_GEN_DIR}/qhelpsearchresult_wrapper.cpp ${QtHelp_GEN_DIR}/qhelpsearchresultwidget_wrapper.cpp # module is always needed ${QtHelp_GEN_DIR}/qthelp_module_wrapper.cpp diff --git a/sources/pyside2/PySide2/QtHelp/typesystem_help.xml b/sources/pyside2/PySide2/QtHelp/typesystem_help.xml index 7668cf8ad..6bd5dd364 100644 --- a/sources/pyside2/PySide2/QtHelp/typesystem_help.xml +++ b/sources/pyside2/PySide2/QtHelp/typesystem_help.xml @@ -61,5 +61,6 @@ <enum-type name="FieldName"/> </value-type> <object-type name="QHelpSearchQueryWidget"/> + <object-type name="QHelpSearchResult"/> <object-type name="QHelpSearchResultWidget"/> </typesystem> diff --git a/sources/pyside2/PySide2/QtWebKitWidgets/typesystem_webkitwidgets.xml b/sources/pyside2/PySide2/QtWebKitWidgets/typesystem_webkitwidgets.xml index 945f8ebe0..0f8d8da4e 100644 --- a/sources/pyside2/PySide2/QtWebKitWidgets/typesystem_webkitwidgets.xml +++ b/sources/pyside2/PySide2/QtWebKitWidgets/typesystem_webkitwidgets.xml @@ -45,7 +45,7 @@ <load-typesystem name="QtWidgets/typesystem_widgets.xml" generate="no"/> <load-typesystem name="QtWebKit/typesystem_webkit.xml" generate="no"/> <load-typesystem name="QtNetwork/typesystem_network.xml" generate="no"/> - <load-typesystem name="typesystem_printsupport.xml" generate="no"/> + <load-typesystem name="QtPrintSupport/typesystem_printsupport.xml" generate="no"/> <value-type name="QWebDatabase"/> diff --git a/sources/pyside2/PySide2/QtWidgets/CMakeLists.txt b/sources/pyside2/PySide2/QtWidgets/CMakeLists.txt index a1bcdb023..27dff2912 100644 --- a/sources/pyside2/PySide2/QtWidgets/CMakeLists.txt +++ b/sources/pyside2/PySide2/QtWidgets/CMakeLists.txt @@ -23,6 +23,7 @@ ${QtWidgets_GEN_DIR}/qbuttongroup_wrapper.cpp ${QtWidgets_GEN_DIR}/qcalendarwidget_wrapper.cpp ${QtWidgets_GEN_DIR}/qcheckbox_wrapper.cpp ${QtWidgets_GEN_DIR}/qcolordialog_wrapper.cpp +${QtWidgets_GEN_DIR}/qcolormap_wrapper.cpp ${QtWidgets_GEN_DIR}/qcolumnview_wrapper.cpp ${QtWidgets_GEN_DIR}/qcombobox_wrapper.cpp ${QtWidgets_GEN_DIR}/qcommandlinkbutton_wrapper.cpp diff --git a/sources/pyside2/PySide2/QtWidgets/typesystem_widgets_common.xml b/sources/pyside2/PySide2/QtWidgets/typesystem_widgets_common.xml index d42547cd1..2c380dacb 100644 --- a/sources/pyside2/PySide2/QtWidgets/typesystem_widgets_common.xml +++ b/sources/pyside2/PySide2/QtWidgets/typesystem_widgets_common.xml @@ -190,6 +190,9 @@ <enum-type name="ViewItemPosition"/> </value-type> + <value-type name="QColormap"> + <enum-type name="Mode"/> + </value-type> <value-type name="QSizePolicy"> <enum-type name="ControlType" flags="ControlTypes"/> <enum-type name="Policy"/> @@ -2402,7 +2405,7 @@ </modify-argument> </modify-function> </object-type> - + <object-type name="QMessageBox"> <enum-type name="ButtonRole"/> <enum-type name="Icon"/> @@ -2605,7 +2608,7 @@ <insert-template name="return_for_QFileDialog"/> </inject-code> </modify-function> - + <modify-function signature="getOpenFileUrl(QWidget*, const QString&, const QUrl&, const QString&, QString*, QFlags<QFileDialog::Option>, const QStringList&)" allow-thread="yes"> <modify-argument index="return"> <replace-type modified-type="(fileName, selectedFilter)"/> diff --git a/sources/pyside2/cmake/Macros/PySideModules.cmake b/sources/pyside2/cmake/Macros/PySideModules.cmake index 9c39980cb..83d43976a 100644 --- a/sources/pyside2/cmake/Macros/PySideModules.cmake +++ b/sources/pyside2/cmake/Macros/PySideModules.cmake @@ -71,8 +71,6 @@ macro(create_pyside_module set(shiboken_framework_include_dirs_option "") if(CMAKE_HOST_APPLE) set(shiboken_framework_include_dirs "${QT_FRAMEWORK_INCLUDE_DIR}") - # On macOS, provide the framework paths for OpenGL headers. - set(shiboken_framework_include_dirs ${shiboken_framework_include_dirs} ${CMAKE_SYSTEM_FRAMEWORK_PATH}) make_path(shiboken_framework_include_dirs ${shiboken_framework_include_dirs}) set(shiboken_framework_include_dirs_option "--framework-include-paths=${shiboken_framework_include_dirs}") endif() @@ -121,7 +119,19 @@ macro(create_pyside_module install(FILES ${CMAKE_CURRENT_BINARY_DIR}/PySide2/${module_name}/pyside2_${lower_module_name}_python.h DESTINATION include/PySide2${pyside2_SUFFIX}/${module_name}/) file(GLOB typesystem_files ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_*.xml ${typesystem_path}) - install(FILES ${typesystem_files} DESTINATION share/PySide2${pyside2_SUFFIX}/typesystems) + +# Copy typesystem files and remove module names from the <load-typesystem> element +# so that it works in a flat directory: +# <load-typesystem name="QtWidgets/typesystem_widgets.xml" ... -> +# <load-typesystem name="typesystem_widgets.xml" + foreach(typesystem_file ${typesystem_files}) + get_filename_component(typesystem_file_name "${typesystem_file}" NAME) + file(READ "${typesystem_file}" typesystemXml) + string(REGEX REPLACE "<load-typesystem name=\"[^/\"]+/" "<load-typesystem name=\"" typesystemXml "${typesystemXml}") + set (typesystem_target_file "${CMAKE_CURRENT_BINARY_DIR}/PySide2/typesystems/${typesystem_file_name}") + file(WRITE "${typesystem_target_file}" "${typesystemXml}") + install(FILES "${typesystem_target_file}" DESTINATION share/PySide2${pyside2_SUFFIX}/typesystems) + endforeach() endmacro() #macro(check_qt_class_with_namespace module namespace class optional_source_files dropped_entries [namespace] [module]) diff --git a/sources/pyside2/header.BSD b/sources/pyside2/header.BSD deleted file mode 100644 index aa400a469..000000000 --- a/sources/pyside2/header.BSD +++ /dev/null @@ -1,50 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the FOO module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - diff --git a/sources/pyside2/header.COMM b/sources/pyside2/header.COMM deleted file mode 100644 index 1c8cb00e7..000000000 --- a/sources/pyside2/header.COMM +++ /dev/null @@ -1,20 +0,0 @@ -/****************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the <Fill> module. -** -** $QT_BEGIN_LICENSE:COMM$ -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** $QT_END_LICENSE$ -** -******************************************************************************/ diff --git a/sources/pyside2/header.FDL b/sources/pyside2/header.FDL deleted file mode 100644 index 90195db13..000000000 --- a/sources/pyside2/header.FDL +++ /dev/null @@ -1,27 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Free Documentation License Usage -** Alternatively, this file may be used under the terms of the GNU Free -** Documentation License version 1.3 as published by the Free Software -** Foundation and appearing in the file included in the packaging of -** this file. Please review the following information to ensure -** the GNU Free Documentation License version 1.3 requirements -** will be met: https://www.gnu.org/licenses/fdl-1.3.html. -** $QT_END_LICENSE$ -** -****************************************************************************/ - diff --git a/sources/pyside2/header.GPL b/sources/pyside2/header.GPL deleted file mode 100644 index af4a1636b..000000000 --- a/sources/pyside2/header.GPL +++ /dev/null @@ -1,29 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the FOO module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - diff --git a/sources/pyside2/header.GPL-EXCEPT b/sources/pyside2/header.GPL-EXCEPT deleted file mode 100644 index 26ed5a245..000000000 --- a/sources/pyside2/header.GPL-EXCEPT +++ /dev/null @@ -1,28 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the FOO module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - diff --git a/sources/pyside2/header.LGPL-NOGPL2 b/sources/pyside2/header.LGPL-NOGPL2 deleted file mode 100644 index 80b4449cb..000000000 --- a/sources/pyside2/header.LGPL-NOGPL2 +++ /dev/null @@ -1,37 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the FOO module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL-NOGPL2$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - diff --git a/sources/pyside2/header.LGPL-ONLY b/sources/pyside2/header.LGPL-ONLY deleted file mode 100644 index 9a676032e..000000000 --- a/sources/pyside2/header.LGPL-ONLY +++ /dev/null @@ -1,22 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the FOO module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL-ONLY$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. 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. -** -** If you have questions regarding the use of this file, please contact -** us via http://www.qt.io/contact-us/. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ diff --git a/sources/pyside2/header.LGPL21 b/sources/pyside2/header.LGPL21 deleted file mode 100644 index 533390b07..000000000 --- a/sources/pyside2/header.LGPL21 +++ /dev/null @@ -1,33 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the FOO module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL21$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** 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 or version 3 as published by the Free -** Software Foundation and appearing in the file LICENSE.LGPLv21 and -** LICENSE.LGPLv3 included in the packaging of this file. Please review the -** following information to ensure the GNU Lesser General Public License -** requirements will be met: https://www.gnu.org/licenses/lgpl.html and -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** As a special exception, The Qt Company gives you certain additional -** rights. These rights are described in The Qt Company LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - diff --git a/sources/pyside2/header.LGPL3 b/sources/pyside2/header.LGPL3 deleted file mode 100644 index d9a65c2e4..000000000 --- a/sources/pyside2/header.LGPL3 +++ /dev/null @@ -1,36 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the FOO module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or later 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 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - diff --git a/sources/pyside2/header.LGPL3-COMM b/sources/pyside2/header.LGPL3-COMM deleted file mode 100644 index b5dc15d38..000000000 --- a/sources/pyside2/header.LGPL3-COMM +++ /dev/null @@ -1,28 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the FOO module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3-COMM$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - diff --git a/sources/pyside2/tests/QtCore/CMakeLists.txt b/sources/pyside2/tests/QtCore/CMakeLists.txt index 4a0f27933..3a08cb45b 100644 --- a/sources/pyside2/tests/QtCore/CMakeLists.txt +++ b/sources/pyside2/tests/QtCore/CMakeLists.txt @@ -61,6 +61,7 @@ PYSIDE_TEST(qenum_test.py) PYSIDE_TEST(qevent_test.py) PYSIDE_TEST(qfileinfo_test.py) PYSIDE_TEST(qfile_test.py) +PYSIDE_TEST(qfileread_test.py) PYSIDE_TEST(qflags_test.py) PYSIDE_TEST(qinstallmsghandler_test.py) PYSIDE_TEST(qlinef_test.py) diff --git a/sources/pyside2/tests/QtCore/qfileread_test.py b/sources/pyside2/tests/QtCore/qfileread_test.py new file mode 100644 index 000000000..3912fe7e6 --- /dev/null +++ b/sources/pyside2/tests/QtCore/qfileread_test.py @@ -0,0 +1,82 @@ +############################################################################# +## +## Copyright (C) 2018 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +import os + +from PySide2.QtCore import QIODevice, QTemporaryFile + +class FileChild1(QTemporaryFile): + pass + +class FileChild2(QTemporaryFile): + def readData(self, maxlen): + return super(FileChild2, self).readData(maxlen) + def readLineData(self, maxlen): + return super(FileChild2, self).readLineData(maxlen) + +class readDataTest(unittest.TestCase): + '''Test case for readData and readLineData''' + + def setUp(self): + '''Acquire resources''' + self.filename1 = FileChild1() + self.assertTrue(self.filename1.open()) + self.filename1.write('Test text for testing') + + self.filename2 = FileChild2() + self.assertTrue(self.filename2.open()) + self.filename2.write('Test text for testing') + + def tearDown(self): + '''release resources''' + pass + + def testBasic(self): + '''QTemporaryFile.read''' + self.filename1.seek(0) + s1 = self.filename1.read(50) + self.assertEqual(s1, 'Test text for testing') + + + def testBug40(self): + self.filename2.seek(0) + s2 = self.filename2.read(50) + self.assertEqual(s2, 'Test text for testing') + + self.filename2.seek(0) + s2 = self.filename2.readLine(22) + self.assertEqual(s2, 'Test text for testing') + + self.filename1.seek(0) + s1 = self.filename1.read(50) + self.assertEqual(s1, s2) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtCore/qinstallmsghandler_test.py b/sources/pyside2/tests/QtCore/qinstallmsghandler_test.py index d8f7bb3a5..08580823e 100644 --- a/sources/pyside2/tests/QtCore/qinstallmsghandler_test.py +++ b/sources/pyside2/tests/QtCore/qinstallmsghandler_test.py @@ -65,9 +65,10 @@ class QInstallMsgHandlerTest(unittest.TestCase): def testHandler(self): rethandler = qInstallMessageHandler(handler) - qDebug("Test Debug") - self.assertEqual(param[0], QtDebugMsg) - self.assertEqual(param[2], "Test Debug") + if QLibraryInfo.isDebugBuild(): + qDebug("Test Debug") + self.assertEqual(param[0], QtDebugMsg) + self.assertEqual(param[2], "Test Debug") qWarning("Test Warning") self.assertEqual(param[0], QtWarningMsg) self.assertEqual(param[2], "Test Warning") diff --git a/sources/pyside2/tests/QtHelp/CMakeLists.txt b/sources/pyside2/tests/QtHelp/CMakeLists.txt index d0ba2d80c..422dc51c7 100644 --- a/sources/pyside2/tests/QtHelp/CMakeLists.txt +++ b/sources/pyside2/tests/QtHelp/CMakeLists.txt @@ -1 +1,2 @@ PYSIDE_TEST(help_test.py) +PYSIDE_TEST(helpsearchengine_test.py) diff --git a/sources/pyside2/tests/QtHelp/helpsearchengine_test.py b/sources/pyside2/tests/QtHelp/helpsearchengine_test.py new file mode 100644 index 000000000..6bc4b684a --- /dev/null +++ b/sources/pyside2/tests/QtHelp/helpsearchengine_test.py @@ -0,0 +1,44 @@ +############################################################################# +## +## Copyright (C) 2018 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from PySide2.QtHelp import QHelpEngineCore, QHelpSearchEngine, QHelpSearchResult + +from helper import UsesQApplication + +class QHelpSearchEngineTest(UsesQApplication): + + def testQHelpSearchEngine(self): + helpEngineCore = QHelpEngineCore('') + helpSearchEngine = QHelpSearchEngine(helpEngineCore) + helpSearchResult = helpSearchEngine.searchResults(0, 0) + self.assertEqual(len(helpSearchResult), 0) + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtWidgets/CMakeLists.txt b/sources/pyside2/tests/QtWidgets/CMakeLists.txt index 3c31b1d7d..60a1d7d6f 100644 --- a/sources/pyside2/tests/QtWidgets/CMakeLists.txt +++ b/sources/pyside2/tests/QtWidgets/CMakeLists.txt @@ -125,6 +125,7 @@ PYSIDE_TEST(qvalidator_test.py) PYSIDE_TEST(qvariant_test.py) PYSIDE_TEST(qwidget_setlayout_test.py) PYSIDE_TEST(qwidget_test.py) +PYSIDE_TEST(qcolormap_test.py) PYSIDE_TEST(reference_count_test.py) PYSIDE_TEST(returnquadruplesofnumbers_test.py) PYSIDE_TEST(standardpixmap_test.py) diff --git a/sources/pyside2/tests/QtWidgets/qcolormap_test.py b/sources/pyside2/tests/QtWidgets/qcolormap_test.py new file mode 100644 index 000000000..c71216592 --- /dev/null +++ b/sources/pyside2/tests/QtWidgets/qcolormap_test.py @@ -0,0 +1,43 @@ +############################################################################# +## +## Copyright (C) 2018 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of PySide2. +## +## $QT_BEGIN_LICENSE:GPL-EXCEPT$ +## Commercial License Usage +## Licensees holding valid commercial Qt licenses may use this file in +## accordance with the commercial license agreement provided with the +## Software or, alternatively, in accordance with the terms contained in +## a written agreement between you and The Qt Company. For licensing terms +## and conditions see https://www.qt.io/terms-conditions. For further +## information use the contact form at https://www.qt.io/contact-us. +## +## GNU General Public License Usage +## Alternatively, this file may be used under the terms of the GNU +## General Public License version 3 as published by the Free Software +## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +## included in the packaging of this file. Please review the following +## information to ensure the GNU General Public License requirements will +## be met: https://www.gnu.org/licenses/gpl-3.0.html. +## +## $QT_END_LICENSE$ +## +############################################################################# + +import unittest + +from PySide2.QtWidgets import QColormap +from helper import UsesQApplication + + +class QColormapTest(UsesQApplication): + + def testQColormap(self): + qc = QColormap.instance() + self.assertEqual(qc.size(), -1) + + +if __name__ == '__main__': + unittest.main() |