[Qt-interest] how to make QGraphicsView updated as soon as possible?
Zhao, Halley
halley.zhao at intel.com
Mon Feb 14 01:30:12 CET 2011
Thanks.
There is only one QGraphicsItem in my scene, and the ::paint() of this QGraphicsItem consumes ~6ms each time.
So, I don’t think ::paint() itself is the killer.
Hw acceleration (openGL) is used because I have assigned a GLWidget as viewport.
There is more data in the following link:
https://bugs.meego.com/show_bug.cgi?id=13303
From: Jason H [mailto:scorp1us at yahoo.com]
Sent: Sunday, February 13, 2011 8:39 AM
To: Zhao, Halley; qt-interest at trolltech.com
Subject: Re: [Qt-interest] how to make QGraphicsView updated as soon as possible?
There is a #define to set the frame rate. But you don't want a frame rate too fast because you cannot update in the interval. Your problem will be that you can't minimize your paints. You'll have to paint everything, every update from back z to front z. And so you can't compress and skip occluded regions. I'd expect your ideal to actually be slower, if you have a lot of overlapping items.
But fear not, there is hope! I would recommend you check out the graph-scene stuff if you need really smooth stuff:
http://labs.qt.nokia.com/2011/01/28/qml-scene-graph-has-moved/
http://labs.qt.nokia.com/2010/12/02/velvet-and-the-qml-scene-graph/
Also, make sure you are using hardware acceleration. The raster engine is precise and accurate but very slow. GL will allow you to get very close visually but at a fractional part of CPU. (Hardware renderers vary in implementation so you can't combine frames between hardware implementations.)
HTH
________________________________
From: "Zhao, Halley" <halley.zhao at intel.com>
To: "qt-interest at trolltech.com" <qt-interest at trolltech.com>
Sent: Fri, February 11, 2011 9:26:42 PM
Subject: [Qt-interest] how to make QGraphicsView updated as soon as possible?
After QGraphicsItem::update() is executed, there is some delay to QGraphicsItem::paint() is called.
This is not vital for common UI, but for a 30fps video frame update, this delay introduce many issue.
How could I make QGraphicsView updated as soon as possible?
Could I change the event loop to schedule the repaint as soon as possible?
There is also a similar issue for Qt::QueuedConnection, there is visible delay to invoke a method by QMetaObject::invokeMethod(this, method, Qt::QueuedConnection);
Could I reduce the delay?
(I can’t use Qt::DirectConnection because I need some code runs in Qt thread).
thanks
ZHAO, Halley (Aihua)
Email: halley.zhao at intel.com
Tel: +86(21)61166476 iNet: 8821-6476
SSG/OTC/Moblin 3W038 Pole: F4
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110214/bcb1d441/attachment.html
More information about the Qt-interest-old
mailing list