Csound Csound-dev Csound-tekno Search About

[Csnd] Script for creating UIs with QtDesigner

Date2013-06-30 10:12
FromTarmo Johannes
Subject[Csnd] Script for creating UIs with QtDesigner
AttachmentsUI_with_QtDesigner.py  qtd_import.ui  
Hi,

In Linux Audio Conference I introduced how it is possible to design quickly an 
user interface to e used in CsoundQt with the help of QtDesigner

There is info about it on
http://sourceforge.net/apps/mediawiki/qutecsound/index.php?title=Python_API_in_CsoundQt#Create_GUI_with_QtDesigner

On my way back in Frankfur airport I had many hours to wait and I almost wrote 
a helping script that would make it really easy - you just click and design 
and almost don't have to touch the code. Now I could finish it.

The script is uploaded also to the git of csounqt (src/Scripts/Useful), I 
attach it also here + the ui file of the interface, that is created with 
QtDesigner and reinserted to the script with the help of the script itself.

It is tested now only on linux and it needs QtDesigner for Qt development git 
and an utility called pyuic4 (from python-qt4-devel or similar).

Using it is easy :
run it in CsoundQt (easiest if you place to you scripts folder, specified in 
Configuration->Enviroment->Python script dir)
Click "new" and enter a name fro the interface file (or "select" if you want 
to change or use already an existing ui file)
Click "Design" to open QtDesinger
build your interface - drag and drop widgets to the canvas, click "Slots and 
signal" to connect your widgets to slots that you can define now and later 
write in your program.
Save, the press "Convert and insert", place the cursor in your csound file  
and the python code (if you want, embraced with pyruni {{ }} block) will be 
inserted there.

There is also a demo video in vimeo, but now without voice. After a week (I'll 
be away)I will also the voice - will be more clear.
http://vimeo.com/69398053

Hope it turns useful to many!

greetings,
tarmo