From ceeb82693a0240b1dd4f51605ba21413927ee558 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 19 May 2020 11:55:10 +0200 Subject: Initial port of Core,Gui,Widgets,Network,Qml,Quick to Qt 6 Test failures: shiboken2:testmodifyfunction pyside2:QtCore::qbytearray_test pyside2:QtGui::bug_PYSIDE-41 pyside2:QtGui::deepcopy_test pyside2:QtGui::qfontmetrics_test pyside2:QtGui::qpixmapcache_test pyside2:QtWidgets::api2_test (QTBUG-85417) pyside2:QtWidgets::bug_632 pyside2:QtWidgets::bug_714 pyside2:QtWidgets::bug_785 pyside2:QtWidgets::qshortcut_test pyside2:QtQml::bug_825 pyside2:QtQml::bug_1029 pyside2:QtQml::registertype pyside2:QtQml::qqmlincubator_incubateWhile pyside2:QtQml::signal_arguments Task-number: PYSIDE-1339 Task-number: PYSIDE-904 Change-Id: Ia43d7ed037dfdd07def0edd76bada2243e73d335 Reviewed-by: Christian Tismer --- sources/pyside2/PySide2/glue/qtcore.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'sources/pyside2/PySide2/glue/qtcore.cpp') diff --git a/sources/pyside2/PySide2/glue/qtcore.cpp b/sources/pyside2/PySide2/glue/qtcore.cpp index a0ca23662..6d8c0876d 100644 --- a/sources/pyside2/PySide2/glue/qtcore.cpp +++ b/sources/pyside2/PySide2/glue/qtcore.cpp @@ -647,8 +647,10 @@ if (%PYARG_0 == Py_None) // @snippet qline-hash namespace PySide { - template<> inline Py_ssize_t hash(const QLine &v) { - return qHash(qMakePair(qMakePair(v.x1(), v.y1()), qMakePair(v.x2(), v.y2()))); + template<> inline Py_ssize_t hash(const QLine &l) + { + const int v[4] = {l.x1(), l.y1(), l.x2(), l.y2()}; + return qHashRange(v, v + 4); } }; // @snippet qline-hash @@ -723,8 +725,9 @@ namespace PySide { // @snippet qrect namespace PySide { - template<> inline Py_ssize_t hash(const QRect &v) { - return qHash(qMakePair(qMakePair(v.x(), v.y()), qMakePair(v.width(), v.height()))); + template<> inline Py_ssize_t hash(const QRect &r) { + const int v[4] = {r.x(), r.y(), r.width(), r.height()}; + return qHashRange(v, v + 4); } }; // @snippet qrect @@ -801,11 +804,6 @@ static QObject *_findChildHelper(const QObject *parent, const QString &name, PyT return nullptr; } -static inline bool _findChildrenComparator(const QObject *&child, const QRegExp &name) -{ - return name.indexIn(child->objectName()) != -1; -} - static inline bool _findChildrenComparator(const QObject *&child, const QRegularExpression &name) { return name.match(child->objectName()).hasMatch(); -- cgit v1.2.3