Skip to content

Qt 4.0 Progress

Saturday, 30 April 2005  |  daniel molkentin

Qt4 is really progressing well. The only problem at this point is that it still changes a lot even after Beta 2 which originally meant to end the phase of rather radical changes, according to the trolls. But that's fine. Let them get their APIs sorted out, let them react to the extensive feedback and let them time to do it right.

So what's new in Qt land since Beta 2? First thing to notice is the introduction of "Plastique", which is, as you certainly suspected already, a Qt-only version of the KDE 3.4 default theme "Pastik". The clear advantage is that Qt finally has a decently looking style for Linux, which is available even to statically-linked Qt applications. This is good since I never liked the rather sharp-edged windows style mixed with rather smooth styles like Plastik.

The next topic is an improvement (at least I suppose it's new, Maksim wasn't sure either) regarding tool windows handled by QWorkspace (aka MDIs). The window decoration is now completely under control of QStyle, and it might be possible to implement a bridge in KStyle that maps the current KWin decoration on a KDE Style for MDI Widgets. That said, Maksim warned me that it would be hard to do, so I don't take that for granted. Anyway, Plastique provides a nice (hardcoded) Plastik Window decoration, you can get a good impression on how things could look like in the future.

Oh yeah, and another one: It will be possible for Qt-only application to make use of at least parts of the KDE icons now. Qt has a standard icon set, which depends on the style. KStyle can map them to KIconLoader, or whatever its equivalent in KDE 4 will be called. Ideally everyone is going to use KDE libs for all platforms once the Qt4 port of the KDE libraries is done and available for all major platforms (Unix, Linux, OS X, Windows) even for Qt-only apps, but we will see if that is going to be accepted amongst Qt developers. Anyway, this will work in any case :).

Designer started to get a usable resource editor component. Qt4 resources obsolete the qembed concept of Qt3, making things significantly easier: Simply add files in the editor (i.e. graphics), i.e. /images/mypic.png. Add the resource file to your Qt project and run make. Qt will handle the rest for you. Accessing the resource e.g. from within richtext is as easy as label->setText( QLatin1String( "... ; ..." ) );

The richtext engine itself still has some bugs, but I'm confident they'll get sorted out soon. That's today's little Qt4 tour. We hope you had a pleasant trip!