PDA

View Full Version : GraphicsScene Question



QbelcorT
19th September 2008, 04:43
Hi,
I am new to Qtopia, so my question may be trivial. :o My scene#1 has a background and some icon buttons on it. I have a scene#2 (another window) that has a background and icon buttons on it also. Icon buttons and background are different from scene to scene. Right now I have two applications, one to test scene#1 and another to test scene#2. Now I am trying to combine them so that if an icon button is pressed on scene#1 it will move to scene#2.
What is the best way to achieve this using one application? Close scene#1, then open scene#2?
thanks for your response.

aamer4yu
19th September 2008, 06:12
You want the item to move to scene 2, or u want to show scene 2 ?

In either cases I guess signal slots will be good to use.

QbelcorT
19th September 2008, 07:05
I want to show scene#2, basically scene#1 is finished, so I have to close it and open scene#2. (unless you can recommend another method). I understand I can use signals and slots, but in my slot, how to I close the old scene, and open a new one.
Thanks.

aamer4yu
19th September 2008, 09:03
Well, you can use QGraphicsView::setScene . Simply code setScene(pScene2) when the item/button is clicked.

But one thing. Graphics items are not buttons. You will have to implement emitting signal on mousePress or release event of the item ;)