Results 1 to 19 of 19

Thread: Qt GraphicsView stop getting paint event

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2013
    Location
    India
    Posts
    153
    Thanks
    27
    Thanked 18 Times in 18 Posts
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Exclamation Qt GraphicsView stop getting paint event

    Hello,

    I am working with QGraphicsView and QGraphicsScene for drawing of QPixmap data on QGraphicsItem.
    What i am doing is start a QTimer on each timeout of QTimer i draw data on QPixmap via QtConcurrent.

    Qt Code:
    1. QtConcurrent::run(this, &LinePlotter::plotDataOnImage);
    To copy to clipboard, switch view to plain text mode 

    On plotDataOnImage i call update() after drawing on QPixmap.
    It works fine but unfortunatly my QGraphicsView and QGraphicsScene stop getting paint events.
    but when i click on window it repaint again but it does not repaint on call of update() method.

    customizations for QGraphicsView i have made are:
    Qt Code:
    1. setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    2. setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    3.  
    4. setRenderHints(QPainter::HighQualityAntialiasing | QPainter::SmoothPixmapTransform | QPainter::TextAntialiasing);
    5.  
    6. setViewportUpdateMode(QGraphicsView::SmartViewportUpdate);
    7.  
    8. setCacheMode(QGraphicsView::CacheNone);
    9.  
    10. setOptimizationFlags(QGraphicsView::DontAdjustForAntialiasing
    11. | QGraphicsView::DontClipPainter
    12. | QGraphicsView::IndirectPainting);
    To copy to clipboard, switch view to plain text mode 

    I have never got this kind of problem before but i dont know why my view not get its paint event properly.
    any idea about the problem?


    -----------------------------------------------
    There is something i have seen i just start my application and keep it opened without any mouse interaction or any other kind of interactions.
    Then i start my stop watch and checks the log.

    It also got stop painting(stop getting events) when keeping in background (rarely occured)...
    What is the issue?
    I am using Cent OS 6.4
    Qt 5.0

    Please tell me what is the issue?
    Last edited by karankumar1609; 30th July 2013 at 16:17.

Similar Threads

  1. Qt/MFC Event Loop - stop MFC receiving event?
    By Kaylx in forum Qt Programming
    Replies: 1
    Last Post: 26th April 2012, 18:57
  2. Timer event & paint event, priority
    By Teuniz in forum Qt Programming
    Replies: 0
    Last Post: 2nd February 2010, 13:33
  3. Paint event function in key press event
    By soumya in forum Qt Programming
    Replies: 6
    Last Post: 2nd February 2010, 12:40
  4. How to stop event loop of QDialog in Qt4
    By node_ex in forum Qt Programming
    Replies: 3
    Last Post: 8th July 2008, 07:19
  5. function to stop receiving event
    By babu198649 in forum Qt Programming
    Replies: 11
    Last Post: 19th November 2007, 08:45

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.