Results 1 to 2 of 2

Thread: QGraphicsScene and its virtual drawBackground()/drawForeground() functions

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2018
    Location
    India, Delhi
    Posts
    10
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Windows

    Default QGraphicsScene and its virtual drawBackground()/drawForeground() functions

    Hello, I'm making a very small 2D animation software which basically allows the user to import images from pc and then render them on a specific location.
    I'm using Qt's Graphics View Framework, the QGraphicsView is being used for displaying each frame of animation.
    The frame itself inherits QGraphicsScene, now this frame class also contains a list of objects to render.

    Now, I have multiple frames, which are being displayed on QGraphicsView, but the problem is my frame's drawBackground() or drawForeground() functions which I implemented aren't being called automatically unlike QGraphicsView's drawBackground() method.

    Can you please help me what I'm doing wrong, till I get some concrete solution, I'm following this approach
    Inside of my QGraphicsView's drawForeground() method, in executing this statement so as to update my frame repeatedly
    Qt Code:
    1. scene()->render(painter, sceneRect(), sceneRect() );
    To copy to clipboard, switch view to plain text mode 
    this is working but I just don't understand why I need to call render() and why not QGraphicsScene::drawForeground() is not being called automatically.
    Last edited by keshav2010; 26th March 2018 at 17:19.

Similar Threads

  1. Replies: 3
    Last Post: 25th July 2017, 23:35
  2. Replies: 9
    Last Post: 26th July 2012, 17:35
  3. Replies: 1
    Last Post: 5th September 2011, 20:26
  4. QGraphicsScene::drawForeground()
    By alpinista in forum Qt Programming
    Replies: 11
    Last Post: 20th November 2009, 13:06
  5. use painter in QGraphicsScene::drawForeground
    By jano_alex_es in forum Qt Programming
    Replies: 2
    Last Post: 20th November 2009, 12:32

Tags for this Thread

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.