Results 1 to 4 of 4

Thread: GraphicsScene Question

  1. #1
    Join Date
    Jul 2008
    Posts
    139
    Thanks
    9
    Thanked 18 Times in 15 Posts
    Qt products
    Qt/Embedded
    Platforms
    Unix/X11

    Default GraphicsScene Question

    Hi,
    I am new to Qtopia, so my question may be trivial. 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.

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: GraphicsScene Question

    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.

  3. #3
    Join Date
    Jul 2008
    Posts
    139
    Thanks
    9
    Thanked 18 Times in 15 Posts
    Qt products
    Qt/Embedded
    Platforms
    Unix/X11

    Default Re: GraphicsScene Question

    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.

  4. #4
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: GraphicsScene Question

    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

Similar Threads

  1. Plugin implementation question
    By JPNaude in forum Qt Programming
    Replies: 12
    Last Post: 27th August 2008, 20:24
  2. SQL Question
    By ^NyAw^ in forum Qt Programming
    Replies: 5
    Last Post: 8th April 2008, 19:36
  3. Question regarding how to paint after zoom.
    By JonathanForQT4 in forum Qt Programming
    Replies: 2
    Last Post: 26th January 2007, 15:34
  4. QThread exit()/quit() question
    By TheKedge in forum Qt Programming
    Replies: 1
    Last Post: 28th August 2006, 14:38

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.