PDA

View Full Version : QGraphicsItem problem - how to save items info ??



aamer4yu
17th October 2006, 12:37
I want to use a scene where I can add items at different levels.
I have two different classes inherited from QGraphicsItem - CMacro, and CTile;
I am adding both items in a scene with different ZValues.

CMacro *macro = new CMacro(col,row,span);

I am reading the position of macros from file, and I want to save the changed positions of macros in another file ? How do i do it ?
I thought of using Qlist for saving a list of macros added.. but then how do i sync between the items in the list and the items in the scene ?? :confused:

aamer4yu
17th October 2006, 12:50
I want to use a scene where I can add items at different levels.
I have two different classes inherited from QGraphicsItem - CMacro, and CTile;
I am adding both items in a scene with different ZValues.

CMacro *macro = new CMacro(col,row,span);

I am reading the position of macros from file, and I want to save the changed positions of macros in another file ? How do i do it ?
I thought of using Qlist for saving a list of macros added.. but then how do i sync between the items in the list and the items in the scene ?? :confused:


hey i found the solution.. problem was in using the QList... earlier i was using QList<CMacro> macroList;

all i had to change was QList<CMacro*> macroList;


BTW: how do i delete a threadd ?? is it disabled in this group ??

wysota
17th October 2006, 13:10
BTW: how do i delete a threadd ?? is it disabled in this group ??

1. Don't shout.
2. You can't delete threads yourself.
3. When this really makes sense, you can ask one of the administrators to delete a thread.
4. Pointing a problem and then writing that you found the solution doesn't qualify for deletion. If you post a solution, others might still benefit from the thread.

aamer4yu
17th October 2006, 13:17
1. Don't shout.
2. You can't delete threads yourself.
3. When this really makes sense, you can ask one of the administrators to delete a thread.
4. Pointing a problem and then writing that you found the solution doesn't qualify for deletion. If you post a solution, others might still benefit from the thread.

hey I am sorry..
i didnt intend to shout, i just wanted to make it bold but was not aware it will be highlighted so much...:eek:

ya i do agree others can still benefit :)