Blog

Third Qt article

Submitted by mimec on

I published the third (and for now the last) Qt article, called Modern Qt style for Windows. It's a Qt style for Windows modifying the look of toolbars, menus and some other components, resembling MS Office 2003 and some .NET applications. In WebIssues I originally used a customized version of the DotNetStyle, which was recently published as a Qt Solutions component. For Fraqtive I created a new style written almost completely from the beginning. Now I removed the remaining GPL-ed code copied from the DotNetStyle component and relicensed the entire code to a BSD-style license, allowing to use it in both GPL-ed and commercial applications. Note that this style is written specifically for needs of WebIssues and Fraqtive. There is no warranty that it will be suitable for all applications without modifications. Of course suggestions of improvements and bug reports are as always welcome.

Shortly I will release a new version of Fraqtive including the current version of this style and some other minor UI improvements. I'm also finishing refactoring the WebIssues code and I soon I will start implementing some new features, so if everything goes well, a beta release will be available in the beginning of August. Then I'm going for a week to Vancouver. It's a business trip, because I work on a project for a Canadian company, but I will also have some time to rest and visit some nice places in the area, so I'm impatiently looking forward to it :).

Modern Qt style for Windows

Submitted by mimec on
WMStyle

Introduction

The WindowsModernStyle changes the look of toolbars and menus to a style similar to MS Office 2003 and some .NET applications. Depending on the selected color scheme of Windows XP and Vista, they will automatically use the blue, silver or green colors. Also when the Windows Classic style is used, the toolbars and menus will adjust their look to the current color scheme.

In addition, this style also changes the look of:

  • docked windows, including their title bars and tabs used when multiple docked windows are stacked together
  • tab widgets located within a main window (tab widgets placed in dialogs and other windows are not affected)
  • splitters located within a main window
  • toolbox widgets, including both item headers and background of pages

All other widgets are not affected and are rendered using the native Windows style (Vista, XP or classic Windows, depending on the OS version).

The style can be included in an existing application or compiled as a plugin library. This package also contains a demo program using this style.

WindowsModernStyle requires Qt 4.3 or newer, compiled with the Windows XP and Windows Vista styles enabled.

Note: a new, simplified version of the Modern Qt style is now part of the XmlUi component.

Documentation

You can find the full documentation for this article at doc.mimec.org/articles/wmstyle/. It is also included in the source package.

History

1.1 (2009-11-23)

  • added: support for toolbar buttons with menu
  • fixed: painting undocked toolbars
  • added: styling splitters in main window
  • fixed: improved appearance of styled tab widgets

1.0 (2008-07-14)

  • initial version

Downloads

This code can be freely used and modified in both open source applications (including GPL) and commercial applications.

Second Qt article

Submitted by mimec on

The second Qt article is available, called Simple XML-based UI builder for Qt4. It's a component which allows to merge actions from multiple components and define the layout of menus and toolbars using simple XML files. I wrote it for WebIssues when porting from KDE to Qt4 to replace the KXMLGUI components that I previously used; however this new solution is much simpler and it doesn't depend on anything else than Qt.

Soon I will publish one more article with the graphics style for Windows used by Fraqtive. The style used by WebIssues was based on a Qt Solutions component, but the new one was completely rewritten by me, so when I remove the remaining pieces of GPL-ed code I will probably re-license it to a BSD-style license as well. Then if only I have some time, I'm going back to work on the next version of the WebIssues client.

A little side note: my recent post about moving from Gliwice made my boss panic a little bit, which is actually a good thing, because I got a pretty decent argument to think through this decision :). The truth is, if I had one argument of, let's say, more non-material nature, I would immediately buy a flat in Gliwice and, you know, live happily ever after and all that stuff. But unfortunately life is much more complicated and sometimes we have absolutely no influence on some things, so all I can do now is wait a bit more.

New articles

Submitted by mimec on

I started writing first articles about programming containing reusable source code more than six years ago, inspired by websites like CodeGuru and CodeProject which were an invaluable source of information when I was learning Visual C++ and MFC. They are still available here and remain the most popular section of my website. The idea of reusing code is even more important in open source development, but it took many years until I finally decided to start publishing articles related to Qt.

At the moment I'm extracting reusable components from the WebIssues Client code and writing documentation and demo applications for them. The first article called Simple template-based relational database is already available. It describes the data container invented for and used by the WebIssues Client, which is an interesting and innovative alternative to using a hierarchy of objects to store application data in memory.

Though WebIssues is licensed under the GPL, I decided to relicense all reusable components using the revised BSD-style license, which allows to use them in both open source and commercial applications.

Another article I wrote some time ago describes the Generator core component of Fraqtive. I'm publishing it because it may be a good source of knowledge for someone who wants to learn metaprogramming on a practical example. The generator core is the most advanced piece of code that I've ever written in C++. It turned out to be an excellent exercise field, because the code is relatively small and simple, yet it allowed me to use a large number of various programming techniques, including metaprogramming with complex class templates.

Weekend in Prague

Submitted by mimec on

Actually more than a weekend - four whole days. Enough time to see the most interesting places and to feel the climate of the city. It's amazing, I must admit. It's really big and full of different cultures, but somehow it makes you feel like home. It's also beautiful, not just the few places most crowded by tourists, but the entire center of the city has a consistent and elegant look. And it's calm, full of parks and gardens, nice restaurants and pubs, you almost don't file the usual rush of the big city.

This trip also made me realize the sad truth about the place where I live. Well, it wasn't the only reason, because I've been thinking above moving to another city for some time already, but that was the drop that made the glass overflow. Now it's not a matter of "if", but "where" and "when". I'm not really intending to go abroad just now (although from Gliwice it's not much farther to Prague than to Warsaw), so I'm probably going to decide between Wrocław and Kraków. The "when" is something between six months and a year, realistically speaking. I don't want to think about it during the summer, besides finding a job that would fully satisfy me will also take some time.