aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2
diff options
context:
space:
mode:
Diffstat (limited to 'sources/pyside2')
-rw-r--r--sources/pyside2/libpyside/pysidemetafunction.cpp8
-rw-r--r--sources/pyside2/tests/pysidetest/testobject.h2
2 files changed, 5 insertions, 5 deletions
diff --git a/sources/pyside2/libpyside/pysidemetafunction.cpp b/sources/pyside2/libpyside/pysidemetafunction.cpp
index 0b7799af1..96ed953b6 100644
--- a/sources/pyside2/libpyside/pysidemetafunction.cpp
+++ b/sources/pyside2/libpyside/pysidemetafunction.cpp
@@ -176,19 +176,19 @@ bool call(QObject *self, int methodIndex, PyObject *args, PyObject **retVal)
Shiboken::Conversions::SpecificConverter converter(typeName);
if (converter) {
- int typeId = QMetaType::fromName(typeName).id();
+ QMetaType metaType = QMetaType::fromName(typeName);
if (!Shiboken::Conversions::pythonTypeIsObjectType(converter)) {
- if (!typeId) {
+ if (!metaType.isValid()) {
PyErr_Format(PyExc_TypeError, "Value types used on meta functions (including signals) need to be "
"registered on meta type: %s", typeName.data());
break;
}
- methValues[i] = QVariant(static_cast<QVariant::Type>(typeId));
+ methValues[i] = QVariant(metaType);
}
methArgs[i] = methValues[i].data();
if (i == 0) // Don't do this for return type
continue;
- if (typeId == QVariant::String) {
+ if (metaType.id() == QMetaType::QString) {
QString tmp;
converter.toCpp(PySequence_Fast_GET_ITEM(sequence.object(), i - 1), &tmp);
methValues[i] = tmp;
diff --git a/sources/pyside2/tests/pysidetest/testobject.h b/sources/pyside2/tests/pysidetest/testobject.h
index 41a97a0db..c31a2ab73 100644
--- a/sources/pyside2/tests/pysidetest/testobject.h
+++ b/sources/pyside2/tests/pysidetest/testobject.h
@@ -55,7 +55,7 @@ class PYSIDETEST_API TestObject : public QObject
Q_OBJECT
public:
static void createApp() { int argc=0; new QApplication(argc, 0); };
- static int checkType(const QVariant& var) { return (int)var.type(); }
+ static int checkType(const QVariant& var) { return var.metaType().id(); }
TestObject(int idValue, QObject* parent = 0) : QObject(parent), m_idValue(idValue) {}
int idValue() const { return m_idValue; }