what is wrong in my code !!!! i got the following error message: unresolved external symbol. any suggestions .. and what is the proper whay to inhert from QObject whit out getting you trying to access private member .
namespace BioQt {
class Location : public QObject
{
Q_OBJECT
public:
explicit Location(QObject *parent );
};
QDataStream &operator<<(QDataStream &out, const Location &obj);
QDataStream &operator>>(QDataStream &in, Location &obj);
}
Q_DECLARE_TYPEINFO(BioQt::Location, Q_PRIMITIVE_TYPE);
#endif
and this is my cpp file
namespace BioQt {
Location::Location(QObject *parent)
: QObject(parent)
{
}
QDataStream &operator<<(QDataStream &ds, const Location &obj) {
for(int i=0; i<obj.metaObject()->propertyCount(); ++i) {
if(obj.metaObject()->property(i).isStored(&obj)) {
ds << obj.metaObject()->property(i).read(&obj);
}
}
return ds;
}
QDataStream &operator>>(QDataStream &ds, Location &obj) {
QVariant var;
for(int i=0; i<obj.metaObject()->propertyCount(); ++i) {
if(obj.metaObject()->property(i).isStored(&obj)) {
ds >> var;
obj.metaObject()->property(i).write(&obj, var);
}
}
return ds;
}
} // namespace BioQt