diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-09-15 09:29:46 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-09-18 05:34:30 +0000 |
commit | 6212d725a48f634c2c03dc9a8a66d978917f97a8 (patch) | |
tree | c4a38fb8aa1f64ad3ceb7e790e835d3618821e0b | |
parent | 4c5e405e691f707f2765b5f920c28213a36d22e5 (diff) |
Adapt to changes in qtbase
- Renamed QIconEngine::AvailableSizesArgument to ScaledPixmapArgument
- Remove XML/SAX classes after
qtbase/79e0374143ab385cb12a17443e91c8eb9d2f3a4b
- Adapt quick type registering to changes in QMetaTypeInterface
qtbase/92b37676328a960bc092b1f3834233c550376457
Task-number: PYSIDE-1339
Task-number: PYSIDE-904
Task-number: QTBUG-86480
Change-Id: Ibff2bddbf040bb25fb85ca3c0845608b2bca1e7e
Reviewed-by: Christian Tismer <tismer@stackless.com>
-rw-r--r-- | sources/pyside2/PySide2/QtGui/CMakeLists.txt | 2 | ||||
-rw-r--r-- | sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml | 2 | ||||
-rw-r--r-- | sources/pyside2/PySide2/QtQuick/pysidequickregistertype.cpp | 13 | ||||
-rw-r--r-- | sources/pyside2/PySide2/QtXml/CMakeLists.txt | 14 | ||||
-rw-r--r-- | sources/pyside2/PySide2/QtXml/typesystem_xml.xml | 186 | ||||
-rw-r--r-- | sources/pyside2/tests/QtXml/CMakeLists.txt | 1 | ||||
-rw-r--r-- | sources/pyside2/tests/QtXml/qxmlsimplereader_test.py | 70 |
7 files changed, 9 insertions, 279 deletions
diff --git a/sources/pyside2/PySide2/QtGui/CMakeLists.txt b/sources/pyside2/PySide2/QtGui/CMakeLists.txt index f8479fcdb..c6393a1aa 100644 --- a/sources/pyside2/PySide2/QtGui/CMakeLists.txt +++ b/sources/pyside2/PySide2/QtGui/CMakeLists.txt @@ -61,7 +61,7 @@ ${QtGui_GEN_DIR}/qhideevent_wrapper.cpp ${QtGui_GEN_DIR}/qhoverevent_wrapper.cpp ${QtGui_GEN_DIR}/qicon_wrapper.cpp ${QtGui_GEN_DIR}/qicondragevent_wrapper.cpp -${QtGui_GEN_DIR}/qiconengine_availablesizesargument_wrapper.cpp +${QtGui_GEN_DIR}/qiconengine_scaledpixmapargument_wrapper.cpp ${QtGui_GEN_DIR}/qiconengine_wrapper.cpp ${QtGui_GEN_DIR}/qimage_wrapper.cpp ${QtGui_GEN_DIR}/qimageiohandler_wrapper.cpp diff --git a/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml b/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml index 56a998cb3..7d13d18da 100644 --- a/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml +++ b/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml @@ -1129,7 +1129,7 @@ <enum-type name="Notation"/> </object-type> <object-type name="QIconEngine"> - <object-type name="AvailableSizesArgument"/> + <object-type name="ScaledPixmapArgument"/> <enum-type name="IconEngineHook"/> <modify-function signature="paint(QPainter*,QRect,QIcon::Mode,QIcon::State)"> <modify-argument index="1" invalidate-after-use="yes"/> diff --git a/sources/pyside2/PySide2/QtQuick/pysidequickregistertype.cpp b/sources/pyside2/PySide2/QtQuick/pysidequickregistertype.cpp index dc4645487..acb733f73 100644 --- a/sources/pyside2/PySide2/QtQuick/pysidequickregistertype.cpp +++ b/sources/pyside2/PySide2/QtQuick/pysidequickregistertype.cpp @@ -88,16 +88,12 @@ struct QPysideQmlMetaTypeInterface : QtPrivate::QMetaTypeInterface QPysideQmlMetaTypeInterface(const QByteArray &name, const QMetaObject *metaObject = nullptr) : QMetaTypeInterface { /*.revision=*/ 0, - /*.size=*/ sizeof(T), /*.alignment=*/ alignof(T), + /*.size=*/ sizeof(T), /*.flags=*/ QtPrivate::QMetaTypeTypeFlags<T>::Flags, + /*.typeId=*/ 0, /*.metaObject=*/ metaObject, /*.name=*/ name.constData(), - /*.typeId=*/ 0, - /*.ref=*/ { Q_BASIC_ATOMIC_INITIALIZER(0) }, - /*.deleteSelf=*/ [](QMetaTypeInterface *self) { - delete static_cast<QPysideQmlMetaTypeInterface *>(self); - }, /*.defaultCtr=*/ [](const QMetaTypeInterface *, void *addr) { new (addr) T(); }, /*.copyCtr=*/ [](const QMetaTypeInterface *, void *addr, const void *other) { new (addr) T(*reinterpret_cast<const T *>(other)); @@ -108,6 +104,11 @@ struct QPysideQmlMetaTypeInterface : QtPrivate::QMetaTypeInterface /*.dtor=*/ [](const QMetaTypeInterface *, void *addr) { reinterpret_cast<T *>(addr)->~T(); }, + /*.equals=*/ nullptr, + /*.lessThan=*/ nullptr, + /*.debugStream=*/ nullptr, + /*.dataStreamOut=*/ nullptr, + /*.dataStreamIn=*/ nullptr, /*.legacyRegisterOp=*/ nullptr } , name(name) {} diff --git a/sources/pyside2/PySide2/QtXml/CMakeLists.txt b/sources/pyside2/PySide2/QtXml/CMakeLists.txt index eb64b4795..e7b22ca2b 100644 --- a/sources/pyside2/PySide2/QtXml/CMakeLists.txt +++ b/sources/pyside2/PySide2/QtXml/CMakeLists.txt @@ -18,20 +18,6 @@ ${QtXml_GEN_DIR}/qdomnodelist_wrapper.cpp ${QtXml_GEN_DIR}/qdomnotation_wrapper.cpp ${QtXml_GEN_DIR}/qdomprocessinginstruction_wrapper.cpp ${QtXml_GEN_DIR}/qdomtext_wrapper.cpp -${QtXml_GEN_DIR}/qxmlattributes_wrapper.cpp -${QtXml_GEN_DIR}/qxmlcontenthandler_wrapper.cpp -${QtXml_GEN_DIR}/qxmldeclhandler_wrapper.cpp -${QtXml_GEN_DIR}/qxmldefaulthandler_wrapper.cpp -${QtXml_GEN_DIR}/qxmldtdhandler_wrapper.cpp -${QtXml_GEN_DIR}/qxmlentityresolver_wrapper.cpp -${QtXml_GEN_DIR}/qxmlerrorhandler_wrapper.cpp -${QtXml_GEN_DIR}/qxmlinputsource_wrapper.cpp -${QtXml_GEN_DIR}/qxmllexicalhandler_wrapper.cpp -${QtXml_GEN_DIR}/qxmllocator_wrapper.cpp -${QtXml_GEN_DIR}/qxmlnamespacesupport_wrapper.cpp -${QtXml_GEN_DIR}/qxmlparseexception_wrapper.cpp -${QtXml_GEN_DIR}/qxmlreader_wrapper.cpp -${QtXml_GEN_DIR}/qxmlsimplereader_wrapper.cpp # module is always needed ${QtXml_GEN_DIR}/qtxml_module_wrapper.cpp ) diff --git a/sources/pyside2/PySide2/QtXml/typesystem_xml.xml b/sources/pyside2/PySide2/QtXml/typesystem_xml.xml index 96d12ea4e..8da1664d5 100644 --- a/sources/pyside2/PySide2/QtXml/typesystem_xml.xml +++ b/sources/pyside2/PySide2/QtXml/typesystem_xml.xml @@ -147,42 +147,6 @@ </modify-argument> <inject-code class="target" position="beginning" file="../glue/qtxml.cpp" snippet="qdomdocument-setcontent" /> </modify-function> - <modify-function signature="setContent(QXmlInputSource*,bool,QString*,int*,int*)"> - <modify-argument index="3"> - <remove-argument/> - <remove-default-expression/> - </modify-argument> - <modify-argument index="4"> - <remove-argument/> - <remove-default-expression/> - </modify-argument> - <modify-argument index="5"> - <remove-argument/> - <remove-default-expression/> - </modify-argument> - <modify-argument index="return"> - <replace-type modified-type="(retval, errorMsg, errorLine, errorColumn)"/> - </modify-argument> - <inject-code class="target" position="beginning" file="../glue/qtxml.cpp" snippet="qdomdocument-setcontent" /> - </modify-function> - <modify-function signature="setContent(QXmlInputSource*,QXmlReader*,QString*,int*,int*)"> - <modify-argument index="3"> - <remove-argument/> - <remove-default-expression/> - </modify-argument> - <modify-argument index="4"> - <remove-argument/> - <remove-default-expression/> - </modify-argument> - <modify-argument index="5"> - <remove-argument/> - <remove-default-expression/> - </modify-argument> - <modify-argument index="return"> - <replace-type modified-type="(retval, errorMsg, errorLine, errorColumn)"/> - </modify-argument> - <inject-code class="target" position="beginning" file="../glue/qtxml.cpp" snippet="qdomdocument-setcontent" /> - </modify-function> <modify-function signature="setContent(const QString&,QString*,int*,int*)"> <modify-argument index="2"> <remove-argument/> @@ -225,12 +189,6 @@ <value-type name="QDomText"/> - <object-type name="QXmlParseException"/> - - <value-type name="QXmlAttributes"/> - - <object-type name="QXmlNamespaceSupport"/> - <value-type name="QDomElement"> <!-- PYSIDE-1372 We will leave only one for int, and one for float since Python @@ -253,149 +211,5 @@ </modify-argument> </modify-function> </object-type> - <object-type name="QXmlDTDHandler"/> - <object-type name="QXmlDeclHandler"/> - <object-type name="QXmlErrorHandler"/> - <object-type name="QXmlLexicalHandler"/> - - - <object-type name="QXmlEntityResolver"> - <modify-function signature="resolveEntity(const QString&,const QString&,QXmlInputSource*&)"> - <modify-argument index="3"> - <remove-argument/> - </modify-argument> - <modify-argument index="return"> - <replace-type modified-type="PySequence"/> - <conversion-rule class="native"> - <insert-template name="QXmlEntityResolver_resolveEntity_return_conversion_native"/> - </conversion-rule> - </modify-argument> - <inject-code class="target" position="end" file="../glue/qtxml.cpp" snippet="qxmlentityresolver-resolveentity"/> - </modify-function> - </object-type> - <object-type name="QXmlDefaultHandler"> - <modify-function signature="setDocumentLocator(QXmlLocator*)"> - <modify-argument index="1"> - <define-ownership owner="c++"/> - </modify-argument> - </modify-function> - <modify-function signature="resolveEntity(const QString&,const QString&,QXmlInputSource*&)"> - <modify-argument index="3"> - <remove-argument/> - </modify-argument> - <modify-argument index="return"> - <replace-type modified-type="PySequence"/> - <conversion-rule class="native"> - <insert-template name="QXmlEntityResolver_resolveEntity_return_conversion_native"/> - </conversion-rule> - </modify-argument> - <inject-code class="target" position="end" file="../glue/qtxml.cpp" snippet="qxmlentityresolver-resolveentity"/> - </modify-function> - </object-type> - <object-type name="QXmlInputSource"/> - <object-type name="QXmlLocator"/> - - <object-type name="QXmlReader"> - <modify-function signature="parse(const QXmlInputSource*)"> - <modify-argument index="1" invalidate-after-use="yes"/> - </modify-function> - <modify-function signature="feature(QString,bool*)const"> - <modify-argument index="2"> - <remove-default-expression/> - <remove-argument/> - </modify-argument> - <modify-argument index="return"> - <replace-type modified-type="PySequence"/> - <conversion-rule class="native"> - <insert-template name="fix_virtual_method_return_value_and_bool*"/> - </conversion-rule> - </modify-argument> - <inject-code class="target" position="beginning"> - <insert-template name="fix_args,bool*"/> - </inject-code> - </modify-function> - <modify-function signature="property(QString,bool*)const"> - <modify-argument index="2"> - <remove-default-expression/> - <remove-argument/> - </modify-argument> - <modify-argument index="return"> - <replace-type modified-type="PySequence"/> - <conversion-rule class="native"> - <insert-template name="fix_virtual_method_return_value_and_bool*"/> - </conversion-rule> - </modify-argument> - <inject-code class="target" position="beginning"> - <insert-template name="fix_args,bool*"/> - </inject-code> - </modify-function> - </object-type> - <object-type name="QXmlSimpleReader"> - <modify-function signature="parse(const QXmlInputSource*,bool)"> - <modify-argument index="1" invalidate-after-use="yes"/> - </modify-function> - - <modify-function signature="setContentHandler(QXmlContentHandler*)"> - <modify-argument index="1"> - <parent index="this" action="add"/> - </modify-argument> - </modify-function> - <modify-function signature="setDTDHandler(QXmlDTDHandler*)"> - <modify-argument index="1"> - <parent index="this" action="add"/> - </modify-argument> - </modify-function> - <modify-function signature="setDeclHandler(QXmlDeclHandler*)"> - <modify-argument index="1"> - <parent index="this" action="add"/> - </modify-argument> - </modify-function> - <modify-function signature="setEntityResolver(QXmlEntityResolver*)"> - <modify-argument index="1"> - <parent index="this" action="add"/> - </modify-argument> - </modify-function> - <modify-function signature="setErrorHandler(QXmlErrorHandler*)"> - <modify-argument index="1"> - <parent index="this" action="add"/> - </modify-argument> - </modify-function> - <modify-function signature="setLexicalHandler(QXmlLexicalHandler*)"> - <modify-argument index="1"> - <parent index="this" action="add"/> - </modify-argument> - </modify-function> - - <modify-function signature="feature(QString,bool*)const"> - <modify-argument index="2"> - <remove-default-expression/> - <remove-argument/> - </modify-argument> - <modify-argument index="return"> - <replace-type modified-type="PySequence"/> - <conversion-rule class="native"> - <insert-template name="fix_virtual_method_return_value_and_bool*"/> - </conversion-rule> - </modify-argument> - <inject-code class="target" position="beginning"> - <insert-template name="fix_args,bool*"/> - </inject-code> - </modify-function> - <modify-function signature="property(QString,bool*)const"> - <modify-argument index="2"> - <remove-default-expression/> - <remove-argument/> - </modify-argument> - <modify-argument index="return"> - <replace-type modified-type="PySequence"/> - <conversion-rule class="native"> - <insert-template name="fix_virtual_method_return_value_and_bool*"/> - </conversion-rule> - </modify-argument> - <inject-code class="target" position="beginning"> - <insert-template name="fix_args,bool*"/> - </inject-code> - </modify-function> - </object-type> </typesystem> diff --git a/sources/pyside2/tests/QtXml/CMakeLists.txt b/sources/pyside2/tests/QtXml/CMakeLists.txt index 2c21bf87d..feb230af3 100644 --- a/sources/pyside2/tests/QtXml/CMakeLists.txt +++ b/sources/pyside2/tests/QtXml/CMakeLists.txt @@ -1,2 +1 @@ PYSIDE_TEST(qdomdocument_test.py) -PYSIDE_TEST(qxmlsimplereader_test.py) diff --git a/sources/pyside2/tests/QtXml/qxmlsimplereader_test.py b/sources/pyside2/tests/QtXml/qxmlsimplereader_test.py deleted file mode 100644 index a30d68cde..000000000 --- a/sources/pyside2/tests/QtXml/qxmlsimplereader_test.py +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/python - -############################################################################# -## -## Copyright (C) 2016 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$ -## -############################################################################# - -import os -import sys -import unittest - -sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) -from init_paths import init_test_paths -init_test_paths(False) - -from PySide2.QtXml import QXmlSimpleReader - -class QXmlSimpleReaderTest(unittest.TestCase): - - def testQXmlSimpleReaderInstatiation(self): - '''QXmlSimpleReader must be a concrete class not an abstract one.''' - reader = QXmlSimpleReader() - - def testQXmlSimpleReaderFeatures(self): - '''Calls the QXmlSimpleReader.features method. The features checked - (at least the first two) can be found in the QXmlSimpleReader documentation: - http://qt.nokia.com/doc/4.6/qxmlsimplereader.html#setFeature - ''' - reader = QXmlSimpleReader() - hasFeature, ok = reader.feature('http://xml.org/sax/features/namespaces') - self.assertEqual((hasFeature, ok), (True, True)) - - hasFeature, ok = reader.feature('http://xml.org/sax/features/namespace-prefixes') - self.assertEqual((hasFeature, ok), (False, True)) - - hasFeature, ok = reader.feature('foobar') - self.assertEqual((hasFeature, ok), (False, False)) - - def testQXmlSimpleReaderProperty(self): - '''Tries to get a non existent property.''' - reader = QXmlSimpleReader() - prop, ok = reader.property('foo') - self.assertEqual((prop, ok), (None, False)) - -if __name__ == '__main__': - unittest.main() - |