rcintra
14th May 2007, 22:08
Hi,
I am trying to register a class on QMetaType in order to use it with QVariant. However, when I try to compile the class with the macro Q_DECLARE_METATYPE occurs an error.
Here is the code:
#include "Account.h"
Account::Account() {
// do nothing
};
Account::Account(QString _provider, QString _type, QPixmap _icon) {
provider = _provider;
type = _type;
icon = _icon;
}
Account::Account(const Account &account) {
provider = account.provider;
type = account.type;
icon = account.icon;
}
Account::~ Account() {
// do nothing
}
void Account::setProvider(QString _provider) {
provider = _provider;
}
QString Account::getProvider() {
return provider;
}
void Account::setType(QString _type) {
type = _type;
}
QString Account::getType() {
return type;
}
void Account::setIcon(QPixmap _icon) {
icon = _icon;
}
QPixmap Account::getIcon() {
return icon;
}
Q_DECLARE_METATYPE(Account)
And the error is:
Account.cpp:47: error: expected constructor, destructor, or type conversion at end of input
The error is just at the line that invokes the macro.
Any help is appreciated !
Thanks,
Rafael
I am trying to register a class on QMetaType in order to use it with QVariant. However, when I try to compile the class with the macro Q_DECLARE_METATYPE occurs an error.
Here is the code:
#include "Account.h"
Account::Account() {
// do nothing
};
Account::Account(QString _provider, QString _type, QPixmap _icon) {
provider = _provider;
type = _type;
icon = _icon;
}
Account::Account(const Account &account) {
provider = account.provider;
type = account.type;
icon = account.icon;
}
Account::~ Account() {
// do nothing
}
void Account::setProvider(QString _provider) {
provider = _provider;
}
QString Account::getProvider() {
return provider;
}
void Account::setType(QString _type) {
type = _type;
}
QString Account::getType() {
return type;
}
void Account::setIcon(QPixmap _icon) {
icon = _icon;
}
QPixmap Account::getIcon() {
return icon;
}
Q_DECLARE_METATYPE(Account)
And the error is:
Account.cpp:47: error: expected constructor, destructor, or type conversion at end of input
The error is just at the line that invokes the macro.
Any help is appreciated !
Thanks,
Rafael