Results 1 to 3 of 3

Thread: transfer graphicsscene on form1 to graphicsscene on form2

  1. #1
    Join Date
    Mar 2009
    Location
    Nashville Tn.
    Posts
    53
    Thanks
    14
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default transfer graphicsscene on form1 to graphicsscene on form2

    How do you transfer a scene from form 1 to a scene on form 2 ?



  2. #2
    Join Date
    Jul 2007
    Location
    Jundiai/SP, Brazil
    Posts
    114
    Thanks
    5
    Thanked 7 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: transfer graphicsscene on form1 to graphicsscene on form2

    Hi

    You can do something like this:
    Form1
    To call the Form2

    Qt Code:
    1. QGraphicsScene *sourceScene;
    2.  
    3. // Put a "scene" inside the *sourceScene
    4.  
    5. SCENE* tab = new SCENE(0,0, surceScene);
    6. tab->show();
    To copy to clipboard, switch view to plain text mode 

    Form2
    Qt Code:
    1. #include <QGraphisScene>
    2.  
    3. class QGrahicsScene;
    4.  
    5. class SCENE : public QWidget, private Ui::FormSCENE
    6. {
    7. Q_OBJECT
    8.  
    9. public:
    10. SCENE(QWidget* parent = 0, Qt::WFlags fl = 0, QGraphicsScene *targetScene=0 );
    11. ~SCENE();
    12. (...)
    13. };
    14.  
    15. SCENE::SCENE(QWidget* parent, Qt::WFlags fl, QGraphicsScene *targetScene)
    16. : QWidget( parent, fl), Ui::FormThumbs()
    17. {
    18. setupUi(this);
    19.  
    20. // Use you "targetScene" pointer inside your program
    21. };
    To copy to clipboard, switch view to plain text mode 

    Bye

  3. The following user says thank you to vcp for this useful post:

    rogerholmes (25th September 2009)

  4. #3
    Join Date
    Mar 2009
    Location
    Nashville Tn.
    Posts
    53
    Thanks
    14
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: transfer graphicsscene on form1 to graphicsscene on form2

    I try that , Thanks

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.