diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-07-05 16:00:34 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-09-10 09:12:26 +0000 |
commit | bf214f7495c929e5e3f6fdd4745a9daa6ab9ee1a (patch) | |
tree | df4936090d0fd7c29d01e5b21004d790dc65c97e /sources/pyside2 | |
parent | 4f03dbe5e35b3682ba86c820bcc22b762f970d8c (diff) |
Add bindings for 5.12
Task-number: PYSIDE-487
Change-Id: Ib37efc4e480a978f920d3bc40756fe7abd59cb19
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/pyside2')
10 files changed, 179 insertions, 0 deletions
diff --git a/sources/pyside2/PySide2/QtCore/CMakeLists.txt b/sources/pyside2/PySide2/QtCore/CMakeLists.txt index 1d0b7d413..466e97756 100644 --- a/sources/pyside2/PySide2/QtCore/CMakeLists.txt +++ b/sources/pyside2/PySide2/QtCore/CMakeLists.txt @@ -28,6 +28,15 @@ ${QtCore_GEN_DIR}/qbuffer_wrapper.cpp ${QtCore_GEN_DIR}/qbytearray_wrapper.cpp ${QtCore_GEN_DIR}/qbytearraymatcher_wrapper.cpp ${QtCore_GEN_DIR}/qchildevent_wrapper.cpp +${QtCore_GEN_DIR}/qcborarray_wrapper.cpp +${QtCore_GEN_DIR}/qcborerror_wrapper.cpp +${QtCore_GEN_DIR}/qcbormap_wrapper.cpp +${QtCore_GEN_DIR}/qcborparsererror_wrapper.cpp +${QtCore_GEN_DIR}/qcborstreamreader_wrapper.cpp +${QtCore_GEN_DIR}/qcborstringresultstring_wrapper.cpp +${QtCore_GEN_DIR}/qcborstringresultbytearray_wrapper.cpp +${QtCore_GEN_DIR}/qcborstreamwriter_wrapper.cpp +${QtCore_GEN_DIR}/qcborvalue_wrapper.cpp ${QtCore_GEN_DIR}/qcollator_wrapper.cpp ${QtCore_GEN_DIR}/qcollatorsortkey_wrapper.cpp ${QtCore_GEN_DIR}/qcommandlineoption_wrapper.cpp diff --git a/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml b/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml index ba141a177..9331259ca 100644 --- a/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml +++ b/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml @@ -176,6 +176,8 @@ <enum-type name="QtMsgType"/> + <enum-type name="QCborSimpleType" since="5.12"/> + <enum-type name="QCborKnownTags" since="5.12"/> <primitive-type name="qint8"/> <primitive-type name="qint16"/> @@ -662,6 +664,36 @@ </conversion-rule> </primitive-type> + <value-type name="QCborError" since="5.12"> + <enum-type name="Code"/> + <include file-name="qcborcommon.h" location="global"/> + </value-type> + + <value-type name="QCborParserError" since="5.12"> + <include file-name="qcborvalue.h" location="global"/> + </value-type> + + <value-type name="QCborValue" since="5.12"> + <enum-type name="EncodingOption" flags="EncodingOptions"/> + <enum-type name="DiagnosticNotationOption" flags="DiagnosticNotationOptions"/> + <enum-type name="Type"/> + </value-type> + <value-type name="QCborArray" since="5.12"/> + <value-type name="QCborMap" since="5.12"/> + + <object-type name="QCborStreamReader" since="5.12"> + <enum-type name="StringResultCode"/> + <enum-type name="Type"/> + <include file-name="qcborstream.h" location="global"/> + <value-type name="StringResult" generate="no"/> + <modify-function signature="readStringChunk(char*,long long)" remove="all"/> + </object-type> + <typedef-type name="QCborStringResultString" source="QCborStreamReader::StringResult<QString>"/> + <typedef-type name="QCborStringResultByteArray" source="QCborStreamReader::StringResult<QByteArray>"/> + <object-type name="QCborStreamWriter" since="5.12"> + <include file-name="qcborstream.h" location="global"/> + </object-type> + <primitive-type name="QJsonObject"> <conversion-rule> <native-to-target> diff --git a/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml b/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml index 63028057e..665750946 100644 --- a/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml +++ b/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml @@ -1504,6 +1504,7 @@ <value-type name="QGradient" polymorphic-id-expression="%1->type() == QGradient::NoGradient"> <enum-type name="CoordinateMode"/> <enum-type name="InterpolationMode"/> + <enum-type name="Preset" since="5.12"/> <enum-type name="Spread"/> <enum-type name="Type"/> </value-type> diff --git a/sources/pyside2/PySide2/QtNetwork/CMakeLists.txt b/sources/pyside2/PySide2/QtNetwork/CMakeLists.txt index 0267bfae3..0ea57693b 100644 --- a/sources/pyside2/PySide2/QtNetwork/CMakeLists.txt +++ b/sources/pyside2/PySide2/QtNetwork/CMakeLists.txt @@ -3,6 +3,7 @@ project(QtNetwork) set(QtNetwork_OPTIONAL_SRC ) set(QtNetwork_DROPPED_ENTRIES ) +check_qt_class(QtNetwork QDtls QtNetwork_OPTIONAL_SRC QtNetwork_DROPPED_ENTRIES) check_qt_class(QtNetwork QSslCertificate QtNetwork_OPTIONAL_SRC QtNetwork_DROPPED_ENTRIES) check_qt_class(QtNetwork QSslCertificateExtension QtNetwork_OPTIONAL_SRC QtNetwork_DROPPED_ENTRIES) check_qt_class(QtNetwork QSslCipher QtNetwork_OPTIONAL_SRC QtNetwork_DROPPED_ENTRIES) @@ -52,6 +53,7 @@ ${QtNetwork_GEN_DIR}/qnetworkproxyquery_wrapper.cpp ${QtNetwork_GEN_DIR}/qnetworkreply_wrapper.cpp ${QtNetwork_GEN_DIR}/qnetworkrequest_wrapper.cpp ${QtNetwork_GEN_DIR}/qnetworksession_wrapper.cpp +${QtNetwork_GEN_DIR}/qpassworddigestor_wrapper.cpp ${QtNetwork_GEN_DIR}/qssl_wrapper.cpp ${QtNetwork_GEN_DIR}/qtcpserver_wrapper.cpp ${QtNetwork_GEN_DIR}/qtcpsocket_wrapper.cpp diff --git a/sources/pyside2/PySide2/QtNetwork/typesystem_network.xml b/sources/pyside2/PySide2/QtNetwork/typesystem_network.xml index 66fff6e9d..d277b3228 100644 --- a/sources/pyside2/PySide2/QtNetwork/typesystem_network.xml +++ b/sources/pyside2/PySide2/QtNetwork/typesystem_network.xml @@ -42,6 +42,14 @@ <typesystem package="PySide2.QtNetwork"> <load-typesystem name="QtCore/typesystem_core.xml" generate="no"/> + <enum-type name="QDtlsError" since="5.12"/> + + <namespace-type name="QPasswordDigestor" since="5.12"> + <extra-includes> + <include file-name="qpassworddigestor.h" location="global"/> + </extra-includes> + </namespace-type> + <namespace-type name="QSsl"> <enum-type name="AlternativeNameEntryType"/> <enum-type name="EncodingFormat"/> @@ -80,6 +88,11 @@ <value-type name="QDnsMailExchangeRecord"/> <value-type name="QDnsServiceRecord"/> <value-type name="QDnsTextRecord"/> + + <object-type name="QDtls" since="5.12"> + <enum-type name="HandshakeState"/> + </object-type> + <value-type name="QHstsPolicy" since="5.9"> <enum-type name="PolicyFlag" flags="PolicyFlags"/> </value-type> diff --git a/sources/pyside2/PySide2/QtWidgets/typesystem_widgets_common.xml b/sources/pyside2/PySide2/QtWidgets/typesystem_widgets_common.xml index 9da5c71d9..dbc5c8848 100644 --- a/sources/pyside2/PySide2/QtWidgets/typesystem_widgets_common.xml +++ b/sources/pyside2/PySide2/QtWidgets/typesystem_widgets_common.xml @@ -2490,6 +2490,7 @@ <enum-type name="ButtonSymbols"/> <enum-type name="CorrectionMode"/> <enum-type name="StepEnabledFlag" flags="StepEnabled"/> + <enum-type name="StepType" since="5.12"/> <modify-function signature="setLineEdit(QLineEdit*)"> <modify-argument index="1"> <parent index="this" action="add"/> diff --git a/sources/pyside2/tests/QtCore/CMakeLists.txt b/sources/pyside2/tests/QtCore/CMakeLists.txt index 649e796cc..d6d12f651 100644 --- a/sources/pyside2/tests/QtCore/CMakeLists.txt +++ b/sources/pyside2/tests/QtCore/CMakeLists.txt @@ -52,6 +52,7 @@ PYSIDE_TEST(qbytearray_concatenation_operator_test.py) PYSIDE_TEST(qbytearray_operator_iadd_test.py) PYSIDE_TEST(qbytearray_operator_test.py) PYSIDE_TEST(qbytearray_test.py) +PYSIDE_TEST(qcbor_test.py) PYSIDE_TEST(qcollator_test.py) PYSIDE_TEST(qcommandlineparser_test.py) PYSIDE_TEST(qcoreapplication_instance_test.py) diff --git a/sources/pyside2/tests/QtCore/qcbor_test.py b/sources/pyside2/tests/QtCore/qcbor_test.py new file mode 100644 index 000000000..2ac46673a --- /dev/null +++ b/sources/pyside2/tests/QtCore/qcbor_test.py @@ -0,0 +1,74 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2018 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of Qt for Python. +## +## $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$ +## +############################################################################# + +'''Test cases for QCbor''' + +import unittest + +from PySide2.QtCore import (QByteArray, QCborStreamReader, QCborStreamWriter, + QCborValue) + +class TestCbor(unittest.TestCase): + def testReader(self): + ba = QByteArray() + writer = QCborStreamWriter(ba) + writer.append(42) + del writer + self.assertTrue(not ba.isEmpty()) + reader = QCborStreamReader(ba) + self.assertTrue(reader.hasNext()) + value = reader.toInteger() + self.assertEqual(value, 42) + + def testReader(self): + ba = QByteArray() + writer = QCborStreamWriter(ba) + writer.append("hello") + del writer + self.assertTrue(not ba.isEmpty()) + reader = QCborStreamReader(ba) + self.assertTrue(reader.hasNext()) + if (reader.isByteArray()): # Python 2 + value = reader.readByteArray() + self.assertTrue(value) + self.assertEqual(value.data, "hello") + else: + self.assertTrue(reader.isString()) + value = reader.readString() + self.assertTrue(value) + self.assertEqual(value.data, "hello") + + def testValue(self): + value = QCborValue('hello') + self.assertTrue(value.isString()) + self.assertEqual(value.toString(), 'hello') + +if __name__ == '__main__': + unittest.main() diff --git a/sources/pyside2/tests/QtNetwork/CMakeLists.txt b/sources/pyside2/tests/QtNetwork/CMakeLists.txt index c14c19fa9..57c5266c8 100644 --- a/sources/pyside2/tests/QtNetwork/CMakeLists.txt +++ b/sources/pyside2/tests/QtNetwork/CMakeLists.txt @@ -3,6 +3,7 @@ PYSIDE_TEST(bug_1084.py) PYSIDE_TEST(accessManager_test.py) PYSIDE_TEST(dnslookup_test.py) # Qt5: QHttp is gone PYSIDE_TEST(http_test.py) +PYSIDE_TEST(qpassworddigestor_test.py) PYSIDE_TEST(tcpserver_test.py) PYSIDE_TEST(udpsocket_test.py) PYSIDE_TEST(qipv6address_test.py) diff --git a/sources/pyside2/tests/QtNetwork/qpassworddigestor_test.py b/sources/pyside2/tests/QtNetwork/qpassworddigestor_test.py new file mode 100644 index 000000000..503ffecdc --- /dev/null +++ b/sources/pyside2/tests/QtNetwork/qpassworddigestor_test.py @@ -0,0 +1,45 @@ +#!/usr/bin/python + +############################################################################# +## +## Copyright (C) 2018 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ +## +## This file is part of the test suite of Qt for Python. +## +## $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$ +## +############################################################################# + +'''Test cases for QPasswordDigestor''' + +import unittest + +from PySide2.QtCore import QByteArray, QCryptographicHash +from PySide2.QtNetwork import QPasswordDigestor + +class TestPasswordDigestor(unittest.TestCase): + def test(self): + b = QPasswordDigestor.deriveKeyPbkdf1(QCryptographicHash.Sha1, + b'test', b'saltnpep', 10, 20) + self.assertEqual(b.size(), 20) + +if __name__ == '__main__': + unittest.main() |