technical

Modern Qt style for Windows

Submitted by mimec on 2008-07-14
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.