faq
flatforty
contribute
subscribe
configure
search
rdf
main
parent
|
Qt4 SUCKS!!! Please go back to Qt3!
by Daelin the Cruel on Thursday 16/Aug/2007, @09:38
|
While attempting to port a medium-sized program to Qt4, I noticed a SEVERE drop in performance. To diagnose this droppage, I wrote a very small, simple program that depicts two rectangles bouncing around on the screen, and reports the framerate (which is calculated as an average over 5 seconds).
Under both versions of Qt, the program used a QTimer widget to control the movement of the rectangles. The Qt3 version can simply draw the rectangles directly from the QTimer handler, while the Qt4 version must generate a paintEvent, which I tried both with the "update()" method (which supposedly waits until Qt's main loop to call paintEvent normally), and with the "repaint()" method (which supposedly calls paintEvent immediately, which is supposed to be faster but more likely to flicker).
On my machine (A 1-GHz Celeron with a low-end Radeon, resolution 1400x1050, 16bpp), both versions run fast when the window is at its default size (49 FPS-- the target framerate).
When the window is maximized, however, Qt4 takes a 39% performance hit (19 FPS), while Qt3 takes no hit at all!
In larger programs with lots of widgets (such as the program I was porting when I first noticed the problem), I notice that any use of a timer-updated widget drags the program to a near halt.
I have attached the program, so you can see for yourself that Qt4 really is inferior. It must be built with the $QTDIR environment variable set appropriately. Two Makefiles are required because MOC doesn't pay attention to #ifdef directives. You must run 'make clean' between building the demo with Qt4 and Qt3. |
|
| File Attachment |
 |
|
|