SentaVera
2nd January 2014, 07:33
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 (http://qt-project.org/doc/qt-4.8/custom-types.html)
and getting this error
C4430: missing type specifier - int assumed. Note: C++ does not support default-int
the error appear when I tried to use the macro Q_DECLARE_METATYPE, it seems that the compiler doesn't recognize the class Message.
Code
#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
It has the default constructor, copy constructor and destructor as required or i missing something here?
Regards
Soon
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 (http://qt-project.org/doc/qt-4.8/custom-types.html)
and getting this error
C4430: missing type specifier - int assumed. Note: C++ does not support default-int
the error appear when I tried to use the macro Q_DECLARE_METATYPE, it seems that the compiler doesn't recognize the class Message.
Code
#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
It has the default constructor, copy constructor and destructor as required or i missing something here?
Regards
Soon