[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.12.7 Using QT Designer To Create AWS Definition Files

On many platforms Trolltechs Designer is available, a tool that lets you create graphical user interfaces like Dialogs, Forms etc. It saves the interface description in an easy to read format (XML - even though i was not able to locate a formal document type description (DTD) for it, it's format is pretty obvious).

You should be aware that not all features the Designer is capable of can be translated into AWS simply because they are not available in AWS. The same is true for features available in AWS but not in Designer.

What you need

Since Designer saves its interface description in XML writing an extensible stylesheet to transform it into AWS format was an obvious choice. So you will need a XSLT stylesheet processor. You can either choose a commercial product or the excellent Xalan which is part of the Apache project. You can get it for free here: http://xml.apache.org For development i used the Xalan Java 2 version at: http://xml.apache.org/xalan-j/index.html

How to use it

Design your dialog or widget in Designer and save it somewhere. To process the stylesheet with the java version of Xalan you call:
 
java org.apache.xalan.xslt.Process \
    -IN path/to/the/saved/designer/file.ui \
    -XSL path/to/CS/scripts/aws/qt2aws.xsl

Append the output to a file containing skin definitions.

What controls are converted ?

QT Class AWS Class
QPushButton ==> Command Button
QRadioButton ==> Radio Button
QSlider ==> Scroll Bar
QButtonGroup ==> Group Frame
QGroupBox ==> Group Frame
QFrame ==> Group Frame
QCheckBox ==> Check Box
QLineEdit ==> Text Box
QLabel ==> Label
QLabel with Pixmap ==> Image View
QListBox ==> List Box
QListView ==> List Box
QDialog ==> Window
QWidget ==> Window
QTabWidget ==> Notebook

Special Notes

You can place special information in the controls whatsThis property. The content will be broken into tokens separated by the pipe ("|"). A token consist of a token identifier, the colon : and token text. The following tokens are recognized:

Both examples from above would be concatenated and placed in the whatsThis property and would look like this:

 
c:signalClicked,mySink::OnClick,signalBreak,
    mySink::ByeBye|l:LeftEye: "Blue"


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated using texi2html