[Qt-interest] QGraphicsView performance issue

Santhosh Y santhosh at softjin.com
Mon May 11 15:01:52 CEST 2009


Santhosh Y wrote:
> Hi,
>
> I added  30,000 items to the scene.
> While updating the scene, the response from the view is very slow.
>
> Among these 30,000 items only 3,000 items have the distinctive locations
> and the rest of 27,000 items have the same location of those 3,000 items.
>
> In such a scenario to improve the performance, what flags
> I should use on the scene to improve the performance.
>
>   
To add to the above issue, what I have observed is that, paintEvent() on 
QGraphicsview is being called multiple times
which is taking around 3 sec for each call to pick the items from the 
visible region for sending to
QGraphicsScene::drawItems(QPainter* p, int numItems, QGraphicsItem** 
items, const QStyleOptionGraphicsItem* options )
 function dispatch.

Can anybody tell me how to track from where this paintEvent call is 
dispatched so many times.

I have no QGraphicsView::update() calls in my code, but I have the  
QGraphicsScene::update() calls.
But none of the QGraphicsScene::update () call is immediately resulting 
a QGraphicsView::paintEvent(QPaintEvent*)

My observation is that all the mutliple calls on 
QGraphicsView::paintEvent(QPaintEvent*) are resulting from the following 
stack.
------------------------------------------------------------------------------------------------------
     QGraphicsView::paintEvent(QPaintEvent * e=0x0012b550)  Line 1282    C++
     QtGuid4.dll!QWidget::event(QEvent * event=0x0012b550)  Line 6256    C++
     QtGuid4.dll!QFrame::event(QEvent * e=0x0012b550)  Line 641    C++
     QtGuid4.dll!QAbstractScrollArea::viewportEvent(QEvent * 
e=0x0012b550)  Line 909 + 0xc bytes    C++
     QtGuid4.dll!QGraphicsView::viewportEvent(QEvent * 
event=0x0012b550)  Line 2324    C++
     QtGuid4.dll!QAbstractScrollAreaPrivate::viewportEvent(QEvent * 
event=0x0012b550)  Line 78 + 0x28 bytes    C++
     QtGuid4.dll!QAbstractScrollAreaFilter::eventFilter(QObject * 
o=0x08705aa0, QEvent * e=0x0012b550)  Line 89 + 0x29 bytes    C++
     QtGuid4.dll!QApplicationPrivate::notify_helper(QObject * 
receiver=0x08705aa0, QEvent * e=0x0012b550)  Line 3533 + 0x1b bytes    C++
     QtGuid4.dll!QApplication::notify(QObject * receiver=0x08705aa0, 
QEvent * e=0x0012b550)  Line 3482 + 0x10 bytes    C++
     QtCored4.dll!QCoreApplication::notifyInternal(QObject * 
receiver=0x08705aa0, QEvent * event=0x0012b550)  Line 516    C++
     QtCored4.dll!QCoreApplication::sendSpontaneousEvent(QObject * 
receiver=0x08705aa0, QEvent * event=0x0012b550)  Line 188 + 0x38 
bytes    C++
     QtGuid4.dll!qt_sendSpontaneousEvent(QObject * receiver=0x08705aa0, 
QEvent * event=0x0012b550)  Line 1182 + 0xe bytes    C++
     QtGuid4.dll!QWidgetPrivate::drawWidget(QPaintDevice * 
pdev=0x02a0a878, const QRegion & rgn={...}, const QPoint & offset={...}, 
int flags=4)  Line 1195 + 0xd bytes    C++
     
QtGuid4.dll!QWidgetBackingStore::paintSiblingsRecursive(QPaintDevice * 
pdev=0x02a0a878, const QList<QObject *> & siblings={...}, int index=0, 
const QRegion & rgn={...}, const QPoint & offset={...}, int flags=4)  
Line 1099    C++
     QtGuid4.dll!QWidgetPrivate::drawWidget(QPaintDevice * 
pdev=0x02a0a878, const QRegion & rgn={...}, const QPoint & offset={...}, 
int flags=4)  Line 1231 + 0x2e bytes    C++
     
QtGuid4.dll!QWidgetBackingStore::paintSiblingsRecursive(QPaintDevice * 
pdev=0x02a0a878, const QList<QObject *> & siblings={...}, int index=2, 
const QRegion & rgn={...}, const QPoint & offset={...}, int flags=4)  
Line 1099    C++
     
QtGuid4.dll!QWidgetBackingStore::paintSiblingsRecursive(QPaintDevice * 
pdev=0x02a0a878, const QList<QObject *> & siblings={...}, int index=3, 
const QRegion & rgn={...}, const QPoint & offset={...}, int flags=4)  
Line 1089 + 0x20 bytes    C++
     
