Skip to content

UI crackrock therapy...

Monday, 15 March 2004  |  geiseri

After wasting a few hours converting some old C++ GUI code to UI files for easier management I decided to write a small tool to move C++ based GUI code to Qt's UI files.

The UI Recovery Toolkit or uirtk for short [image:379] was developed to help me move convoluted C++ UI code into UI files. The image on the left is the orignal C++ code and the image on the right is the UI file rendered in KUIViewer. After this XML is generated the UI can be subclassed and used from the C++ code. This keeps the autogenerated UI code from the more business logic code.

Basicly I take in a root widget, and dig through the properties until i get the XML representation of the UI. Currently Im limited to a few simple properties, such as sizes and geometries. Also you are limited to widgets that can be created by QWidgetFactory.

I currently can handle QHBox and QVBox layouts, along with support for QLayout based code.

Ideally I can clean this up and we can convert a few troublesome GUIs in kde over to UI files where usability developers can beat them back into submission.