Hi,
First of all, I am new to Qt and this forum. Looking forward to learn and contribute to this community!
I followed the example code for registering user custom Qt class found in this link
and getting this error
the error appear when I tried to use the macro Q_DECLARE_METATYPE, it seems that the compiler doesn't recognize the class Message.C4430: missing type specifier - int assumed. Note: C++ does not support default-int
Code
It has the default constructor, copy constructor and destructor as required or i missing something here?#ifndef MESSAGE_H
#define MESSAGE_H
#include <QString>
class Message
{
public:
Message();
Message(const Message &other);
~Message();
Message(const QString &name);
QString getName()const;
void setName(const QString &name);
private:
QString name_;
};
Q_DECLARE_METATYPE(Message); //Error point at here
#endif // MESSAGE_H
Regards
Soon
Bookmarks