From cc2db7a49c9208a00a913f7c4a410009814a5580 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 10 Feb 2011 13:26:56 +0100 Subject: QtDBus meta object: keep methods, signals and props with unknown types Use VoidStar as the metatype, with an unknown type called "QDBusRawType". The actual D-Bus type is saved as an hex value as a template parameter. D-Bus type Qt type comment h QDBusRawType<0x68>* Unix file descriptors ~ QDBusRawType<0x7e>* invalid type ai QDBusRawType<0x6169>* array of int32 a{i(ssy)} QDBusRawType<0x617b6928737379297d>* Note that the number in the template doesn't have to be valid. The QDBusRawType class doesn't exist anyway. I thought of just leaving the raw D-Bus type there, but who knows what kind of things can appear there, like other '>' (which may cause problems for anything trying to parse the meta object later). Task-number: QTBUG-17476 --- tests/auto/qdbusinterface/tst_qdbusinterface.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'tests/auto/qdbusinterface') diff --git a/tests/auto/qdbusinterface/tst_qdbusinterface.cpp b/tests/auto/qdbusinterface/tst_qdbusinterface.cpp index 37e1c643f1..39f067740b 100644 --- a/tests/auto/qdbusinterface/tst_qdbusinterface.cpp +++ b/tests/auto/qdbusinterface/tst_qdbusinterface.cpp @@ -350,7 +350,16 @@ void tst_QDBusInterface::introspectUnknownTypes() "com.trolltech.QtDBus.MyObjectUnknownTypes"); const QMetaObject *mo = iface.metaObject(); - QVERIFY(mo->indexOfMethod("regularMethod()") != -1); + QVERIFY(mo->indexOfMethod("regularMethod()") != -1); // this is the control + QVERIFY(mo->indexOfMethod("somethingHappened(QDBusRawType<0x7e>*)") != -1); + + QVERIFY(mo->indexOfMethod("ping(QDBusRawType<0x7e>*)") != -1); + int midx = mo->indexOfMethod("ping(QDBusRawType<0x7e>*)"); + QCOMPARE(mo->method(midx).typeName(), "QDBusRawType<0x7e>*"); + + QVERIFY(mo->indexOfProperty("prop1") != -1); + int pidx = mo->indexOfProperty("prop1"); + QCOMPARE(mo->property(pidx).typeName(), "QDBusRawType<0x7e>*"); } void tst_QDBusInterface::callMethod() -- cgit v1.2.3