Background:
Ok, Ive started learning C++ / QT recently, but previous knowledge of Java and many other languages. I worked over the address book tutorial fairly easily, but wanted to adapt/expand it to make sure I got everything ok.
I did this by making a class (addressdata) to store various forms of address data rather then just name/address, then adapting the code to use this class in a QList rather then the QMap.
This worked fine, adjustments to the searching/finding functions were also fairly easy to do.
Problem:
However, I now need to learn how to save this data out to a file.
QDataStream wont take the QList< addressdata> as an input.
I found this page;
http://wiki.qtcentre.org/index.php?t..._types_with_Qt
Which seems to detail what I have to do...correct?
Only at the very first step of putting a "Q_DECLARE_METATYPE(Player);" at the end of my class code, I start getting a ;
Any ideas how I'm supposed to implement this correctly?(path)/../src/corelib/kernel/qmetatype.h:126: error: no matching function for call to `addressdata::addressdata()'
My class code is;
Qt Code:
#ifndef ADDRESSDATA_H #define ADDRESSDATA_H #include <QWidget> #include <QMap> class addressdata { public: int getX(); int getY(); int getZ(); void setX(int); void setY(int); void setZ(int); ~ addressdata(); private: int Xpos; int Ypos; int Zpos; QString address; QString name; }; Q_DECLARE_METATYPE(addressdata); #endif // ADDRESSDATA_HTo copy to clipboard, switch view to plain text mode
Thanks in advance for any help you can give me,
Cheers
Bookmarks