Hello folks,
I am trying to declare my Class as Metatype for Qt but figuring out some problems. It seems that after the MetaType declaration he wants to get access to a copy constructor or something like this which is explicitly not allowed for QObjects as I thought.
This is my header:
#include <QtCore/QObject>
#include <QtCore/QMetaType>
class Message : private QObject
{
Q_OBJECT
public:
Message();
int sourceId;
int targetId;
private:
Q_DISABLE_COPY(Message)
};
Q_DECLARE_METATYPE(Message)
Q_DECLARE_METATYPE(Message*)
Message::Message() :
QObject()
{
}
So, I get the following errors:
Message::Message : cannot access private member declared in class Message see reference to function template instantiation 'void *qMetaTypeConstructHelper(const T *)' being compiled
and some more, but I think they are nearly the same and because of the same problem.
Someone knows what I am doing wrong?