Results 1 to 8 of 8

Thread: Architecture Question on QGraphicsView, QGraphicsScene, QGraphicsItems

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2015
    Posts
    50
    Thanks
    8
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Architecture Question on QGraphicsView, QGraphicsScene, QGraphicsItems

    Hello,

    I am still relatively new to QT and when I initially started writing my application I based it off of examples that did not use the QT Creator, or Model/View architecture etc. ... I have since gone back and refactored my code to utilise these tools because of so many problems I was having and now it is working as I wanted it to. All except for the graphics part of it so I wanted to see if the problem is the way I have built it.

    I have created as the primary graphics window a class derived from the QGraphicsView. I do all of my coordinate transforms, viewport updates, creation of the QGraphicsScene, handle drawing of the background, handle keypress events, zoom in zoom out, create the QGraphicsItems, etc. ...

    The QGraphicsItems are added to the scene and do their own painting.

    As I work through examples I have seen where the QGraphicsScene has a much more active role than I am giving it. It has been subclassed, and handles painting among other things.

    What I am wondering is whether my set up is good, or is there a "best practices" way to do it that is hould be using as well. Like I said I have seen it done many different ways just like the UI was however the way I changed it to seems to be the "Best Practices" way of doing things.

    Cheers!
    -caolan.
    Last edited by Caolan O'Domhnaill; 28th March 2016 at 20:33.

Similar Threads

  1. How to render QGraphicsItems onto a QGraphicsScene properly
    By jshafferman in forum Qt Programming
    Replies: 6
    Last Post: 1st May 2014, 02:45
  2. QGraphicsScene and dynamic addition of QGraphicsItems
    By El Bazza in forum Qt Programming
    Replies: 7
    Last Post: 15th September 2012, 07:57
  3. Replies: 2
    Last Post: 28th April 2012, 08:58
  4. Question about behavior of QGraphicsView/QGraphicsScene
    By kennethadammiller in forum Newbie
    Replies: 0
    Last Post: 22nd July 2010, 09:56
  5. QGraphicsView/QGraphicsScene rendering question
    By onurozcelik in forum Qt Programming
    Replies: 1
    Last Post: 3rd July 2010, 11:23

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.