Results 1 to 14 of 14

Thread: Performance problems with overlapping qgraphicsitems

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    Join Date
    Feb 2007
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Performance problems with overlapping qgraphicsitems

    Hello, i eperimented performances problem with graphicsview and
    found a workaround wich can perhaps help,
    try it, it is very easy, you only have to reimplement paintEvent function like this
    in a subclass :

    Qt Code:
    1. class MyFasterGraphicView :public QGraphicsView
    2. {
    3. Q_OBJECT
    4. public:
    5. MyFasterGraphicView( ...);
    6. protected:
    7. ...
    8. void paintEvent ( QPaintEvent * event );
    9. ...
    10. };
    11.  
    12. void MyFasterGraphicView::paintEvent ( QPaintEvent * event )
    13. {
    14. QPaintEvent *newEvent=new QPaintEvent(event->region().boundingRect());
    15. QGraphicsView::paintEvent(newEvent);
    16. delete newEvent;
    17. }
    To copy to clipboard, switch view to plain text mode 

    I can explain the reason, is someone is interrested,

    Have fun,

    CyrBa
    Last edited by wysota; 24th February 2007 at 17:58. Reason: missing [code] tags

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.