diff options
| author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2022-03-16 14:41:39 +0100 |
|---|---|---|
| committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2022-03-17 06:27:21 +0100 |
| commit | 71f584197063e907910653fa8bddcde617210544 (patch) | |
| tree | 3aa3a413c308b3fedd6218fc818f21df2193eaf8 /sources/pyside6/libpyside/pysidemetafunction.cpp | |
| parent | b8a2baada13297a94e4c8a44dddf500f7d1f8e53 (diff) | |
Port code to use size() instead of count() of Qt containers
count() will be deprecated.
Fix some integer types in loops and modernize code
in changed lines.
Pick-to: 6.2
Change-Id: Idf21927661ea6c8866ee36e7c623043271e21620
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/pyside6/libpyside/pysidemetafunction.cpp')
| -rw-r--r-- | sources/pyside6/libpyside/pysidemetafunction.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sources/pyside6/libpyside/pysidemetafunction.cpp b/sources/pyside6/libpyside/pysidemetafunction.cpp index 48964749a..218eca4cf 100644 --- a/sources/pyside6/libpyside/pysidemetafunction.cpp +++ b/sources/pyside6/libpyside/pysidemetafunction.cpp @@ -138,19 +138,19 @@ bool call(QObject *self, int methodIndex, PyObject *args, PyObject **retVal) // args given plus return type Shiboken::AutoDecRef sequence(PySequence_Fast(args, nullptr)); - int numArgs = PySequence_Fast_GET_SIZE(sequence.object()) + 1; + qsizetype numArgs = PySequence_Fast_GET_SIZE(sequence.object()) + 1; - if (numArgs - 1 > argTypes.count()) { + if (numArgs - 1 > argTypes.size()) { PyErr_Format(PyExc_TypeError, "%s only accepts %d argument(s), %d given!", method.methodSignature().constData(), - argTypes.count(), numArgs - 1); + argTypes.size(), numArgs - 1); return false; } - if (numArgs - 1 < argTypes.count()) { + if (numArgs - 1 < argTypes.size()) { PyErr_Format(PyExc_TypeError, "%s needs %d argument(s), %d given!", method.methodSignature().constData(), - argTypes.count(), numArgs - 1); + argTypes.size(), numArgs - 1); return false; } |
