Results 1 to 5 of 5

Thread: Multiple use of QGraphicScene

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Multiple use of QGraphicScene

    if you dont want to make it a member than you can access the scene by calling

    Qt Code:
    1. //draw dot
    2. void Unknown::drawDot()
    3. {
    4. //scene->addEllipse(50, 50, 1, 1, QColor(255, 0, 0), Qt::NoBrush);
    5. ui->graphicsView->scene()->addEllipse(50, 50, 1, 1, QColor(255, 0, 0), Qt::NoBrush);
    6. //We already set this in previous function so no need now
    7. //ui->graphicsView->setScene(scene);
    8. }
    To copy to clipboard, switch view to plain text mode 

    but as suggested you should learn to make a class.

  2. #2
    Join Date
    Sep 2010
    Posts
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Multiple use of QGraphicScene

    Thank you for your reply. Your solution works indeed, but I will try it with a class as well. Already found someone in my study book, so I think that shouldn't be a problem.

Similar Threads

  1. how to use Multiple timers?
    By qtlinuxnewbie in forum Newbie
    Replies: 8
    Last Post: 21st September 2012, 09:01
  2. Multiple QWidgets
    By codeman in forum Qt Programming
    Replies: 7
    Last Post: 23rd March 2010, 11:21
  3. multiple sort
    By baray98 in forum Qt Programming
    Replies: 3
    Last Post: 25th August 2009, 08:43
  4. multiple defination
    By phillip_Qt in forum Qt Programming
    Replies: 4
    Last Post: 13th December 2007, 17:32
  5. Replies: 0
    Last Post: 21st December 2006, 11:48

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
  •  
Qt is a trademark of The Qt Company.