From 96f2365cf4cebc074c3171878dcd25ce19ee7486 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Sat, 18 Feb 2012 23:16:24 +0100 Subject: Rename QMetaMethod::signature() to methodSignature() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In Qt5 the meta-data format will be changed to not store the method signature string explicitly; the signature will be reconstructed on demand from the method name and parameter type information. The QMetaMethod::signature() method returns a const char pointer. Changing the return type to QByteArray can lead to silent bugs due to the implicit conversion to char *. Even though it's a source- incompatible change, it's therefore better to introduce a new function, methodSignature(), and remove the old signature(). Task-number: QTBUG-24154 Change-Id: Ib3579dedd27a3c7c8914d5f1b231947be2cf4027 Reviewed-by: Olivier Goffart Reviewed-by: Lars Knoll Reviewed-by: Thiago Macieira Reviewed-by: João Abecasis --- doc/src/snippets/code/src_corelib_kernel_qmetaobject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/src/snippets/code') diff --git a/doc/src/snippets/code/src_corelib_kernel_qmetaobject.cpp b/doc/src/snippets/code/src_corelib_kernel_qmetaobject.cpp index afba3b6a619..7c0c2c21221 100644 --- a/doc/src/snippets/code/src_corelib_kernel_qmetaobject.cpp +++ b/doc/src/snippets/code/src_corelib_kernel_qmetaobject.cpp @@ -107,7 +107,7 @@ for(int i = metaObject->propertyOffset(); i < metaObject->propertyCount(); ++i) const QMetaObject* metaObject = obj->metaObject(); QStringList methods; for(int i = metaObject->methodOffset(); i < metaObject->methodCount(); ++i) - methods << QString::fromLatin1(metaObject->method(i).signature()); + methods << QString::fromLatin1(metaObject->method(i).methodSignature()); //! [methodCount] //! [6] -- cgit v1.2.3 From 362bde8e8eef41fc6a338ed8fbe6cbf7e9996019 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Nowacki?= Date: Mon, 13 Feb 2012 16:26:35 +0100 Subject: Introduce QMetaType::UnknownType. QMetaType::Void was ambiguous, it was pointing to a valid type (void) and in the same time it was signaling errors in QMetaType. There was no clean way to check if returned type was valid void or some unregistered type. This feature will be used by new QMetaObject revision which will store type ids instead of type names. So it will be easy to distinguish between: void mySlot(); MyUnregisteredType mySlot(); Change-Id: I73ff097f75585a95e12df74d50c6f3141153e771 Reviewed-by: Kent Hansen Reviewed-by: Olivier Goffart --- doc/src/snippets/code/src_corelib_kernel_qmetatype.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/src/snippets/code') diff --git a/doc/src/snippets/code/src_corelib_kernel_qmetatype.cpp b/doc/src/snippets/code/src_corelib_kernel_qmetatype.cpp index 9d72c425045..d0a7a69884d 100644 --- a/doc/src/snippets/code/src_corelib_kernel_qmetatype.cpp +++ b/doc/src/snippets/code/src_corelib_kernel_qmetatype.cpp @@ -73,7 +73,7 @@ MyStruct s2 = var.value(); //! [3] int id = QMetaType::type("MyClass"); -if (id != 0) { +if (id != QMetaType::UnknownType) { void *myClassPtr = QMetaType::create(id); ... QMetaType::destroy(id, myClassPtr); -- cgit v1.2.3