[KDE Dot News]
 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.
  Related Links
 ·   Articles on KDE Advocacy, Discussions, and Rumors
 ·   Also by Daelin the Cruel
 ·   Contact author

  File Attachment
  • Click to download attachment qtprog.tar.bz2
    1KB (1875 bytes)

  • Thread Threshold:

    The Fine Print: The following comments are owned by whomever posted them.
    ( Reply )

    Re: Qt4 SUCKS!!! Please go back to Qt3!
    by cornelius sohn on Thursday 23/Aug/2007, @08:41
    You are right. But how much qt4 really sucks you will know only if you try to build a real world application. I'm trying to get a working tree view for very large data sets - the Troll versions tend to break down with a o(n**2) behavior or other insanities. And the sophisticated model/view pattern is ... bullshit! The documentation is worthless; without looking at the source code you wont ever understand how things should work.

    Code less. Create more?
    Code less. Think more!
    [ Reply To This | View ]
    The Fine Print: The previous comments are owned by whomever posted them.
    ( Reply )

      "Sorry, security is not optional." -- Waldo Bastian
    KDE®, "K Desktop Environment", "KDE Dot News", "got the dot?" and the KDE Logo® are trademarks or registered trademarks of KDE e.V. in the European Union, the United States and other countries. All other trademarks and copyrights on this page are owned by their respective owners. Comments are owned by the poster. The rest: Copyright © 2000-2008 KDE e.V. for The KDE Project. For further information or comments on this site, please contact the Webmaster.
    [ home | post article | flat forty | subscribe | search | rdf ]