great. Is there a way you know of that i could store these coordinates in a text file on a separate line each, so my question would be how do I recognise where is the end of coordinates of 1 shape and begining of another?
great. Is there a way you know of that i could store these coordinates in a text file on a separate line each, so my question would be how do I recognise where is the end of coordinates of 1 shape and begining of another?
This is up to you - maybe separate them with a newline.
yeah I know how to get the data into a file. What i don't know is since you are saying all of that data are valid coordinates to my 3 shapes drawn on my scene, then how would you distinguish where does for example the first shape and its respective coordinates end, and where does the set of coordinates for second shape begin? Because there is no way to tell from the Qlist I'm getting
Your screenshot is hard to read, but it looks like it is a qDebug() dump of the QList of QGraphicsItem instances. This is not how you will write your list to a file. (Yes, I know you can direct QDebug output to a file, but it doesn't provide the information you want in a very useful format).
You will write a loop, get each QGraphicsItem pointer from the list, determine its type(), coordinates, size, and whatever else your want. You then take all of that, format it into a QString, and write that QString to the file in a single line. The next item goes on the next line, and so forth.
<=== The Great Pumpkin says ===>
Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.
Bookmarks