QtGuid4.dll!QWidgetBackingStore::paintSiblingsRecursive(QPaintDevice * 
pdev=0x02a0a878, const QList<QObject *> & siblings={...}, int index=4, 
const QRegion & rgn={...}, const QPoint & offset={...}, int flags=4)  
Line 1089 + 0x20 bytes    C++
     QtGuid4.dll!QWidgetPrivate::drawWidget(QPaintDevice * 
pdev=0x02a0a878, const QRegion & rgn={...}, const QPoint & offset={...}, 
int flags=4)  Line 1231 + 0x2e bytes    C++
     
QtGuid4.dll!QWidgetBackingStore::paintSiblingsRecursive(QPaintDevice * 
pdev=0x02a0a878, const QList<QObject *> & siblings={...}, int index=13, 
const QRegion & rgn={...}, const QPoint & offset={...}, int flags=4)  
Line 1099    C++
     QtGuid4.dll!QWidgetPrivate::drawWidget(QPaintDevice * 
pdev=0x02a0a878, const QRegion & rgn={...}, const QPoint & offset={...}, 
int flags=4)  Line 1231 + 0x2e bytes    C++
     
QtGuid4.dll!QWidgetBackingStore::paintSiblingsRecursive(QPaintDevice * 
pdev=0x02a0a878, const QList<QObject *> & siblings={...}, int index=5, 
const QRegion & rgn={...}, const QPoint & offset={...}, int flags=4)  
Line 1099    C++
     QtGuid4.dll!QWidgetPrivate::drawWidget(QPaintDevice * 
pdev=0x02a0a878, const QRegion & rgn={...}, const QPoint & offset={...}, 
int flags=4)  Line 1231 + 0x2e bytes    C++
     
QtGuid4.dll!QWidgetBackingStore::paintSiblingsRecursive(QPaintDevice * 
pdev=0x02a0a878, const QList<QObject *> & siblings={...}, int index=40, 
const QRegion & rgn={...}, const QPoint & offset={...}, int flags=4)  
Line 1099    C++
     
QtGuid4.dll!QWidgetBackingStore::paintSiblingsRecursive(QPaintDevice * 
pdev=0x02a0a878, const QList<QObject *> & siblings={...}, int index=41, 
const QRegion & rgn={...}, const QPoint & offset={...}, int flags=4)  
Line 1089 + 0x20 bytes    C++
     
QtGuid4.dll!QWidgetBackingStore::paintSiblingsRecursive(QPaintDevice * 
pdev=0x02a0a878, const QList<QObject *> & siblings={...}, int index=42, 
const QRegion & rgn={...}, const QPoint & offset={...}, int flags=4)  
Line 1089 + 0x20 bytes    C++
     QtGuid4.dll!QWidgetPrivate::drawWidget(QPaintDevice * 
pdev=0x02a0a878, const QRegion & rgn={...}, const QPoint & offset={...}, 
int flags=5)  Line 1231 + 0x2e bytes    C++
     QtGuid4.dll!QWidgetBackingStore::cleanRegion(const QRegion & 
rgn={...}, QWidget * widget=0x0012fd58, bool 
recursiveCopyToScreen=false)  Line 1000    C++
     QtGuid4.dll!qt_syncBackingStore(QRegion rgn={...}, QWidget * 
widget=0x0012fd58, bool recursive=false)  Line 230    C++
     QtGuid4.dll!QETWidget::translatePaintEvent(const tagMSG & 
msg={...})  Line 3094 + 0x2b bytes    C++
     QtGuid4.dll!QtWndProc(HWND__ * hwnd=0x000a1118, unsigned int 
message=15, unsigned int wParam=0, long lParam=0)  Line 1680 + 0xc 
bytes    C++
------------------------------------------------------------------------------------------------------

Please tell me how to track the event call of paint over QGraphicsView.

-- 
----------------------------------------------------
Y Santhosh Kumar
Senior Software Engineer
SoftJin Technologies Private Limited
Unit No. 102, Mobius Tower,
I Floor, SJR I - Park,
EPIP, White Field,
Bangalore - 560066, India
U : www.softjin.com
E : santhosh at softjin.com
T : +91-80-41779999
M : +91-9740535265
----------------------------------------------------



Business Disclaimer
____________________________________________________________
This e-mail message and any files transmitted with it are intended solely
for  the use  of the  individual or entity  to which they  are  addressed. It
may  contain confidential,  proprietary or legally  privileged  information.
If  you  are  not  the  intended recipient please be advised that you have
received  this  message in error and any use is strictly prohibited. Please
immediately  delete it  and all copies of it from your system, destroy any
hard  copies  of  it and  notify  the  sender  by return mail. You must not,
directly or indirectly, use,  disclose,  distribute, print, or copy any part of
this message if you are not the intended recipient.
___________________________________________________________





More information about the Qt-interest-old mailing list