Simple XML-based UI builder for Qt4

Submitted by mimec on 2012-05-28
XMLUI

Introduction

This library provides a tool strip widget, replacing classic menu bar and toolbars, and facilities for defining and merging the layout of actions from multiple components, using simple XML files.

Tool strips have several advantages over traditional menu bar and toolbars. Unlike menus, all most commonly used actions can remain accessible with a single mouse click, while it is still possible to put less commonly used actions in popup menus attached to tool buttons. On the other hand, actions can be logically grouped and visually distinguished much better than in a traditional toolbar, which is simply a long row of similar looking icons.

The XmlUi library also provides a set of classes which simplify building the tool strip and popup menus. The layout can be defined using XML files which allows changing them easily without modifying the code. They also allow the layout of actions to be merged from multiple components, which is most useful in applications which embed various types of views or custom plug-ins.

The first version of XmlUi was inspired by the KXMLGUI classes from the KDE libraries. Later the tool strip widget was added and a simplified version of the Windows Modern Style was incorporated to provide a better look and feel for tool strips and menus. If you prefer to use traditional menu bar and toolbars, you can use the older version of XmlUi.

Documentation

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

History

2.1 (2012-05-28)

  • fixed toolstrip appearance on Mac OS X
  • added the execMenu() and toolStrip() helper functions
  • display shortcut of default menu item in button's tooltip when available

2.0 (2011-12-19)

  • added the new toolstrip control
  • integrated the modern Windows style

1.1 (2009-11-23)

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

1.0 (2008-06-23)

  • initial version

Downloads

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