Results 1 to 4 of 4

Thread: QGraphicsScene vs QPainter techniques

  1. #1
    Join Date
    Oct 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default QGraphicsScene vs QPainter techniques

    What are the advantages or disadvantages using QGraphicsScene over QPainter's draw...() (I mean overriding widget's paintEvent) ?
    Which technique is preferred ?
    Last edited by zotu; 19th October 2010 at 04:01.

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: QGraphicsScene vs QPainter techniques

    Quote Originally Posted by zotu View Post
    Which technique is preferred ?
    It depends on the use case. What are you trying to achieve?

  3. #3
    Join Date
    Oct 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QGraphicsScene vs QPainter techniques

    i have many small elements drawn on the widget. i'd like to have the ability to grab those elements with the mouse and move them around on the surface.
    at the very first look it seems that QGraphicsScene fits for that purpose.
    So I'd like to know the performance cost of using QGraphicsScene technique comparing to doing all logic myself via paintEvent and mouseEvents.

  4. #4
    Join Date
    Oct 2010
    Posts
    37
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QGraphicsScene vs QPainter techniques

    I'd go with QGScene too. QPainter is more suited to painting.

Similar Threads

  1. Clarification on how to use Qt's debugging techniques
    By hackerNovitiate in forum Newbie
    Replies: 5
    Last Post: 21st June 2010, 04:08
  2. QPainter(&QPrinter) & QPainter(&QImage) communication
    By gufeatza in forum Qt Programming
    Replies: 2
    Last Post: 2nd February 2010, 07:25
  3. QPainter error saving an image from a QGraphicsScene
    By cydside in forum Qt Programming
    Replies: 3
    Last Post: 29th January 2010, 04:53
  4. Replies: 5
    Last Post: 7th September 2009, 20:57
  5. Replies: 3
    Last Post: 30th April 2006, 19:22

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.