[Qt4-preview-feedback] Q_INVOKABLE method is not a QMetaMethod::Method

Peter Kuemmel syntheticpp at gmx.net
Wed Feb 25 11:41:34 CET 2009


> A member function marked with Q_INVOKABLE has not the type
> QMetaMethod::Method but QMetaMethod::Signal. This looks not
> consistent to me. 

Sorry, false alarm.


This example works perfectly:

#include <QObject>
#include <QMetaMethod>

class A : public QObject
{
	Q_OBJECT

public:
	Q_INVOKABLE A(int)
	{
		int idx = metaObject()->indexOfMethod("foo()");
		Q_ASSERT(metaObject()->method(idx).methodType() == QMetaMethod::Method); 
		idx = metaObject()->indexOfConstructor("A(int)");
		Q_ASSERT(metaObject()->constructor(idx).methodType() == QMetaMethod::Constructor); 
	}

	Q_INVOKABLE void foo() {}
};

-- 
Computer Bild Tarifsieger! GMX FreeDSL - Telefonanschluss + DSL
für nur 17,95 ¿/mtl.!* http://dsl.gmx.de/?ac=OM.AD.PD003K11308T4569a



More information about the Qt4-feedback mailing list