You have to provide the definition of the datatype car, then only we will get to know about the main problem.
You have to provide the definition of the datatype car, then only we will get to know about the main problem.
Heavy Metal Rules. For those about to rock, we salute you.
HIT THANKS IF I HELPED.
I already do that but I don't why is keeping doing the same error when i tried to read te binary file
Why are you using a reference to a pointer as second argument to operator >> ? This is how such method looks like most of the time:
What kind of error do you get ? Is your pointer null ?Qt Code:
... return in; }To copy to clipboard, switch view to plain text mode
It doesn't even run, when my program starts is looking for the file and found it but when i tries do put the qlist inside my instance of qlist don't work
here is the code where I read
cars is my list in the main (QList<car> cars)Qt Code:
if(read.exists()){ in >> cars; read.close(); } }To copy to clipboard, switch view to plain text mode
This is not a QList<car>. It isn't even a QList< car * >. It is a reference to a pointer to a "car" instance. So calling "in >> cars" can't possibly call this method if "cars" is actually a QList<car>, because the QDataStream operator you have defined doesn't match the required function signature.this is my qlist: car *&list
So what does your code really look like? What you have posted isn't complete enough.
Bookmarks