README for ui2rb

1. What's this?

Qt(v2.x) library includes designer program, which is an RAD tool 
with GUI for Qt dialogs.  ui2rb is a ruby script that translate 
designer's output file to ruby script using Ruby/Qt2 extension.  
An output file (*.ui file) is described with XML and ui2rb uses 
QDom class of Ruby/Qt2 extension that handle XML documents.  The 
extension library including QXml and QDom classes are provided as 
separated extension library from main Ruby/Qt2 extension library.  
This library are placed in qt2/modules/xml directory.  So, before 
use ui2rb script, please compile and install files in this 
directory. (See Install section for detail)



2. Install

To use ui2rb, you need to install extension libraries listed 
above, as well as ruby and Ruby/Qt2 extension library.

a. qt2xml.so... extension library to use Xml module of Qt library.

Files needed to make qt2xml.so are placed in qt2/module/xml 
directory.

b. If you want to use QIconView or QTable, you need to install 
qt2iconview.so or qt2table.so file.

These files are created from files in qt2/module/iconview and 
qt2/module/table directory.  

c.  If you want to use Icon(pixmap file), you need to install zlib 
extension library.  You can download it from  
http://www.blue.sky.or.jp/atelier/ 



To install extension libraries described a. and b., execute these 
commands in each directory.

ruby extconf.rb --with-qt2-dir=<where Qt library installed>

make

make install

(example:  If Qt library is installed in /usr/lib/qt,

ruby extconf.rb --with-qt2-dir=/usr/lib/qt

make 

make install

)

To use QTable, you need to install table module of Qt library.  
Normally, the table module is install automatically, however, you 
can explicitly exclude the table module when install Qt library.  
If you use binary package of Qt library, please check table module 
is included in the package.  

As to zlib extension, you can install as usual ruby extension 
library.

(For example, in the directory of zlib extension library files, 
execute ...

ruby extconf.rb

make

make install

)

3. How to use ui2rb

a. Make a dialog using designer program and save it as .ui 
file(test.ui). 

b. In the directory include formmaker.rb and ui2rb, execute

ui2rb test.ui

to open the dialog.

If you want to save translated ruby script as test.rb, execute ...

ui2rb -o test.rb test.ui

And ui2rb --help display options.

c. To install ui2rb command to your system,

c-1 copy formmaker to the directory where ruby libraries are, such 
as /usr/local/lib/ruby/site_ruby.

c-2 copy ui2rb to the directory included in PATH environment 
variable, such as /usr/local/bin.



**************************************

Nobuyuki Horie, Ph.D.

Lab. Genetic Engineering/Univ. of Shizuoka

mail: horie@smail.u-shizuoka-ken.ac.jp

home page: http://www.u-shizuoka-ken.ac.jp



