diff options
Diffstat (limited to 'sources/pyside2')
54 files changed, 455 insertions, 629 deletions
diff --git a/sources/pyside2/PySide2/Qt3DInput/typesystem_3dinput.xml b/sources/pyside2/PySide2/Qt3DInput/typesystem_3dinput.xml index dd72c5c01..f2b408257 100644 --- a/sources/pyside2/PySide2/Qt3DInput/typesystem_3dinput.xml +++ b/sources/pyside2/PySide2/Qt3DInput/typesystem_3dinput.xml @@ -60,25 +60,19 @@ <object-type name="QInputSequence"/> <object-type name="QInputSettings"/> <object-type name="QKeyboardHandler"/> - <object-type name="QKeyEvent"> - <modify-function signature="QKeyEvent(const Qt3DInput::QKeyEvent&)" remove="all"/> - </object-type> + <object-type name="QKeyEvent"/> <object-type name="QLogicalDevice"/> <object-type name="QKeyboardDevice"/> <object-type name="QMouseDevice"> <enum-type name="Axis"/> </object-type> - <!-- Fixme: shiboken2 mistakenly thinks that Qt3DInput::QMouseEvent(::QMouseEvent) - is a copy constructor of Qt3DInput::QMouseEvent. Work around by suppressing them --> <object-type name="QMouseEvent"> <enum-type name="Buttons"/> <enum-type name="Modifiers"/> - <modify-function signature="QMouseEvent(const Qt3DInput::QMouseEvent&)" remove="all"/> </object-type> <object-type name="QWheelEvent"> <enum-type name="Buttons"/> <enum-type name="Modifiers"/> - <modify-function signature="QWheelEvent(const Qt3DInput::QWheelEvent&)" remove="all"/> </object-type> <object-type name="QMouseHandler"/> </namespace-type> 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 5c5102528..61b0bc6d0 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"/> @@ -424,15 +426,15 @@ </add-conversion> <add-conversion type="PyDict" check="PyDict_CheckExact(%in)"> QVariant ret = QVariant_convertToVariantMap(%in); - %out = ret.isValid() ? ret : QVariant::fromValue<PySide::PyObjectWrapper>(%in); + %out = ret.isValid() ? ret : QVariant::fromValue(PySide::PyObjectWrapper(%in)); </add-conversion> <add-conversion type="PyList" check="PyList_Check(%in)"> QVariant ret = QVariant_convertToVariantList(%in); - %out = ret.isValid() ? ret : QVariant::fromValue<PySide::PyObjectWrapper>(%in); + %out = ret.isValid() ? ret : QVariant::fromValue(PySide::PyObjectWrapper(%in)); </add-conversion> <add-conversion type="PyObject"> // Is a shiboken type not known by Qt - %out = QVariant::fromValue<PySide::PyObjectWrapper>(%in); + %out = QVariant::fromValue(PySide::PyObjectWrapper(%in)); </add-conversion> </target-to-native> </conversion-rule> @@ -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>" since="5.12"/> + <typedef-type name="QCborStringResultByteArray" source="QCborStreamReader::StringResult<QByteArray>" since="5.12"/> + <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> @@ -960,7 +992,7 @@ <enum-type name="InputMethodHint" flags="InputMethodHints" since="4.6"/> <enum-type name="InputMethodQuery" flags="InputMethodQueries" /> <enum-type name="EnterKeyType" since="5.6" /> - <enum-type name="ItemDataRole" force-integer="yes" /> + <enum-type name="ItemDataRole"/> <enum-type name="ItemFlag" flags="ItemFlags"/> <enum-type name="ItemSelectionMode"/> <enum-type name="ItemSelectionOperation" since="5.5" /> @@ -1008,11 +1040,6 @@ <enum-type name="WindowType" flags="WindowFlags"/> <enum-type name="CursorMoveStyle" since="4.8" revision="4800"/> - <!--### These functions are part of QtGui, not QtCore --> - <modify-function signature="codecForHtml(const QByteArray&)" remove="all"/> - <modify-function signature="mightBeRichText(const QString&)" remove="all"/> - <modify-function signature="convertFromPlainText(const QString&,Qt::WhiteSpaceMode)" remove="all"/> - <!--### --> </namespace-type> <add-function signature="qAbs(double)" return-type="double"> @@ -1071,7 +1098,7 @@ qWarning() << "Module atexit not found for registering __moduleShutdown"; PyErr_Clear(); }else{ - regFunc = PyObject_GetAttrString(atexit, "register"); + regFunc.reset(PyObject_GetAttrString(atexit, "register")); if (regFunc.isNull()) { qWarning() << "Function atexit.register not found for registering __moduleShutdown"; PyErr_Clear(); @@ -2068,7 +2095,7 @@ </object-type> <object-type name="QAbstractItemModel"> - <enum-type name="CheckIndexOption" flags="CheckIndexOptions" class="yes" since="5.11"/> + <enum-type name="CheckIndexOption" flags="CheckIndexOptions" since="5.11"/> <enum-type name="LayoutChangeHint" /> <!-- This function was replaced by a added function --> <modify-function signature="createIndex(int,int,void*)const" remove="all"/> @@ -2128,7 +2155,6 @@ <value-type name="QItemSelectionRange" hash-function="qHash"> </value-type> - <primitive-type name="QModelIndexList"/> <object-type name="QAbstractProxyModel" polymorphic-id-expression="qobject_cast<QAbstractProxyModel*>(%1)"> <extra-includes> <include file-name="QItemSelection" location="global"/> @@ -2137,9 +2163,6 @@ </extra-includes> </object-type> <object-type name="QSortFilterProxyModel"> - <!-- ### This reimplementation of "QObject::parent()" is used in C++ only - when "using QObject::parent;" is not available. It's useless in Python. --> - <modify-function signature="parent()const" remove="all"/> <extra-includes> <include file-name="QItemSelection" location="global"/> <include file-name="QStringList" location="global"/> @@ -2730,12 +2753,12 @@ } </inject-code> </modify-function> - <add-function signature="QByteArray(PyByteArray)" allow-thread="yes">> + <add-function signature="QByteArray(PyByteArray)"> <inject-code class="target" position="beginning"> %0 = new QByteArray(PyByteArray_AsString(%PYARG_1), PyByteArray_Size(%PYARG_1)); </inject-code> </add-function> - <add-function signature="QByteArray(PyBytes)" allow-thread="yes"> + <add-function signature="QByteArray(PyBytes)"> <inject-code class="target" position="beginning"> %0 = new QByteArray(PyBytes_AS_STRING(%PYARG_1), PyBytes_GET_SIZE(%PYARG_1)); </inject-code> @@ -3441,31 +3464,6 @@ <define-ownership owner="c++"/> </modify-argument> </modify-function> - <modify-function signature="winEventFilter(MSG*,long*)"> - <modify-argument index="2"> - <remove-argument /> - <conversion-rule class="native"> - long *%out = new long; - %out = 0; - </conversion-rule> - </modify-argument> - <modify-argument index="return"> - <replace-type modified-type="PyObject"/> - <conversion-rule class="native"> - %RETURN_TYPE %out = false; - if (PySequence_Check(%PYARG_0) && (PySequence_Size(%PYARG_0) == 2)) { - Shiboken::AutoDecRef pyResult(PySequence_GetItem(%PYARG_0, 0)); - %out = %CONVERTTOCPP[bool](pyResult); - } - </conversion-rule> - </modify-argument> - <inject-code position="end"> - %PYARG_0 = PyTuple_New(2); - PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%RETURN_TYPE](%0)); - PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[long](*result_out)); - delete result_out; - </inject-code> - </modify-function> </object-type> <object-type name="QSettings"> <enum-type name="Format"/> @@ -3490,10 +3488,9 @@ </modify-function> </object-type> <object-type name="QEvent" polymorphic-id-expression="%1->type() == QEvent::None"> - <enum-type name="Type" extensible="yes" /> + <enum-type name="Type"/> </object-type> <object-type name="QChildEvent" polymorphic-id-expression="%1->type() == QEvent::ChildAdded || %1->type() == QEvent::ChildPolished || %1->type() == QEvent::ChildRemoved"> - <modify-field name="c" read="false" write="false"/> <modify-function signature="child()const"> <modify-argument index="return"> <define-ownership class="target" owner="default"/> @@ -3945,9 +3942,6 @@ </modify-function> <!-- This isn't part of Qt public API --> <modify-function signature="enclosingMetaObject()const" remove="all" /> - <!-- Qt5.5: "template<typename T> static QMetaEnum fromType()" is not understood by the compiler. - We therefore ignore this 5.5 addition for now: --> - <modify-function signature="fromType()" since="5.5" remove="all" /> </value-type> <!-- From Qt4.6 --> @@ -4388,7 +4382,7 @@ s1.addTransition(button.clicked, s1h)</code> <suppress-warning text="unhandled enum value: (sizeof(void*)<<3) in QSysInfo::Sizes"/> <suppress-warning text="unmatched enum ~0u"/> <suppress-warning text="unmatched enum (sizeof(void*)<<3)"/> - <suppress-warning text="signature 'setCustomType(float)' for function modification in 'QEasingCurve' not found. Possible candidates: setCustomType(double) in QEasingCurve"/> + <suppress-warning text="^signature 'setCustomType(float)' for function modification in 'QEasingCurve' not found.*$"/> <suppress-warning text="enum 'enum_4' does not have a type entry or is not an enum" /> <suppress-warning text="enum 'enum_5' does not have a type entry or is not an enum" /> <suppress-warning text="enum 'FP_NORMAL' does not have a type entry or is not an enum" /> @@ -4398,18 +4392,18 @@ s1.addTransition(button.clicked, s1h)</code> <suppress-warning text="enum 'PM_MessageBoxHeight' does not have a type entry or is not an enum" /> <!-- this function only exists on Windows --> - <suppress-warning text="signature 'winEventFilter(MSG*,long*)' for function modification in 'QCoreApplication' not found. Possible candidates:*"/> + <suppress-warning text="^signature 'winEventFilter(MSG*,long*)' for function modification in 'QCoreApplication' not found.*"/> <!-- this is necessary to avoid warning on other modules --> - <suppress-warning text="signature 'operator*(QByteArray,const char*)' for function modification in 'QByteArray' not found. Possible candidates:*"/> - <suppress-warning text="signature 'operator+(QByteArray,QString)' for function modification in 'QByteArray' not found. Possible candidates:*"/> + <suppress-warning text="^signature 'operator*(QByteArray,const char*)' for function modification in 'QByteArray' not found.*"/> + <suppress-warning text="^signature 'operator+(QByteArray,QString)' for function modification in 'QByteArray' not found.*"/> <!-- This enum is intenaly used --> <suppress-warning text="enum 'PM_CbaIconHeight' does not have a type entry or is not an enum" /> <!-- TODO: this need be removed --> - <suppress-warning text="skipping function '*', unmatched return type '*'"/> - <suppress-warning text="skipping function '*', unmatched type '*"/> + <suppress-warning text="^skipping function '.*', unmatched return type '.*$"/> + <suppress-warning text="^skipping function '.*', unmatched type '.*$"/> <suppress-warning text="enum 'q_static_assert_result39' does not have a type entry or is not an enum"/> <suppress-warning text="horribly broken type ''"/> @@ -4428,7 +4422,7 @@ s1.addTransition(button.clicked, s1h)</code> <suppress-warning text="enum 'Role' does not have a type entry or is not an enum" /> <!-- Anonymous enum in qtbase/src/corelib/global/qtypeinfo.h --> - <suppress-warning text="enum 'Q_RELOCATABLE_TYPE' does not have a type entry or is not an enum" /> + <suppress-warning text="Anonymous enum (Q_COMPLEX_TYPE, ... , Q_RELOCATABLE_TYPE) does not have a type entry"/> <!-- Another anonymous enum / value pair in in qtbase/src/corelib/kernel/qcoreapplication.h --> <suppress-warning text="no matching enum 'QT_VERSION'" /> diff --git a/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml b/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml index 70fd1692a..f67b5a306 100644 --- a/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml +++ b/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml @@ -97,21 +97,21 @@ <rejection class="*" function-name="d_func"/> <rejection class="*" field-name="d_ptr"/> <rejection class="*" field-name="d"/> - <rejection class="^QOpenGL.*$" argument-type="^GLboolean( const)?\*$"/> + <rejection class="^QOpenGL.*$" argument-type="^(const )?GLboolean ?\*$"/> <rejection class="^QOpenGL.*$" argument-type="^GLchar\*$"/> - <rejection class="^QOpenGL.*$" argument-type="GLchar *const const*"/> + <rejection class="^QOpenGL.*$" argument-type="^(const )?GLchar ?\*(const)?\*$"/> <rejection class="^QOpenGL.*$" argument-type="^char\*$"/> - <rejection class="^QOpenGL.*$" argument-type="^char( const)?\*\*$"/> + <rejection class="^QOpenGL.*$" argument-type="^(const )?char ?\*\*$"/> <rejection class="^QOpenGL.*$" argument-type="GLintptr"/> <rejection class="^QOpenGL.*$" argument-type="GLsizeiptr"/> <rejection class="^QOpenGL.*$" argument-type="GLsync"/> <rejection class="^QOpenGL.*$" argument-type="^GLubyte( const)?\*$"/> - <rejection class="^QOpenGL.*$" argument-type="^QMatrix.x.( const)?\*$"/> + <rejection class="^QOpenGL.*$" argument-type="^(const )?QMatrix.x. ?\*$"/> <rejection class="^QOpenGL.*$" argument-type="qopengl_GLintptr"/> <rejection class="^QOpenGL.*$" argument-type="qopengl_GLsizeiptr"/> <rejection class="^QOpenGL.*$" argument-type="QOpenGLTextureHelper*"/> - <rejection class="^QOpenGL.*$" argument-type="^QVector.D( const)?\*$"/> - <rejection class="^QOpenGL.*$" argument-type="^void( const)?\*\*$"/> + <rejection class="^QOpenGL.*$" argument-type="^(const )?QVector.D ?\*$"/> + <rejection class="^QOpenGL.*$" argument-type="^(const )?void ?\*\*$"/> <!-- Event classes have a lot of non-documented protected fields, those fields @@ -395,7 +395,6 @@ <value-type name="QTextFrameFormat" > <enum-type name="BorderStyle"/> <enum-type name="Position"/> - <modify-function signature="isValid()const" access="non-final"/> </value-type> <value-type name="QTextLength"> <enum-type name="Type"/> @@ -403,9 +402,6 @@ <value-type name="QPainterPath"> <enum-type name="ElementType"/> <value-type name="Element"> - <modify-field name="x" write="false"/> - <modify-field name="y" write="false"/> - <modify-field name="type" write="false"/> <include file-name="QPainterPath" location="global"/> </value-type> </value-type> @@ -554,14 +550,12 @@ <enum-type name="FontPropertiesInheritanceBehavior"/> <enum-type name="UnderlineStyle"/> <enum-type name="VerticalAlignment"/> - <modify-function signature="isValid()const" access="non-final"/> </value-type> <value-type name="QTextFormat" > <enum-type name="FormatType"/> <enum-type name="ObjectTypes"/> <enum-type name="PageBreakFlag" flags="PageBreakFlags"/> <enum-type name="Property" /> - <modify-function signature="isValid()const" access="non-final"/> </value-type> <value-type name="QTextListFormat"> <enum-type name="Style"/> @@ -668,7 +662,7 @@ %0 = new %TYPE(QPixmap::fromImage(%1)); </inject-code> </add-function> - <modify-function signature="QPixmap(const char*[])"> + <modify-function signature="QPixmap(const char*const[])"> <modify-argument index="1"> <replace-type modified-type="PySequence" /> </modify-argument> @@ -897,7 +891,7 @@ <modify-function signature="QImage(const uchar*,int,int,QImage::Format,QImageCleanupFunction,void*)" remove="all" /> <!-- ### --> - <modify-function signature="QImage(const char*[])"> + <modify-function signature="QImage(const char*const[])"> <modify-argument index="1"> <replace-type modified-type="PySequence" /> </modify-argument> @@ -1507,10 +1501,11 @@ </inject-code> </modify-function> </value-type> - <value-type name="QGradient" force-abstract="yes" polymorphic-id-expression="%1->type() == QGradient::NoGradient"> + <value-type name="QGradient" polymorphic-id-expression="%1->type() == QGradient::NoGradient"> <enum-type name="CoordinateMode"/> <enum-type name="InterpolationMode"/> - <enum-type name="Spread" lower-bound="QGradient.PadSpread" upper-bound="QGradient.RepeatSpread"/> + <enum-type name="Preset" since="5.12"/> + <enum-type name="Spread"/> <enum-type name="Type"/> </value-type> <value-type name="QLinearGradient" polymorphic-id-expression="%1->type() == QGradient::LinearGradient" /> @@ -1741,7 +1736,7 @@ else qWarning("%TYPE::%FUNCTION_NAME: Second tuple element is not convertible to int."); } - %PYARG_0 = PySequence_Fast_GET_ITEM(seq.object(), 0); + %PYARG_0.reset(PySequence_Fast_GET_ITEM(seq.object(), 0)); Py_INCREF(%PYARG_0); // we need to incref, because "%PYARG_0 = ..." will decref the tuple and the tuple will be decrefed again at the end of this scope. } @@ -1835,9 +1830,7 @@ <suppress-warning text="enum 'QWheelEvent::DefaultDeltasPerStep' does not have a type entry or is not an enum" /> <object-type name="QWindowStateChangeEvent" copyable="false" polymorphic-id-expression="%1->type() == QEvent::WindowStateChange"/> - <object-type name="QInputEvent" copyable="false"> - <modify-function signature="modifiers()const" access="non-final"/> - </object-type> + <object-type name="QInputEvent" copyable="false"/> <object-type name="QKeyEvent" copyable= "false" polymorphic-id-expression="%1->type() == QEvent::KeyPress || %1->type() == QEvent::KeyRelease || %1->type() == QEvent::ShortcutOverride"> <add-function signature="operator!=(QKeySequence::StandardKey)"> <inject-code class="target"> @@ -2237,7 +2230,6 @@ </extra-includes> <!-- ### "setPaintDevice(QPaintDevice*)" is an internal method. --> <modify-function signature="setPaintDevice(QPaintDevice*)" remove="all"/> - <modify-field name="state" read="false" write="false"/> </object-type> <object-type name="QPainter"> <extra-includes> @@ -2388,7 +2380,12 @@ </modify-function> </object-type> + <value-type name="QGenericMatrix" generate="no"/> <value-type name="QMatrix2x2" since="4.6"> + <modify-function signature="QMatrix2x2(const float*)"> + <modify-argument index="1"><array/></modify-argument> + </modify-function> + <modify-function signature="copyDataTo(float*) const" remove="all"/> <add-function signature="__repr__" return-type="PyObject*"> <inject-code class="target" position="beginning"> <insert-template name="repr_code_matrix"> @@ -2420,63 +2417,13 @@ </insert-template> </inject-code> </add-function> - <add-function signature="fill(PyObject*)"> - <inject-code class="target" position="beginning"> - <insert-template name="matrix_fill_function"> - <replace from="%MATRIX_SIZE" to="4" /> - </insert-template> - </inject-code> - </add-function> - <add-function signature="transposed()" return-type="PyObject"> - <inject-code class="target" position="beginning"> - <insert-template name="matrix_transposed_function"> - <replace from="%TRANSPOSED_TYPE" to="QMatrix2x2" /> - </insert-template> - </inject-code> - </add-function> - <add-function signature="operator!=(const QMatrix2x2&)" return-type="bool" /> - - <template name="inplace_add"> - *%CPPSELF += %1; - return %CONVERTTOPYTHON[%RETURN_TYPE](*%CPPSELF); - </template> - <template name="inplace_sub"> - *%CPPSELF -= %1; - return %CONVERTTOPYTHON[%RETURN_TYPE](*%CPPSELF); - </template> - <template name="inplace_mult"> - *%CPPSELF *= %1; - return %CONVERTTOPYTHON[%RETURN_TYPE](*%CPPSELF); - </template> - <template name="inplace_div"> - *%CPPSELF /= %1; - return %CONVERTTOPYTHON[%RETURN_TYPE](*%CPPSELF); - </template> - - <add-function signature="operator*=(float)" return-type="QMatrix2x2" > - <inject-code class="target" position="beginning"> - <insert-template name="inplace_mult"/> - </inject-code> - </add-function> - <add-function signature="operator+=(const QMatrix2x2&)" return-type="QMatrix2x2" > - <inject-code class="target" position="beginning"> - <insert-template name="inplace_add"/> - </inject-code> - </add-function> - <add-function signature="operator-=(const QMatrix2x2&)" return-type="QMatrix2x2" > - <inject-code class="target" position="beginning"> - <insert-template name="inplace_sub"/> - </inject-code> - </add-function> - <add-function signature="operator/=(float)" return-type="QMatrix2x2" > - <inject-code class="target" position="beginning"> - <insert-template name="inplace_div"/> - </inject-code> - </add-function> - <add-function signature="operator==(const QMatrix2x2&)" return-type="bool" /> </value-type> <value-type name="QMatrix2x3" since="4.6"> + <modify-function signature="QMatrix2x3(const float*)"> + <modify-argument index="1"><array/></modify-argument> + </modify-function> + <modify-function signature="copyDataTo(float*) const" remove="all"/> <add-function signature="__repr__" return-type="PyObject*"> <inject-code class="target" position="beginning"> <insert-template name="repr_code_matrix"> @@ -2508,45 +2455,13 @@ </insert-template> </inject-code> </add-function> - <add-function signature="fill(PyObject*)"> - <inject-code class="target" position="beginning"> - <insert-template name="matrix_fill_function"> - <replace from="%MATRIX_SIZE" to="6" /> - </insert-template> - </inject-code> - </add-function> - <add-function signature="transposed()" return-type="PyObject"> - <inject-code class="target" position="beginning"> - <insert-template name="matrix_transposed_function"> - <replace from="%TRANSPOSED_TYPE" to="QMatrix3x2" /> - </insert-template> - </inject-code> - </add-function> - <add-function signature="operator!=(const QMatrix2x3&)" return-type="bool" /> - <add-function signature="operator*=(float)" return-type="QMatrix2x3" > - <inject-code class="target" position="beginning"> - <insert-template name="inplace_mult"/> - </inject-code> - </add-function> - <add-function signature="operator+=(const QMatrix2x3&)" return-type="QMatrix2x3" > - <inject-code class="target" position="beginning"> - <insert-template name="inplace_add"/> - </inject-code> - </add-function> - <add-function signature="operator-=(const QMatrix2x3&)" return-type="QMatrix2x3" > - <inject-code class="target" position="beginning"> - <insert-template name="inplace_sub"/> - </inject-code> - </add-function> - <add-function signature="operator/=(float)" return-type="QMatrix2x3" > - <inject-code class="target" position="beginning"> - <insert-template name="inplace_div"/> - </inject-code> - </add-function> - <add-function signature="operator==(const QMatrix2x3&)" return-type="bool" /> </value-type> <value-type name="QMatrix2x4" since="4.6"> + <modify-function signature="QMatrix2x4(const float*)"> + <modify-argument index="1"><array/></modify-argument> + </modify-function> + <modify-function signature="copyDataTo(float*) const" remove="all"/> <add-function signature="__repr__" return-type="PyObject*"> <inject-code class="target" position="beginning"> <insert-template name="repr_code_matrix"> @@ -2578,45 +2493,13 @@ </insert-template> </inject-code> </add-function> - <add-function signature="fill(PyObject*)"> - <inject-code class="target" position="beginning"> - <insert-template name="matrix_fill_function"> - <replace from="%MATRIX_SIZE" to="8" /> - </insert-template> - </inject-code> - </add-function> - <add-function signature="transposed()" return-type="PyObject"> - <inject-code class="target" position="beginning"> - <insert-template name="matrix_transposed_function"> - <replace from="%TRANSPOSED_TYPE" to="QMatrix4x2" /> - </insert-template> - </inject-code> - </add-function> - <add-function signature="operator!=(const QMatrix2x4&)" return-type="bool" /> - <add-function signature="operator*=(float)" return-type="QMatrix2x4" > - <inject-code class="target" position="beginning"> - <insert-template name="inplace_mult"/> - </inject-code> - </add-function> - <add-function signature="operator+=(const QMatrix2x4&)" return-type="QMatrix2x4" > - <inject-code class="target" position="beginning"> - <insert-template name="inplace_add"/> - </inject-code> - </add-function> - <add-function signature="operator-=(const QMatrix2x4&)" return-type="QMatrix2x4" > - <inject-code class="target" position="beginning"> - <insert-template name="inplace_sub"/> - </inject-code> - </add-function> - <add-function signature="operator/=(float)" return-type="QMatrix2x4" > - <inject-code class="target" position="beginning"> - <insert-template name="inplace_div"/> - </inject-code> - </add-function> - <add-function signature="operator==(const QMatrix2x4&)" return-type="bool" /> </value-type> <value-type name="QMatrix3x2" since="4.6"> + <modify-function signature="QMatrix3x2(const float*)"> + <modify-argument index="1"><array/></modify-argument> + </modify-function> + <modify-function signature="copyDataTo(float*) const" remove="all"/> <add-function signature="__repr__" return-type="PyObject*"> <inject-code class="target" position="beginning"> <insert-template name="repr_code_matrix"> @@ -2648,45 +2531,13 @@ </insert-template> </inject-code> </add-function> - <add-function signature="fill(PyObject*)"> - <inject-code class="target" position="beginning"> - <insert-template name="matrix_fill_function"> - <replace from="%MATRIX_SIZE" to="6" /> - </insert-template> - </inject-code> - </add-function> - <add-function signature="transposed()" return-type="PyObject"> - <inject-code class="target" position="beginning"> - <insert-template name="matrix_transposed_function"> - <replace from="%TRANSPOSED_TYPE" to="QMatrix2x3" /> - </insert-template> - </inject-code> - </add-function> - <add-function signature="operator!=(const QMatrix3x2&)" return-type="bool" /> - <add-function signature="operator*=(float)" return-type="QMatrix3x2" > - <inject-code class="target" position="beginning"> - <insert-template name="inplace_mult"/> - </inject-code> - </add-function> - <add-function signature="operator+=(const QMatrix3x2&)" return-type="QMatrix3x2" > - <inject-code class="target" position="beginning"> - <insert-template name="inplace_add"/> - </inject-code> - </add-function> - <add-function signature="operator-=(const QMatrix3x2&)" return-type="QMatrix3x2" > - <inject-code class="target" position="beginning"> - <insert-template name="inplace_sub"/> - </inject-code> - </add-function> - <add-function signature="operator/=(float)" return-type="QMatrix3x2" > - <inject-code class="target" position="beginning"> - <insert-template name="inplace_div"/> - </inject-code> - </add-function> - <add-function signature="operator==(const QMatrix3x2&)" return-type="bool" /> </value-type> <value-type name="QMatrix3x3" since="4.6"> + <modify-function signature="QMatrix3x3(const float*)"> + <modify-argument index="1"><array/></modify-argument> + </modify-function> + <modify-function signature="copyDataTo(float*) const" remove="all"/> <add-function signature="__repr__" return-type="PyObject*"> <inject-code class="target" position="beginning"> <insert-template name="repr_code_matrix"> @@ -2718,45 +2569,13 @@ </insert-template> </inject-code> </add-function> - <add-function signature="fill(PyObject*)"> - <inject-code class="target" position="beginning"> - <insert-template name="matrix_fill_function"> - <replace from="%MATRIX_SIZE" to="9" /> - </insert-template> - </inject-code> - </add-function> - <add-function signature="transposed()" return-type="PyObject"> - <inject-code class="target" position="beginning"> - <insert-template name="matrix_transposed_function"> - <replace from="%TRANSPOSED_TYPE" to="QMatrix3x3" /> - </insert-template> - </inject-code> - </add-function> - <add-function signature="operator!=(const QMatrix3x3&)" return-type="bool" /> - <add-function signature="operator*=(float)" return-type="QMatrix3x3" > - <inject-code class="target" position="beginning"> - <insert-template name="inplace_mult"/> - </inject-code> - </add-function> - <add-function signature="operator+=(const QMatrix3x3&)" return-type="QMatrix3x3" > - <inject-code class="target" position="beginning"> - <insert-template name="inplace_add"/> - </inject-code> - </add-function> - <add-function signature="operator-=(const QMatrix3x3&)" return-type="QMatrix3x3" > - <inject-code class="target" position="beginning"> - <insert-template name="inplace_sub"/> - </inject-code> - </add-function> - <add-function signature="operator/=(float)" return-type="QMatrix3x3" > - <inject-code class="target" position="beginning"> - <insert-template name="inplace_div"/> - </inject-code> - </add-function> - <add-function signature="operator==(const QMatrix3x3&)" return-type="bool" /> </value-type> <value-type name="QMatrix3x4" since="4.6"> + <modify-function signature="QMatrix3x4(const float*)"> + <modify-argument index="1"><array/></modify-argument> + </modify-function> + <modify-function signature="copyDataTo(float*) const" remove="all"/> <add-function signature="__repr__" return-type="PyObject*"> <inject-code class="target" position="beginning"> <insert-template name="repr_code_matrix"> @@ -2788,45 +2607,12 @@ </insert-template> </inject-code> </add-function> - <add-function signature="fill(PyObject*)"> - <inject-code class="target" position="beginning"> - <insert-template name="matrix_fill_function"> - <replace from="%MATRIX_SIZE" to="12" /> - </insert-template> - </inject-code> - </add-function> - <add-function signature="transposed()" return-type="PyObject"> - <inject-code class="target" position="beginning"> - <insert-template name="matrix_transposed_function"> - <replace from="%TRANSPOSED_TYPE" to="QMatrix4x3" /> - </insert-template> - </inject-code> - </add-function> - <add-function signature="operator!=(const QMatrix3x4&)" return-type="bool" /> - <add-function signature="operator*=(float)" return-type="QMatrix3x4" > - <inject-code class="target" position="beginning"> - <insert-template name="inplace_mult"/> - </inject-code> - </add-function> - <add-function signature="operator+=(const QMatrix3x4&)" return-type="QMatrix3x4" > - <inject-code class="target" position="beginning"> - <insert-template name="inplace_add"/> - </inject-code> - </add-function> - <add-function signature="operator-=(const QMatrix3x4&)" return-type="QMatrix3x4" > - <inject-code class="target" position="beginning"> - <insert-template name="inplace_sub"/> - </inject-code> - </add-function> - <add-function signature="operator/=(float)" return-type="QMatrix3x4" > - <inject-code class="target" position="beginning"> - <insert-template name="inplace_div"/> - </inject-code> - </add-function> - <add-function signature="operator==(const QMatrix3x4&)" return-type="bool" /> </value-type> <value-type name="QMatrix4x2" since="4.6"> + <modify-function signature="QMatrix4x2(const float*)"> + <modify-argument index="1"><array/></modify-argument> + </modify-function> <add-function signature="__repr__" return-type="PyObject*"> <inject-code class="target" position="beginning"> <insert-template name="repr_code_matrix"> @@ -2858,45 +2644,13 @@ </insert-template> </inject-code> </add-function> - <add-function signature="fill(PyObject*)"> - <inject-code class="target" position="beginning"> - <insert-template name="matrix_fill_function"> - <replace from="%MATRIX_SIZE" to="8" /> - </insert-template> - </inject-code> - </add-function> - <add-function signature="transposed()" return-type="PyObject"> - <inject-code class="target" position="beginning"> - <insert-template name="matrix_transposed_function"> - <replace from="%TRANSPOSED_TYPE" to="QMatrix2x4" /> - </insert-template> - </inject-code> - </add-function> - <add-function signature="operator!=(const QMatrix4x2&)" return-type="bool" /> - <add-function signature="operator*=(float)" return-type="QMatrix4x2" > - <inject-code class="target" position="beginning"> - <insert-template name="inplace_mult"/> - </inject-code> - </add-function> - <add-function signature="operator+=(const QMatrix4x2&)" return-type="QMatrix4x2" > - <inject-code class="target" position="beginning"> - <insert-template name="inplace_add"/> - </inject-code> - </add-function> - <add-function signature="operator-=(const QMatrix4x2&)" return-type="QMatrix4x2" > - <inject-code class="target" position="beginning"> - <insert-template name="inplace_sub"/> - </inject-code> - </add-function> - <add-function signature="operator/=(float)" return-type="QMatrix4x2" > - <inject-code class="target" position="beginning"> - <insert-template name="inplace_div"/> - </inject-code> - </add-function> - <add-function signature="operator==(const QMatrix4x2&)" return-type="bool" /> </value-type> <value-type name="QMatrix4x3" since="4.6"> + <modify-function signature="QMatrix4x3(const float*)"> + <modify-argument index="1"><array/></modify-argument> + </modify-function> + <modify-function signature="copyDataTo(float*) const" remove="all"/> <add-function signature="__repr__" return-type="PyObject*"> <inject-code class="target" position="beginning"> <insert-template name="repr_code_matrix"> @@ -2928,47 +2682,10 @@ </insert-template> </inject-code> </add-function> - <add-function signature="fill(PyObject*)"> - <inject-code class="target" position="beginning"> - <insert-template name="matrix_fill_function"> - <replace from="%MATRIX_SIZE" to="12" /> - </insert-template> - </inject-code> - </add-function> - <add-function signature="transposed()" return-type="PyObject"> - <inject-code class="target" position="beginning"> - <insert-template name="matrix_transposed_function"> - <replace from="%TRANSPOSED_TYPE" to="QMatrix3x4" /> - </insert-template> - </inject-code> - </add-function> - <add-function signature="operator!=(const QMatrix4x3&)" return-type="bool" /> - <add-function signature="operator*=(float)" return-type="QMatrix4x3" > - <inject-code class="target" position="beginning"> - <insert-template name="inplace_mult"/> - </inject-code> - </add-function> - <add-function signature="operator+=(const QMatrix4x3&)" return-type="QMatrix4x3" > - <inject-code class="target" position="beginning"> - <insert-template name="inplace_add"/> - </inject-code> - </add-function> - <add-function signature="operator-=(const QMatrix4x3&)" return-type="QMatrix4x3" > - <inject-code class="target" position="beginning"> - <insert-template name="inplace_sub"/> - </inject-code> - </add-function> - <add-function signature="operator/=(float)" return-type="QMatrix4x3" > - <inject-code class="target" position="beginning"> - <insert-template name="inplace_div"/> - </inject-code> - </add-function> - <add-function signature="operator==(const QMatrix4x3&)" return-type="bool" /> </value-type> <value-type name="QMatrix4x4" since="4.6"> - <!-- Qt5: HAIRY TRICK ALERT ahead! Qt5 partially replaced 'qreal' by float. That had the side effect that all matrix types did not work any longer. 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 e4235e070..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> @@ -275,7 +288,7 @@ </extra-includes> </value-type> <value-type name="QNetworkRequest"> - <enum-type name="Attribute" extensible="yes"/> + <enum-type name="Attribute"/> <enum-type name="LoadControl" since="4.7"/> <enum-type name="Priority" since="4.7"/> <enum-type name="CacheLoadControl"/> diff --git a/sources/pyside2/PySide2/QtOpenGL/typesystem_opengl.xml b/sources/pyside2/PySide2/QtOpenGL/typesystem_opengl.xml index ea5c24cd3..c332eea0d 100644 --- a/sources/pyside2/PySide2/QtOpenGL/typesystem_opengl.xml +++ b/sources/pyside2/PySide2/QtOpenGL/typesystem_opengl.xml @@ -59,19 +59,19 @@ <rejection class="QGLColormap::QGLColormapData"/> <rejection class="QGLContext" field-name="currentCtx"/> - <rejection class="^QGL.*$" argument-type="^GLboolean( const)?\*$"/> - <rejection class="^QGL.*$" argument-type="^GLchar( const)?\*$"/> - <rejection class="^QGL.*$" argument-type="GLchar *const const*"/> - <rejection class="^QGL.*$" argument-type="^GLenum( const)?\*$"/> - <rejection class="^QGL.*$" argument-type="^GLfloat( const)?\*$"/> - <rejection class="^QGL.*$" argument-type="^GLfloat( const)?\[.*$"/> - <rejection class="^QGL.*$" argument-type="^GLdouble( const)?\*$"/> + <rejection class="^QGL.*$" argument-type="^(const )?GLboolean ?\*$"/> + <rejection class="^QGL.*$" argument-type="^(const )?GLchar ?\*$"/> + <rejection class="^QGL.*$" argument-type="^(const )?GLchar ?\*const"/> + <rejection class="^QGL.*$" argument-type="^(const )?GLenum ?\*$"/> + <rejection class="^QGL.*$" argument-type="^(const )?GLfloat ?\*$"/> + <rejection class="^QGL.*$" argument-type="^(const )?GLfloat ?\[.*$"/> + <rejection class="^QGL.*$" argument-type="^(const )?GLdouble ?\*$"/> <rejection class="^QGL.*$" argument-type="GLintptr"/> - <rejection class="^QGL.*$" argument-type="^GLint64( const)?\*$"/> - <rejection class="^QGL.*$" argument-type="^GLsizei( const)?\*$"/> + <rejection class="^QGL.*$" argument-type="^(const )?GLint64 ?\*$"/> + <rejection class="^QGL.*$" argument-type="^(const )?GLsizei ?\*$"/> <namespace-type name="QGL"> - <enum-type name="FormatOption" flags="FormatOptions" force-integer="yes"/> + <enum-type name="FormatOption" flags="FormatOptions"/> <extra-includes> <include file-name="qgl.h" location="global"/> </extra-includes> @@ -683,16 +683,7 @@ </inject-code> </modify-function> - <!-- ### TODO: must evaluate if anything other than removal should be done. --> - <modify-function signature="setAttributeArray(int,const GLfloat*,int,int)" remove="all" /> - <modify-function signature="setAttributeArray(const char*,const GLfloat*,int,int)" remove="all" /> - <modify-function signature="setUniformValueArray(int,const GLfloat*,int,int)" remove="all" /> - <modify-function signature="setUniformValueArray(const char*,const GLfloat*,int,int)" remove="all" /> - <!-- ### --> - <!-- ### Use QMatrixZxY overloads --> - <modify-function signature="setAttributeValue(int,const GLfloat*,int,int)" remove="all" /> - <modify-function signature="setAttributeValue(const char*,const GLfloat*,int,int)" remove="all" /> <modify-function signature="setAttributeArray(int,GLenum,const void*,int,int)" remove="all" since="4.7" /> <modify-function signature="setAttributeArray(const char*,GLenum,const void*,int,int)" remove="all" since="4.7" /> <!-- ### --> diff --git a/sources/pyside2/PySide2/QtQml/typesystem_qml.xml b/sources/pyside2/PySide2/QtQml/typesystem_qml.xml index 9a0d1e0ae..f5e3d36fc 100644 --- a/sources/pyside2/PySide2/QtQml/typesystem_qml.xml +++ b/sources/pyside2/PySide2/QtQml/typesystem_qml.xml @@ -157,7 +157,7 @@ <enum-type name="Status" /> </object-type> <object-type name="QQmlIncubationController"> - <modify-function signature="incubateWhile(bool volatile*,int)" allow-thread="yes"> + <modify-function signature="incubateWhile(volatile bool*,int)" allow-thread="yes"> <modify-argument index="1"> <!-- The replace type is needed to use the VolatileBool_Check macro instead of a template conversion function with "volatile bool" as argument. --> @@ -216,5 +216,5 @@ </modify-function> </object-type> <!-- Suppress anonymous enum warning --> - <suppress-warning text="enum 'QmlCurrentSingletonTypeRegistrationVersion' does not have a type entry or is not an enum" /> + <suppress-warning text="Anonymous enum (QmlCurrentSingletonTypeRegistrationVersion) does not have a type entry"/> </typesystem> diff --git a/sources/pyside2/PySide2/QtQuick/pysidequickregistertype.cpp b/sources/pyside2/PySide2/QtQuick/pysidequickregistertype.cpp index bf3ff06a2..93a8f281e 100644 --- a/sources/pyside2/PySide2/QtQuick/pysidequickregistertype.cpp +++ b/sources/pyside2/PySide2/QtQuick/pysidequickregistertype.cpp @@ -40,6 +40,7 @@ #include "pysidequickregistertype.h" #include <pyside.h> +#include <shiboken.h> // Auto generated headers. #include "qquickitem_wrapper.h" diff --git a/sources/pyside2/PySide2/QtSql/typesystem_sql.xml b/sources/pyside2/PySide2/QtSql/typesystem_sql.xml index 1b6baa15f..3eab73307 100644 --- a/sources/pyside2/PySide2/QtSql/typesystem_sql.xml +++ b/sources/pyside2/PySide2/QtSql/typesystem_sql.xml @@ -101,7 +101,6 @@ <extra-includes> <include file-name="QSqlField" location="global"/> </extra-includes> - <modify-function signature="append(QSqlField)" access="non-final"/> </value-type> <value-type name="QSqlError"> @@ -142,8 +141,6 @@ </object-type> <object-type name="QSqlQueryModel"> - <modify-function signature="indexInQuery(QModelIndex)const" access="non-final"/> - <modify-function signature="setQuery(QSqlQuery)" access="non-final"/> <extra-includes> <include file-name="QSqlError" location="global"/> <include file-name="QSqlQuery" location="global"/> diff --git a/sources/pyside2/PySide2/QtWidgets/typesystem_widgets_common.xml b/sources/pyside2/PySide2/QtWidgets/typesystem_widgets_common.xml index 76b3dd1f1..9c21493da 100644 --- a/sources/pyside2/PySide2/QtWidgets/typesystem_widgets_common.xml +++ b/sources/pyside2/PySide2/QtWidgets/typesystem_widgets_common.xml @@ -74,7 +74,7 @@ --> <object-type name="QStyleOption" polymorphic-id-expression="%1->type == QStyleOption::SO_Default"> - <enum-type name="OptionType" extensible="yes"/> + <enum-type name="OptionType"/> <enum-type name="StyleOptionType"/> <enum-type name="StyleOptionVersion"/> </object-type> @@ -1272,17 +1272,17 @@ </object-type> <object-type name="QAbstractButton"/> <object-type name="QStyle"> - <enum-type name="ComplexControl" extensible="yes"/> - <enum-type name="ContentsType" extensible="yes"/> - <enum-type name="ControlElement" extensible="yes"/> - <enum-type name="PixelMetric" extensible="yes" /> - <enum-type name="PrimitiveElement" extensible="yes" /> + <enum-type name="ComplexControl"/> + <enum-type name="ContentsType"/> + <enum-type name="ControlElement"/> + <enum-type name="PixelMetric"/> + <enum-type name="PrimitiveElement"/> <enum-type name="RequestSoftwareInputPanel" since="4.6"/> - <enum-type name="StandardPixmap" extensible="yes"/> + <enum-type name="StandardPixmap"/> <enum-type name="StateFlag" flags="State"/> - <enum-type name="StyleHint" extensible="yes" /> - <enum-type name="SubControl" flags="SubControls" extensible="yes" force-integer="yes"/> - <enum-type name="SubElement" extensible="yes" /> + <enum-type name="StyleHint"/> + <enum-type name="SubControl" flags="SubControls"/> + <enum-type name="SubElement"/> <modify-function signature="drawComplexControl(QStyle::ComplexControl,const QStyleOptionComplex*,QPainter*,const QWidget*)const"> <modify-argument index="3" invalidate-after-use="yes"/> <modify-argument index="4"> @@ -1579,7 +1579,6 @@ <enum-type name="OptimizationFlag" flags="OptimizationFlags"/> <enum-type name="ViewportAnchor"/> <enum-type name="ViewportUpdateMode"/> - <modify-function signature="setupViewport(QWidget*)" access="non-final"/> <modify-function signature="setScene(QGraphicsScene*)"> <modify-argument index="1"> <reference-count action="set"/> @@ -1876,13 +1875,6 @@ </inject-code> </modify-function> - <!-- use glue code --> - <modify-function signature="drawItems(QPainter*,int,QGraphicsItem**,const QStyleOptionGraphicsItem*,QWidget*)"> - <modify-argument index="2"> - <remove-argument/> - </modify-argument> - </modify-function> - <modify-function signature="clear()"> <inject-code> const QList<QGraphicsItem*> items = %CPPSELF.items(); @@ -2491,6 +2483,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"/> @@ -2968,7 +2961,7 @@ </object-type> <object-type name="QDesktopWidget"/> <object-type name="QFrame"> - <enum-type name="Shadow" extensible="yes"/> + <enum-type name="Shadow"/> <enum-type name="Shape"/> <enum-type name="StyleMask"/> </object-type> diff --git a/sources/pyside2/PySide2/QtXmlPatterns/typesystem_xmlpatterns.xml b/sources/pyside2/PySide2/QtXmlPatterns/typesystem_xmlpatterns.xml index f4e690874..2ac150807 100644 --- a/sources/pyside2/PySide2/QtXmlPatterns/typesystem_xmlpatterns.xml +++ b/sources/pyside2/PySide2/QtXmlPatterns/typesystem_xmlpatterns.xml @@ -101,7 +101,7 @@ <modify-function signature="kind()const" remove="all" /> <modify-function signature="isDeepEqual(const QXmlNodeModelIndex&)const" remove="all" /> <modify-function signature="compareOrder(const QXmlNodeModelIndex &)const" remove="all" /> - <modify-function signature="sendNamespaces(QAbstractXmlReceiver*)const" remove="all" /> + <modify-function signature="sendNamespaces(QAbstractXmlReceiver*const)const" remove="all" /> <modify-function signature="namespaceBindings()const" remove="all" /> <modify-function signature="namespaceForPrefix(QXmlName::PrefixCode)const" remove="all" /> <modify-function signature="stringValue()const" remove="all" /> diff --git a/sources/pyside2/PySide2/typesystem_templates.xml b/sources/pyside2/PySide2/typesystem_templates.xml index a17337258..1a140906b 100644 --- a/sources/pyside2/PySide2/typesystem_templates.xml +++ b/sources/pyside2/PySide2/typesystem_templates.xml @@ -401,16 +401,6 @@ return pyData; </template> - <template name="matrix_fill_function"> - float value = %CONVERTTOCPP[float](%PYARG_1); - %CPPSELF.fill(value); - </template> - - <template name="matrix_transposed_function"> - %TRANSPOSED_TYPE transp = %CPPSELF.transposed(); - return %CONVERTTOPYTHON[%TRANSPOSED_TYPE](transp); - </template> - <!-- Replace '#' for the argument number you want. --> <template name="return_argument"> Py_INCREF(%PYARG_#); diff --git a/sources/pyside2/doc/codesnippets/doc/src/snippets/code/doc_src_qtcore.cpp b/sources/pyside2/doc/codesnippets/doc/src/snippets/code/doc_src_qtcore.py index 4696bd38b..4696bd38b 100644 --- a/sources/pyside2/doc/codesnippets/doc/src/snippets/code/doc_src_qtcore.cpp +++ b/sources/pyside2/doc/codesnippets/doc/src/snippets/code/doc_src_qtcore.py diff --git a/sources/pyside2/doc/codesnippets/doc/src/snippets/code/doc_src_qtnetwork.cpp b/sources/pyside2/doc/codesnippets/doc/src/snippets/code/doc_src_qtnetwork.py index 84e7e9189..84e7e9189 100644 --- a/sources/pyside2/doc/codesnippets/doc/src/snippets/code/doc_src_qtnetwork.cpp +++ b/sources/pyside2/doc/codesnippets/doc/src/snippets/code/doc_src_qtnetwork.py diff --git a/sources/pyside2/doc/codesnippets/doc/src/snippets/code/doc_src_qtopengl.cpp b/sources/pyside2/doc/codesnippets/doc/src/snippets/code/doc_src_qtopengl.py index 63c5665cd..63c5665cd 100644 --- a/sources/pyside2/doc/codesnippets/doc/src/snippets/code/doc_src_qtopengl.cpp +++ b/sources/pyside2/doc/codesnippets/doc/src/snippets/code/doc_src_qtopengl.py diff --git a/sources/pyside2/doc/codesnippets/doc/src/snippets/code/doc_src_qtprintsupport.cpp b/sources/pyside2/doc/codesnippets/doc/src/snippets/code/doc_src_qtprintsupport.py index fb5541603..fb5541603 100644 --- a/sources/pyside2/doc/codesnippets/doc/src/snippets/code/doc_src_qtprintsupport.cpp +++ b/sources/pyside2/doc/codesnippets/doc/src/snippets/code/doc_src_qtprintsupport.py diff --git a/sources/pyside2/doc/codesnippets/doc/src/snippets/code/doc_src_qtqml.cpp b/sources/pyside2/doc/codesnippets/doc/src/snippets/code/doc_src_qtqml.py index 3eeb024db..3eeb024db 100644 --- a/sources/pyside2/doc/codesnippets/doc/src/snippets/code/doc_src_qtqml.cpp +++ b/sources/pyside2/doc/codesnippets/doc/src/snippets/code/doc_src_qtqml.py diff --git a/sources/pyside2/doc/codesnippets/doc/src/snippets/code/doc_src_qtquick.cpp b/sources/pyside2/doc/codesnippets/doc/src/snippets/code/doc_src_qtquick.py index bf55f0c7e..bf55f0c7e 100644 --- a/sources/pyside2/doc/codesnippets/doc/src/snippets/code/doc_src_qtquick.cpp +++ b/sources/pyside2/doc/codesnippets/doc/src/snippets/code/doc_src_qtquick.py diff --git a/sources/pyside2/doc/codesnippets/doc/src/snippets/code/doc_src_qtsql.cpp b/sources/pyside2/doc/codesnippets/doc/src/snippets/code/doc_src_qtsql.py index 31849e785..31849e785 100644 --- a/sources/pyside2/doc/codesnippets/doc/src/snippets/code/doc_src_qtsql.cpp +++ b/sources/pyside2/doc/codesnippets/doc/src/snippets/code/doc_src_qtsql.py diff --git a/sources/pyside2/doc/codesnippets/doc/src/snippets/code/doc_src_qttest.cpp b/sources/pyside2/doc/codesnippets/doc/src/snippets/code/doc_src_qttest.py index 34dd7bb5a..34dd7bb5a 100644 --- a/sources/pyside2/doc/codesnippets/doc/src/snippets/code/doc_src_qttest.cpp +++ b/sources/pyside2/doc/codesnippets/doc/src/snippets/code/doc_src_qttest.py diff --git a/sources/pyside2/doc/codesnippets/doc/src/snippets/code/doc_src_qtwidgets.cpp b/sources/pyside2/doc/codesnippets/doc/src/snippets/code/doc_src_qtwidgets.py index a0deee957..a0deee957 100644 --- a/sources/pyside2/doc/codesnippets/doc/src/snippets/code/doc_src_qtwidgets.cpp +++ b/sources/pyside2/doc/codesnippets/doc/src/snippets/code/doc_src_qtwidgets.py diff --git a/sources/pyside2/doc/codesnippets/doc/src/snippets/code/doc_src_qtxml.cpp b/sources/pyside2/doc/codesnippets/doc/src/snippets/code/doc_src_qtxml.py index 077be436d..077be436d 100644 --- a/sources/pyside2/doc/codesnippets/doc/src/snippets/code/doc_src_qtxml.cpp +++ b/sources/pyside2/doc/codesnippets/doc/src/snippets/code/doc_src_qtxml.py diff --git a/sources/pyside2/doc/codesnippets/doc/src/snippets/doc_src_qtcharts.cpp b/sources/pyside2/doc/codesnippets/doc/src/snippets/doc_src_qtcharts.py index bfc35e1ee..bfc35e1ee 100644 --- a/sources/pyside2/doc/codesnippets/doc/src/snippets/doc_src_qtcharts.cpp +++ b/sources/pyside2/doc/codesnippets/doc/src/snippets/doc_src_qtcharts.py diff --git a/sources/pyside2/doc/codesnippets/doc/src/snippets/doc_src_qtgui.cpp b/sources/pyside2/doc/codesnippets/doc/src/snippets/doc_src_qtgui.py index 11c3cf5e9..11c3cf5e9 100644 --- a/sources/pyside2/doc/codesnippets/doc/src/snippets/doc_src_qtgui.cpp +++ b/sources/pyside2/doc/codesnippets/doc/src/snippets/doc_src_qtgui.py diff --git a/sources/pyside2/doc/codesnippets/doc/src/snippets/doc_src_qtmultimedia.cpp b/sources/pyside2/doc/codesnippets/doc/src/snippets/doc_src_qtmultimedia.py index 494145357..494145357 100644 --- a/sources/pyside2/doc/codesnippets/doc/src/snippets/doc_src_qtmultimedia.cpp +++ b/sources/pyside2/doc/codesnippets/doc/src/snippets/doc_src_qtmultimedia.py diff --git a/sources/pyside2/doc/codesnippets/doc/src/snippets/doc_src_qtxmlpatterns.cpp b/sources/pyside2/doc/codesnippets/doc/src/snippets/doc_src_qtxmlpatterns.py index c3363e97e..c3363e97e 100644 --- a/sources/pyside2/doc/codesnippets/doc/src/snippets/doc_src_qtxmlpatterns.cpp +++ b/sources/pyside2/doc/codesnippets/doc/src/snippets/doc_src_qtxmlpatterns.py diff --git a/sources/pyside2/doc/codesnippets/doc/src/snippets/quiloader/doc_src_qtuiloader.cpp b/sources/pyside2/doc/codesnippets/doc/src/snippets/quiloader/doc_src_qtuiloader.py index 141189ad8..141189ad8 100644 --- a/sources/pyside2/doc/codesnippets/doc/src/snippets/quiloader/doc_src_qtuiloader.cpp +++ b/sources/pyside2/doc/codesnippets/doc/src/snippets/quiloader/doc_src_qtuiloader.py diff --git a/sources/pyside2/libpyside/destroylistener.h b/sources/pyside2/libpyside/destroylistener.h index 0a800451a..d5643f98c 100644 --- a/sources/pyside2/libpyside/destroylistener.h +++ b/sources/pyside2/libpyside/destroylistener.h @@ -63,7 +63,7 @@ class PYSIDE_API DestroyListener : public QObject static DestroyListener* m_instance; DestroyListenerPrivate* m_d; DestroyListener(QObject *parent); - ~DestroyListener(); + ~DestroyListener() override; }; }//namespace diff --git a/sources/pyside2/libpyside/dynamicqmetaobject.cpp b/sources/pyside2/libpyside/dynamicqmetaobject.cpp index af2f416c6..4abbebb12 100644 --- a/sources/pyside2/libpyside/dynamicqmetaobject.cpp +++ b/sources/pyside2/libpyside/dynamicqmetaobject.cpp @@ -49,7 +49,6 @@ #include <QString> #include <QStringList> #include <QList> -#include <QLinkedList> #include <QObject> #include <cstring> #include <QDebug> @@ -111,21 +110,20 @@ public: QMap<QByteArray, QByteArray> m_info; QByteArray m_className; - bool m_updated; // when the meta data is not update - int m_methodOffset; - int m_propertyOffset; - int m_dataSize; - int m_emptyMethod; - int m_nullIndex; - - DynamicQMetaObjectPrivate() - : m_updated(false), m_methodOffset(0), m_propertyOffset(0), - m_dataSize(0), m_emptyMethod(-1), m_nullIndex(0) {} - - int createMetaData(QMetaObject* metaObj, QLinkedList<QByteArray> &strings); + + bool m_updated = false; // when the meta data is not update + int m_methodOffset = 0; + int m_propertyOffset = 0; + int m_dataSize = 0; + int m_emptyMethod = -1; + int m_nullIndex = 0; + + int createMetaData(QMetaObject* metaObj); void updateMetaObject(QMetaObject* metaObj); - void writeMethodsData(const QList<MethodData>& methods, unsigned int** data, QLinkedList<QByteArray>& strings, int* prtIndex, int nullIndex, int flags); - void writeStringData(char *, QLinkedList<QByteArray> &strings); + void writeMethodsData(const QList<MethodData>& methods, unsigned int** data, + QByteArrayList& strings, int* prtIndex, + int nullIndex, int flags); + void writeStringData(char *, const QByteArrayList& strings) const; int getPropertyNotifyId(PySideProperty *property) const; }; @@ -136,44 +134,29 @@ bool sortMethodSignalSlot(const MethodData &m1, const MethodData &m2) return false; } -static int registerString(const QByteArray& s, QLinkedList<QByteArray>& strings) +static int registerString(const QByteArray& s, QByteArrayList& strings) { - int idx = 0; - QLinkedList<QByteArray>::const_iterator it = strings.begin(); - QLinkedList<QByteArray>::const_iterator itEnd = strings.end(); - while (it != itEnd) { - if (strcmp(*it, s) == 0) - return idx; - ++idx; - ++it; + int idx = strings.indexOf(s); + if (idx == -1) { + idx = strings.size(); + strings.append(s); } - strings.append(s); return idx; } -static int blobSize(QLinkedList<QByteArray> &strings) +static int blobSize(const QByteArrayList &strings) { - int size = strings.size() * sizeof(QByteArrayData); - - QByteArray str; - QByteArray debug_str; - foreach (const QByteArray &field, strings) { - str.append(field); - str.append(char(0)); - - debug_str.append(field); - debug_str.append('|'); - } - //qDebug()<<debug_str; - size += str.size(); + int size = strings.size() * int(sizeof(QByteArrayData)); + for (const QByteArray &field : strings) + size += field.size() + 1; return size; } static int aggregateParameterCount(const QList<MethodData> &methods) { int sum = 0; - for (int i = 0; i < methods.size(); ++i) - sum += methods.at(i).parameterCount() * 2 + 1; // nb_param*2 (type and names) +1 for return type + for (const auto &method : methods) + sum += method.parameterCount() * 2 + 1; // nb_param*2 (type and names) +1 for return type return sum; } @@ -425,9 +408,8 @@ int DynamicQMetaObject::addMethod(QMetaMethod::MethodType mtype, const char* sig for (; it != m_d->m_methods.end(); ++it) { if ((it->signature() == signature) && (it->methodType() == mtype)) return m_d->m_methodOffset + counter; - else if (!it->isValid()) { + if (!it->isValid()) index = counter; - } counter++; } @@ -528,7 +510,7 @@ void DynamicQMetaObject::addInfo(const char* key, const char* value) m_d->m_info[key] = value; } -void DynamicQMetaObject::addInfo(QMap<QByteArray, QByteArray> info) +void DynamicQMetaObject::addInfo(const QMap<QByteArray, QByteArray> &info) { QMap<QByteArray, QByteArray>::const_iterator i = info.constBegin(); while (i != info.constEnd()) { @@ -549,7 +531,7 @@ const QMetaObject* DynamicQMetaObject::update() const void DynamicQMetaObject::DynamicQMetaObjectPrivate::writeMethodsData(const QList<MethodData>& methods, unsigned int** data, - QLinkedList<QByteArray>& strings, + QByteArrayList& strings, int* prtIndex, int nullIndex, int flags) @@ -601,9 +583,8 @@ void DynamicQMetaObject::parsePythonType(PyTypeObject *type) || baseType == reinterpret_cast<PyTypeObject *>(SbkObject_TypeF()) || baseType == reinterpret_cast<PyTypeObject *>(&PyBaseObject_Type)) { continue; - } else { - basesToCheck.append(baseType); } + basesToCheck.append(baseType); } // Prepend the actual type that we are parsing. @@ -685,7 +666,7 @@ void DynamicQMetaObject::parsePythonType(PyTypeObject *type) Allocate the meta data table. Returns the index in the table corresponding to the header fields count. */ -int DynamicQMetaObject::DynamicQMetaObjectPrivate::createMetaData(QMetaObject* metaObj, QLinkedList<QByteArray> &strings) +int DynamicQMetaObject::DynamicQMetaObjectPrivate::createMetaData(QMetaObject* metaObj) { const int n_methods = m_methods.size(); const int n_properties = m_properties.size(); @@ -725,17 +706,16 @@ int DynamicQMetaObject::DynamicQMetaObjectPrivate::createMetaData(QMetaObject* m // The struct consists of an array of QByteArrayData, followed by a char array // containing the actual strings. This format must match the one produced by // moc (see generator.cpp). -void DynamicQMetaObject::DynamicQMetaObjectPrivate::writeStringData(char *out, QLinkedList<QByteArray> &strings) +void DynamicQMetaObject::DynamicQMetaObjectPrivate::writeStringData(char *out, + const QByteArrayList& strings) const { Q_ASSERT(!(reinterpret_cast<quintptr>(out) & (Q_ALIGNOF(QByteArrayData)-1))); - int offsetOfStringdataMember = strings.size() * sizeof(QByteArrayData); + const int size = strings.size(); + const int offsetOfStringdataMember = size * int(sizeof(QByteArrayData)); int stringdataOffset = 0; - int i = 0; - foreach(const QByteArray& str, strings) { - writeString(out, i, str, offsetOfStringdataMember, stringdataOffset); - i++; - } + for (int i = 0; i < size; ++i) + writeString(out, i, strings.at(i), offsetOfStringdataMember, stringdataOffset); } QList<MethodData>::iterator is_sorted_until(QList<MethodData>::iterator first, @@ -762,21 +742,19 @@ bool is_sorted(QList<MethodData>::iterator first, QList<MethodData>::iterator la void DynamicQMetaObject::DynamicQMetaObjectPrivate::updateMetaObject(QMetaObject* metaObj) { Q_ASSERT(!m_updated); - uint *data = const_cast<uint*>(metaObj->d.data); - int index = 0; - QLinkedList<QByteArray> strings; m_dataSize = 0; // Recompute the size and reallocate memory // index is set after the last header field. - index = createMetaData(metaObj, strings); - data = const_cast<uint*>(metaObj->d.data); + int index = createMetaData(metaObj); + uint *data = const_cast<uint*>(metaObj->d.data); - registerString(m_className, strings); // register class string - m_nullIndex = registerString("", strings); // register a null string + QByteArrayList strings; + strings.append(m_className); // register class string + m_nullIndex = registerString(QByteArrayLiteral(""), strings); // register a null string // Write class info. - if (m_info.size()) { + if (!m_info.isEmpty()) { if (data[3] == 0) data[3] = index; @@ -821,7 +799,7 @@ void DynamicQMetaObject::DynamicQMetaObjectPrivate::updateMetaObject(QMetaObject PyErr_Clear(); } - if (m_methods.size()) { + if (!m_methods.empty()) { if (data[5] == 0) data[5] = index; @@ -829,7 +807,7 @@ void DynamicQMetaObject::DynamicQMetaObjectPrivate::updateMetaObject(QMetaObject } // Write signal/slots parameters. - if (m_methods.size()) { + if (!m_methods.empty()) { for (it = m_methods.begin(); it != m_methods.end(); ++it) { QList<QByteArray> paramTypeNames = it->parameterTypes(); int paramCount = paramTypeNames.size(); diff --git a/sources/pyside2/libpyside/dynamicqmetaobject.h b/sources/pyside2/libpyside/dynamicqmetaobject.h index 5ecce50c9..58fe84ffc 100644 --- a/sources/pyside2/libpyside/dynamicqmetaobject.h +++ b/sources/pyside2/libpyside/dynamicqmetaobject.h @@ -50,6 +50,7 @@ namespace PySide class DynamicQMetaObject : public QMetaObject { + Q_DISABLE_COPY(DynamicQMetaObject) public: DynamicQMetaObject(const char* className, const QMetaObject* metaObject); DynamicQMetaObject(PyTypeObject* type, const QMetaObject* metaobject); @@ -62,7 +63,7 @@ public: int addSlot(const char* slot, const char* type = 0); int addProperty(const char* property, PyObject* data); void addInfo(const char* key, const char* value); - void addInfo(QMap<QByteArray, QByteArray> info); + void addInfo(const QMap<QByteArray, QByteArray> &info); void removeSignal(uint idex); void removeSlot(uint index); diff --git a/sources/pyside2/libpyside/globalreceiver.cpp b/sources/pyside2/libpyside/globalreceiver.cpp index ee1f6354a..78382f5a4 100644 --- a/sources/pyside2/libpyside/globalreceiver.cpp +++ b/sources/pyside2/libpyside/globalreceiver.cpp @@ -44,7 +44,7 @@ #include <QMetaMethod> #include <QDebug> #include <QEvent> -#include <QLinkedList> +#include <QVector> #include <autodecref.h> #include <sbkconverter.h> #include <gilstate.h> @@ -57,6 +57,7 @@ namespace PySide { class DynamicSlotData { + Q_DISABLE_COPY(DynamicSlotData) public: DynamicSlotData(int id, PyObject* callback, GlobalReceiver* parent); void addRef(const QObject* o); @@ -77,7 +78,7 @@ class DynamicSlotData PyObject* m_pyClass; PyObject* m_weakRef; GlobalReceiver* m_parent; - QLinkedList<const QObject*> m_refs; + QVector<const QObject*> m_refs; }; } @@ -180,8 +181,8 @@ void DynamicSlotData::onCallbackDestroyed(void *data) //Disconnect all sources QMetaMethod m = self->m_parent->metaObject()->method(self->m_id); QByteArray methodName = QByteArray::number(m.methodType()).append(m.methodSignature()); - QLinkedList<const QObject*> sources = self->m_refs; - foreach(const QObject* src, sources) + const QVector<const QObject*> sources = self->m_refs; + for (const QObject* src : sources) const_cast<QObject*>(src)->disconnect(self->m_parent, methodName); self->m_weakRef = 0; } @@ -206,8 +207,9 @@ GlobalReceiver::~GlobalReceiver() void GlobalReceiver::connectNotify(QObject* source, int slotId) { - if (m_slotReceivers.contains(slotId)) { - DynamicSlotData* data = m_slotReceivers[slotId]; + const auto it = m_slotReceivers.constFind(slotId); + if (it != m_slotReceivers.cend()) { + DynamicSlotData* data = it.value(); if (!data->hasRefTo(source)) QObject::connect(source, SIGNAL(destroyed(QObject*)), this, "1" RECEIVER_DESTROYED_SLOT_NAME); data->addRef(source); @@ -216,8 +218,9 @@ void GlobalReceiver::connectNotify(QObject* source, int slotId) void GlobalReceiver::disconnectNotify(QObject* source, int slotId) { - if (m_slotReceivers.contains(slotId)) { - DynamicSlotData *data = m_slotReceivers[slotId]; + const auto it = m_slotReceivers.constFind(slotId); + if (it != m_slotReceivers.cend()) { + DynamicSlotData* data = it.value(); data->decRef(source); if (data->refCount() == 0) removeSlot(slotId); @@ -236,7 +239,7 @@ int GlobalReceiver::addSlot(const char* slot, PyObject* callback) { int slotId = m_metaObject.addSlot(slot); if (!m_slotReceivers.contains(slotId)) - m_slotReceivers[slotId] = new DynamicSlotData(slotId, callback, this); + m_slotReceivers.insert(slotId, new DynamicSlotData(slotId, callback, this)); bool isShortCircuit = true; for (int i = 0; slot[i]; ++i) { @@ -255,8 +258,10 @@ int GlobalReceiver::addSlot(const char* slot, PyObject* callback) void GlobalReceiver::removeSlot(int slotId) { - if (m_slotReceivers.contains(slotId)) { - delete m_slotReceivers.take(slotId); + auto it = m_slotReceivers.find(slotId); + if (it != m_slotReceivers.end()) { + delete it.value(); + m_slotReceivers.erase(it); m_metaObject.removeSlot(slotId); m_shortCircuitSlots.remove(slotId); } diff --git a/sources/pyside2/libpyside/globalreceiver.h b/sources/pyside2/libpyside/globalreceiver.h index 426d40bfe..8fbe2fe78 100644 --- a/sources/pyside2/libpyside/globalreceiver.h +++ b/sources/pyside2/libpyside/globalreceiver.h @@ -55,9 +55,10 @@ class GlobalReceiver : public QObject { public: GlobalReceiver(); - ~GlobalReceiver(); - int qt_metacall(QMetaObject::Call call, int id, void** args); - const QMetaObject* metaObject() const; + ~GlobalReceiver() override; + + int qt_metacall(QMetaObject::Call call, int id, void** args) override; + const QMetaObject* metaObject() const override; int addSlot(const char* slot, PyObject* callback); void removeSlot(int slotId); void connectNotify(QObject* sender, int slotId); diff --git a/sources/pyside2/libpyside/globalreceiverv2.cpp b/sources/pyside2/libpyside/globalreceiverv2.cpp index 05565e516..0c30f2c5f 100644 --- a/sources/pyside2/libpyside/globalreceiverv2.cpp +++ b/sources/pyside2/libpyside/globalreceiverv2.cpp @@ -62,6 +62,7 @@ namespace PySide { class DynamicSlotDataV2 { + Q_DISABLE_COPY(DynamicSlotDataV2) public: DynamicSlotDataV2(PyObject* callback, GlobalReceiverV2* parent); ~DynamicSlotDataV2(); @@ -128,11 +129,11 @@ QByteArray DynamicSlotDataV2::hash() const QByteArray DynamicSlotDataV2::hash(PyObject* callback) { Shiboken::GilState gil; - if (PyMethod_Check(callback)) + if (PyMethod_Check(callback)) { return QByteArray::number((qlonglong)PyObject_Hash(PyMethod_GET_FUNCTION(callback))) + QByteArray::number((qlonglong)PyObject_Hash(PyMethod_GET_SELF(callback))); - else - return QByteArray::number((qlonglong)PyObject_Hash(callback)); + } + return QByteArray::number(qlonglong(PyObject_Hash(callback))); } PyObject* DynamicSlotDataV2::callback() @@ -154,9 +155,8 @@ PyObject* DynamicSlotDataV2::callback() int DynamicSlotDataV2::id(const char* signature) const { - if (m_signatures.contains(signature)) - return m_signatures[signature]; - return -1; + const auto it = m_signatures.constFind(signature); + return it != m_signatures.cend() ? it.value() : -1; } int DynamicSlotDataV2::addSlot(const char* signature) @@ -189,8 +189,10 @@ DynamicSlotDataV2::~DynamicSlotDataV2() Py_DECREF(m_callback); } -GlobalReceiverV2::GlobalReceiverV2(PyObject *callback, SharedMap map) - : QObject(0), m_metaObject(GLOBAL_RECEIVER_CLASS_NAME, &QObject::staticMetaObject), m_sharedMap(map) +GlobalReceiverV2::GlobalReceiverV2(PyObject *callback, SharedMap map) : + QObject(nullptr), + m_metaObject(GLOBAL_RECEIVER_CLASS_NAME, &QObject::staticMetaObject), + m_sharedMap(std::move(map)) { m_data = new DynamicSlotDataV2(callback, this); m_metaObject.addSlot(RECEIVER_DESTROYED_SLOT_NAME); @@ -251,7 +253,7 @@ void GlobalReceiverV2::incRef(const QObject* link) void GlobalReceiverV2::decRef(const QObject* link) { - if (m_refs.size() <= 0) + if (m_refs.empty()) return; @@ -268,7 +270,7 @@ void GlobalReceiverV2::decRef(const QObject* link) } } - if (m_refs.size() == 0) + if (m_refs.empty()) Py_BEGIN_ALLOW_THREADS delete this; Py_END_ALLOW_THREADS @@ -328,9 +330,9 @@ int GlobalReceiverV2::qt_metacall(QMetaObject::Call call, int id, void** args) } if (id == DESTROY_SLOT_ID) { - if (m_refs.size() == 0) + if (m_refs.empty()) return -1; - QObject *obj = *(QObject**)args[1]; + QObject *obj = *reinterpret_cast<QObject**>(args[1]); incRef(); //keep the object live (safe ref) m_refs.removeAll(obj); // remove all refs to this object decRef(); //remove the safe ref diff --git a/sources/pyside2/libpyside/globalreceiverv2.h b/sources/pyside2/libpyside/globalreceiverv2.h index 880719d6f..0ec83bc11 100644 --- a/sources/pyside2/libpyside/globalreceiverv2.h +++ b/sources/pyside2/libpyside/globalreceiverv2.h @@ -78,13 +78,13 @@ public: /** * Destructor **/ - ~GlobalReceiverV2(); + ~GlobalReceiverV2() override; /** * Reimplemented function from QObject **/ - int qt_metacall(QMetaObject::Call call, int id, void** args); - const QMetaObject* metaObject() const; + int qt_metacall(QMetaObject::Call call, int id, void** args) override; + const QMetaObject* metaObject() const override; /** * Add a extra slot to this object @@ -122,14 +122,14 @@ public: int refCount(const QObject* link) const; /** - * Use to retrive the unique hash of this GlobalReceiver object + * Use to retrieve the unique hash of this GlobalReceiver object * * @return a string with a unique id based on GlobalReceiver contents **/ QByteArray hash() const; /** - * Use to retrive the unique hash of the PyObject based on GlobalReceiver rules + * Use to retrieve the unique hash of the PyObject based on GlobalReceiver rules * * @param callback The Python callable object used to calculate the id * @return a string with a unique id based on GlobalReceiver contents diff --git a/sources/pyside2/libpyside/pyside.cpp b/sources/pyside2/libpyside/pyside.cpp index b4f7d8771..367a1adc2 100644 --- a/sources/pyside2/libpyside/pyside.cpp +++ b/sources/pyside2/libpyside/pyside.cpp @@ -189,7 +189,8 @@ void destroyQCoreApplication() } struct TypeUserData { - TypeUserData(PyTypeObject* type, const QMetaObject* metaobject) : mo(type, metaobject) {} + explicit TypeUserData(PyTypeObject* type, const QMetaObject* metaobject, std::size_t size) : + mo(type, metaobject), cppObjSize(size) {} DynamicQMetaObject mo; std::size_t cppObjSize; }; @@ -201,11 +202,11 @@ std::size_t getSizeOfQObject(SbkObjectType* type) return userData->cppObjSize; } -void initDynamicMetaObject(SbkObjectType* type, const QMetaObject* base, const std::size_t& cppObjSize) +void initDynamicMetaObject(SbkObjectType* type, const QMetaObject* base, std::size_t cppObjSize) { //create DynamicMetaObject based on python type - TypeUserData* userData = new TypeUserData(reinterpret_cast<PyTypeObject*>(type), base); - userData->cppObjSize = cppObjSize; + auto userData = + new TypeUserData(reinterpret_cast<PyTypeObject*>(type), base, cppObjSize); userData->mo.update(); Shiboken::ObjectType::setTypeUserData(type, userData, Shiboken::callCppDestructor<TypeUserData>); @@ -299,7 +300,7 @@ PyObject* getMetaDataFromQObject(QObject* cppSelf, PyObject* self, PyObject* nam } } } - if (signalList.size() > 0) { + if (!signalList.empty()) { PyObject* pySignal = reinterpret_cast<PyObject*>(Signal::newObjectFromMethod(self, signalList)); PyObject_SetAttr(self, name, pySignal); return pySignal; @@ -366,7 +367,7 @@ PyObject* getWrapperForQObject(QObject* cppSelf, SbkObjectType* sbk_type) // set and check if it's created after the set call QVariant existing = cppSelf->property(invalidatePropertyName); if (!existing.isValid()) { - QSharedPointer<any_t> shared_with_del((any_t*)cppSelf, invalidatePtr); + QSharedPointer<any_t> shared_with_del(reinterpret_cast<any_t*>(cppSelf), invalidatePtr); cppSelf->setProperty(invalidatePropertyName, QVariant::fromValue(shared_with_del)); pyOut = reinterpret_cast<PyObject *>(Shiboken::BindingManager::instance().retrieveWrapper(cppSelf)); if (pyOut) { diff --git a/sources/pyside2/libpyside/pyside.h b/sources/pyside2/libpyside/pyside.h index e2e108ed8..d9ae9dcdf 100644 --- a/sources/pyside2/libpyside/pyside.h +++ b/sources/pyside2/libpyside/pyside.h @@ -101,7 +101,8 @@ struct initQtMetaType<T, false> { }; PYSIDE_DEPRECATED(PYSIDE_API void initDynamicMetaObject(SbkObjectType* type, const QMetaObject* base)); -PYSIDE_API void initDynamicMetaObject(SbkObjectType* type, const QMetaObject* base, const std::size_t& cppObjSize); +PYSIDE_API void initDynamicMetaObject(SbkObjectType* type, const QMetaObject* base, + std::size_t cppObjSize); PYSIDE_API void initQObjectSubType(SbkObjectType* type, PyObject* args, PyObject* kwds); /// Return the size in bytes of a type that inherits QObject. diff --git a/sources/pyside2/libpyside/pysideclassinfo.cpp b/sources/pyside2/libpyside/pysideclassinfo.cpp index 24a0c642b..645c03011 100644 --- a/sources/pyside2/libpyside/pysideclassinfo.cpp +++ b/sources/pyside2/libpyside/pysideclassinfo.cpp @@ -74,9 +74,8 @@ static PyType_Spec PySideClassInfoType_spec = { PyTypeObject *PySideClassInfoTypeF(void) { - static PyTypeObject *type = nullptr; - if (!type) - type = (PyTypeObject *)PyType_FromSpec(&PySideClassInfoType_spec); + static PyTypeObject *type = + reinterpret_cast<PyTypeObject *>(PyType_FromSpec(&PySideClassInfoType_spec)); return type; } diff --git a/sources/pyside2/libpyside/pysideproperty.cpp b/sources/pyside2/libpyside/pysideproperty.cpp index 279e09ec1..1929f999a 100644 --- a/sources/pyside2/libpyside/pysideproperty.cpp +++ b/sources/pyside2/libpyside/pysideproperty.cpp @@ -173,7 +173,8 @@ int qpropertyTpInit(PyObject* self, PyObject* args, PyObject* kwds) "designable", "scriptable", "stored", "user", "constant", "final", 0}; if (!PyArg_ParseTupleAndKeywords(args, kwds, - "O|OOOOsObbbbbb:QtCore.QProperty", (char**) kwlist, + "O|OOOOsObbbbbb:QtCore.QProperty", + const_cast<char**>(kwlist), /*OO*/ &type, &(pData->fget), /*OOO*/ &(pData->fset), &(pData->freset), &(pData->fdel), /*s*/ &(pData->doc), @@ -197,14 +198,13 @@ int qpropertyTpInit(PyObject* self, PyObject* args, PyObject* kwds) Py_XINCREF(pData->fdel); Py_XINCREF(pData->notify); return 1; - } else { - pData->fget = 0; - pData->fset = 0; - pData->freset = 0; - pData->fdel = 0; - pData->notify = 0; - return -1; } + pData->fget = nullptr; + pData->fset = nullptr; + pData->freset = nullptr; + pData->fdel = nullptr; + pData->notify = nullptr; + return -1; } void qpropertyDeAlloc(PyObject* self) @@ -225,10 +225,9 @@ PyObject *qPropertyCall(PyObject *self, PyObject *args, PyObject * /* kw */) Py_INCREF(self); return self; - } else { - PyErr_SetString(PyExc_TypeError, "Invalid property usage."); - return 0; } + PyErr_SetString(PyExc_TypeError, "Invalid property usage."); + return nullptr; } PyObject* qPropertySetter(PyObject* self, PyObject* callback) @@ -242,10 +241,9 @@ PyObject* qPropertySetter(PyObject* self, PyObject* callback) Py_INCREF(callback); return callback; - } else { - PyErr_SetString(PyExc_TypeError, "Invalid property setter agument."); - return 0; } + PyErr_SetString(PyExc_TypeError, "Invalid property setter agument."); + return nullptr; } PyObject* qPropertyGetter(PyObject* self, PyObject* callback) @@ -259,10 +257,9 @@ PyObject* qPropertyGetter(PyObject* self, PyObject* callback) Py_INCREF(callback); return callback; - } else { - PyErr_SetString(PyExc_TypeError, "Invalid property getter agument."); - return 0; } + PyErr_SetString(PyExc_TypeError, "Invalid property getter agument."); + return nullptr; } static int qpropertyTraverse(PyObject* self, visitproc visit, void* arg) diff --git a/sources/pyside2/libpyside/pysideqflags.cpp b/sources/pyside2/libpyside/pysideqflags.cpp index 7a8fa2a05..c33758c5e 100644 --- a/sources/pyside2/libpyside/pysideqflags.cpp +++ b/sources/pyside2/libpyside/pysideqflags.cpp @@ -174,13 +174,8 @@ namespace QFlags newspec->itemsize = SbkNewQFlagsType_spec.itemsize; newspec->flags = SbkNewQFlagsType_spec.flags; int idx = -1; -#ifdef IS_PY3K -# define SLOT slot -#else -# define SLOT slot_ -#endif - while (numberMethods[++idx].SLOT) { - assert(SbkNewQFlagsType_slots[idx].SLOT == numberMethods[idx].SLOT); + while (numberMethods[++idx].slot) { + assert(SbkNewQFlagsType_slots[idx].slot == numberMethods[idx].slot); SbkNewQFlagsType_slots[idx].pfunc = numberMethods[idx].pfunc; } newspec->slots = SbkNewQFlagsType_spec.slots; diff --git a/sources/pyside2/libpyside/pysidesignal.cpp b/sources/pyside2/libpyside/pysidesignal.cpp index 2d423a634..1052bbfb2 100644 --- a/sources/pyside2/libpyside/pysidesignal.cpp +++ b/sources/pyside2/libpyside/pysidesignal.cpp @@ -1,3 +1,5 @@ +#include <utility> + /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. @@ -54,14 +56,15 @@ namespace Signal { //aux class SignalSignature { public: - SignalSignature() : m_attributes(QMetaMethod::Compatibility) {} - SignalSignature(QByteArray parameterTypes) : m_parameterTypes(parameterTypes), - m_attributes(QMetaMethod::Compatibility) {} - SignalSignature(QByteArray parameterTypes, QMetaMethod::Attributes attributes) : - m_parameterTypes(parameterTypes), + SignalSignature() = default; + explicit SignalSignature(QByteArray parameterTypes) : + m_parameterTypes(std::move(parameterTypes)) {} + explicit SignalSignature(QByteArray parameterTypes, QMetaMethod::Attributes attributes) : + m_parameterTypes(std::move(parameterTypes)), m_attributes(attributes) {} + QByteArray m_parameterTypes; - QMetaMethod::Attributes m_attributes; + QMetaMethod::Attributes m_attributes = QMetaMethod::Compatibility; }; static char* buildSignature(const char*, const char*); @@ -412,8 +415,7 @@ PyObject* signalInstanceConnect(PyObject* self, PyObject* args, PyObject* kwds) PyObject* result = PyObject_CallObject(pyMethod, tupleArgs); if (result == Py_True || result == Py_False) return result; - else - Py_XDECREF(result); + Py_XDECREF(result); } if (!PyErr_Occurred()) // PYSIDE-79: inverse the logic. A Null return needs an error. PyErr_Format(PyExc_RuntimeError, "Failed to connect signal %s.", source->d->signature); @@ -661,9 +663,10 @@ char* getTypeName(PyObject* type) typeName = strdup("PyObject"); } return typeName; - } else if (type == Py_None) { // Must be checked before as Shiboken::String::check accepts Py_None + } + if (type == Py_None) // Must be checked before as Shiboken::String::check accepts Py_None return strdup("void"); - } else if (Shiboken::String::check(type)) { + if (Shiboken::String::check(type)) { const char *result = Shiboken::String::toCString(type); if (!strcmp(result, "qreal")) result = sizeof(qreal) == sizeof(double) ? "double" : "float"; @@ -835,7 +838,7 @@ template<typename T> static typename T::value_type join(T t, const char* sep) { typename T::value_type res; - if (!t.size()) + if (t.isEmpty()) return res; typename T::const_iterator it = t.begin(); @@ -894,7 +897,7 @@ void registerSignals(SbkObjectType* pyObj, const QMetaObject* metaObject) self->signaturesSize = 0; self->signatures = 0; self->signatureAttributes = 0; - self->initialized = 0; + self->initialized = false; self->homonymousMethod = 0; // Empty signatures comes first! So they will be the default signal signature @@ -949,9 +952,9 @@ QStringList getArgsFromSignature(const char* signature, bool* isShortCircuit) if (isShortCircuit) *isShortCircuit = !qsignature.contains(QLatin1Char('(')); - if (qsignature.contains(QLatin1String("()")) || qsignature.contains(QLatin1String("(void)"))) { + if (qsignature.contains(QLatin1String("()")) || qsignature.contains(QLatin1String("(void)"))) return result; - } else if (qsignature.contains(QLatin1Char('('))) { + if (qsignature.contains(QLatin1Char('('))) { static QRegExp regex(QLatin1String(".+\\((.*)\\)")); //get args types QString types = qsignature; @@ -1047,9 +1050,8 @@ QString codeCallbackName(PyObject* callback, const QString& funcName) PyObject* self = PyMethod_GET_SELF(callback); PyObject* func = PyMethod_GET_FUNCTION(callback); return funcName + QString::number(quint64(self), 16) + QString::number(quint64(func), 16); - } else { - return funcName + QString::number(quint64(callback), 16); } + return funcName + QString::number(quint64(callback), 16); } } //namespace Signal diff --git a/sources/pyside2/libpyside/pysideslot.cpp b/sources/pyside2/libpyside/pysideslot.cpp index fddff54fa..817857053 100644 --- a/sources/pyside2/libpyside/pysideslot.cpp +++ b/sources/pyside2/libpyside/pysideslot.cpp @@ -96,8 +96,10 @@ int slotTpInit(PyObject *self, PyObject *args, PyObject *kw) if (emptyTuple == 0) emptyTuple = PyTuple_New(0); - if (!PyArg_ParseTupleAndKeywords(emptyTuple, kw, "|sO:QtCore." SLOT_DEC_NAME, (char**) kwlist, &argName, &argResult)) + if (!PyArg_ParseTupleAndKeywords(emptyTuple, kw, "|sO:QtCore." SLOT_DEC_NAME, + const_cast<char**>(kwlist), &argName, &argResult)) { return 0; + } PySideSlot *data = reinterpret_cast<PySideSlot*>(self); for(Py_ssize_t i = 0, i_max = PyTuple_Size(args); i < i_max; i++) { diff --git a/sources/pyside2/libpyside/pysideweakref.cpp b/sources/pyside2/libpyside/pysideweakref.cpp index 906aafd7c..a0b7f4aaa 100644 --- a/sources/pyside2/libpyside/pysideweakref.cpp +++ b/sources/pyside2/libpyside/pysideweakref.cpp @@ -65,7 +65,7 @@ static PyType_Spec PySideCallableObjectType_spec = { }; -static PyTypeObject *PySideCallableObjectTypeF(void) +static PyTypeObject *PySideCallableObjectTypeF() { static PyTypeObject *type = (PyTypeObject *)PyType_FromSpec(&PySideCallableObjectType_spec); diff --git a/sources/pyside2/libpyside/signalmanager.cpp.in b/sources/pyside2/libpyside/signalmanager.cpp.in index c67bc6369..9b5c5eb9a 100644 --- a/sources/pyside2/libpyside/signalmanager.cpp.in +++ b/sources/pyside2/libpyside/signalmanager.cpp.in @@ -142,11 +142,16 @@ PyObjectWrapper::~PyObjectWrapper() Py_XDECREF(m_me); } -PyObjectWrapper& PyObjectWrapper::operator=(const PySide::PyObjectWrapper& other) +void PyObjectWrapper::reset(PyObject *o) { - Py_XINCREF(other.m_me); + Py_XINCREF(o); Py_XDECREF(m_me); - m_me = other.m_me; + m_me = o; +} + +PyObjectWrapper& PyObjectWrapper::operator=(const PySide::PyObjectWrapper& other) +{ + reset(other.m_me); return *this; } @@ -205,10 +210,9 @@ QDataStream &operator>>(QDataStream& in, PyObjectWrapper& myObj) in >> repr; Shiboken::AutoDecRef pyCode(PyBytes_FromStringAndSize(repr.data(), repr.size())); Shiboken::AutoDecRef value(PyObject_CallFunctionObjArgs(eval_func, pyCode.object(), 0)); - if (!value.object()) { - value = Py_None; - } - myObj = PyObjectWrapper(value); + if (!value.object()) + value.reset(Py_None); + myObj.reset(value); return in; } @@ -321,7 +325,7 @@ void SignalManager::globalReceiverDisconnectNotify(QObject* source, int slotInde void SignalManager::addGlobalSlot(const char* slot, PyObject* callback) { - addGlobalSlotGetIndex(slot, callback); + m_d->m_globalReceiver.addSlot(slot, callback); } int SignalManager::addGlobalSlotGetIndex(const char* slot, PyObject* callback) @@ -334,14 +338,16 @@ QObject* SignalManager::globalReceiver(QObject *sender, PyObject *callback) SharedMap globalReceivers = m_d->m_globalReceivers; QByteArray hash = GlobalReceiverV2::hash(callback); GlobalReceiverV2* gr = 0; - if (!globalReceivers->contains(hash)) { - gr = (*globalReceivers)[hash] = new GlobalReceiverV2(callback, globalReceivers); + auto it = globalReceivers->find(hash); + if (it == globalReceivers->end()) { + gr = new GlobalReceiverV2(callback, globalReceivers); + globalReceivers->insert(hash, gr); if (sender) { gr->incRef(sender); // create a link reference gr->decRef(); // remove extra reference } } else { - gr = (*globalReceivers)[hash]; + gr = it.value(); if (sender) gr->incRef(sender); } @@ -574,7 +580,11 @@ bool SignalManager::registerMetaMethod(QObject* source, const char* signature, Q int SignalManager::registerMetaMethodGetIndex(QObject* source, const char* signature, QMetaMethod::MethodType type) { - Q_ASSERT(source); + if (!source) { + qWarning("SignalManager::registerMetaMethodGetIndex(\"%s\") called with source=nullptr.", + signature); + return -1; + } const QMetaObject* metaObject = source->metaObject(); int methodIndex = metaObject->indexOfMethod(signature); // Create the dynamic signal is needed @@ -617,7 +627,7 @@ bool SignalManager::hasConnectionWith(const QObject *object) return m_d->m_globalReceiver.hasConnectionWith(object); } -const QMetaObject* SignalManager::retriveMetaObject(PyObject *self) +const QMetaObject* SignalManager::retrieveMetaObject(PyObject *self) { Shiboken::GilState gil; DynamicQMetaObject *mo = 0; diff --git a/sources/pyside2/libpyside/signalmanager.h b/sources/pyside2/libpyside/signalmanager.h index 5948a7df1..745c1e55a 100644 --- a/sources/pyside2/libpyside/signalmanager.h +++ b/sources/pyside2/libpyside/signalmanager.h @@ -53,12 +53,19 @@ namespace PySide class PYSIDE_API PyObjectWrapper { public: + PyObjectWrapper(PyObjectWrapper&&) = delete; + PyObjectWrapper& operator=(PyObjectWrapper &&) = delete; + PyObjectWrapper(); - PyObjectWrapper(PyObject* me); + explicit PyObjectWrapper(PyObject* me); PyObjectWrapper(const PyObjectWrapper &other); + PyObjectWrapper& operator=(const PyObjectWrapper &other); + + void reset(PyObject *o); + ~PyObjectWrapper(); operator PyObject*() const; - PyObjectWrapper& operator=(const PyObjectWrapper &other); + private: PyObject* m_me; }; @@ -68,6 +75,7 @@ PYSIDE_API QDataStream &operator>>(QDataStream& in, PyObjectWrapper& myObj); class PYSIDE_API SignalManager { + Q_DISABLE_COPY(SignalManager) public: static SignalManager& instance(); @@ -84,7 +92,7 @@ public: static int registerMetaMethodGetIndex(QObject* source, const char* signature, QMetaMethod::MethodType type); // used to discovery metaobject - static const QMetaObject* retriveMetaObject(PyObject* self); + static const QMetaObject* retrieveMetaObject(PyObject* self); // Used to discovery if SignalManager was connected with object "destroyed()" signal. int countConnectionsWith(const QObject *object); @@ -109,10 +117,6 @@ private: SignalManager(); ~SignalManager(); - - // disable copy - SignalManager(const SignalManager&); - SignalManager operator=(const SignalManager&); }; } diff --git a/sources/pyside2/pyside_version.py b/sources/pyside2/pyside_version.py index 789812464..a883bab96 100644 --- a/sources/pyside2/pyside_version.py +++ b/sources/pyside2/pyside_version.py @@ -38,16 +38,10 @@ ############################################################################# major_version = "5" -minor_version = "11" -patch_version = "1" - -# For example: "a", "b", "rc" -# (which means "alpha", "beta", "release candidate"). -# An empty string means the generated package will be an official release. -pre_release_version_type = "a" - -# For example: "1", "2" (which means "beta1", "beta2", if type is "b"). -pre_release_version = "1" +minor_version = "12" +patch_version = "0" +pre_release_version_type = "a" # e.g. "a", "b", "rc". +pre_release_version = "1" # e.g "1", "2", (which means "beta1", "beta2", if type is "b") if __name__ == '__main__': # Used by CMake. diff --git a/sources/pyside2/tests/CMakeLists.txt b/sources/pyside2/tests/CMakeLists.txt index 2386950e9..bed2d7cc1 100644 --- a/sources/pyside2/tests/CMakeLists.txt +++ b/sources/pyside2/tests/CMakeLists.txt @@ -46,7 +46,7 @@ else() set_tests_properties(${TEST_NAME} PROPERTIES TIMEOUT ${CTEST_TESTING_TIMEOUT} WILL_FAIL ${EXPECT_TO_FAIL} - ENVIRONMENT "PYTHONPATH=${TEST_PYTHONPATH};${LIBRARY_PATH_VAR}=${TEST_LIBRARY_PATH};PYSIDE_DISABLE_INTERNAL_QT_CONF=1;QT_NO_GLIB=1") + ENVIRONMENT "PYTHONPATH=${TEST_PYTHONPATH};${LIBRARY_PATH_VAR}=${TEST_LIBRARY_PATH};PYSIDE_DISABLE_INTERNAL_QT_CONF=1;QT_NO_GLIB=1;QT_MAC_WANTS_LAYER=0") endmacro() if (NOT DISABLE_QtCore AND NOT DISABLE_QtGui AND NOT DISABLE_QtWidgets) 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/QtGui/qmatrix_test.py b/sources/pyside2/tests/QtGui/qmatrix_test.py index cac8a7ab7..a917199c1 100644 --- a/sources/pyside2/tests/QtGui/qmatrix_test.py +++ b/sources/pyside2/tests/QtGui/qmatrix_test.py @@ -29,7 +29,7 @@ import unittest from PySide2.QtCore import QPoint -from PySide2.QtGui import QMatrix, QMatrix4x4 +from PySide2.QtGui import QMatrix, QMatrix2x2, QMatrix4x4 def qpointTimesQMatrix(point, matrix): @@ -49,6 +49,19 @@ class QMatrixTest(unittest.TestCase): point = QPoint(3, 3) self.assertRaises(TypeError, matrix.__mul__, point) + def testMatrix2x2(self): + matrix = QMatrix2x2([1.0, 2.0, 3.0, 4.0]) + + expectedTransposed = QMatrix2x2([1.0, 3.0, 2.0, 4.0]) + self.assertEqual(matrix.transposed(), expectedTransposed) + + expectedMultiplied = QMatrix2x2([2.0, 4.0, 6.0, 8.0]) + matrix *= 2.0 + self.assertEqual(matrix, expectedMultiplied) + + matrix.setToIdentity() + self.assertTrue(matrix.isIdentity()) + def testMatrix4x4(self): self.assertRaises(TypeError, QMatrix4x4, [0.0, 1.0, 2.0, 3.0]) self.assertRaises(TypeError, QMatrix4x4, [0.0, 1.0, 2.0, 'I', 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() diff --git a/sources/pyside2/tests/QtWidgets/python_properties_test.py b/sources/pyside2/tests/QtWidgets/python_properties_test.py index f5bcf5eb8..f4e46f2bd 100644 --- a/sources/pyside2/tests/QtWidgets/python_properties_test.py +++ b/sources/pyside2/tests/QtWidgets/python_properties_test.py @@ -39,6 +39,8 @@ class Properties(unittest.TestCase): p = QtWidgets.QStyleOptionViewItem() self.assertTrue(isinstance(p.locale, QtCore.QLocale)) + # PSYIDE-304, can assign to a "const QWidget *" field + p.widget = None if __name__ == '__main__': unittest.main() diff --git a/sources/pyside2/tests/pysidetest/CMakeLists.txt b/sources/pyside2/tests/pysidetest/CMakeLists.txt index c6d3bb13b..5b7f0fde1 100644 --- a/sources/pyside2/tests/pysidetest/CMakeLists.txt +++ b/sources/pyside2/tests/pysidetest/CMakeLists.txt @@ -3,9 +3,6 @@ project(testbinding) cmake_minimum_required(VERSION 3.1) -# On Windows, don't link to qtmain.lib for executables automatically. -cmake_policy(SET CMP0020 OLD) - set(QT_USE_QTCORE 1) # no more supported: include(${QT_USE_FILE}) add_definitions(${Qt5Core_DEFINITIONS}) |