User interfaces can be created with JavaScript, both manually via QWidget bindings, and with Qt Designer. Using Qt Designer is the preferred method and can be accomplished as follows.
dialog = Factory.loadui("myuserinterface.ui");
button = dialog.getElementById('ok');
button.connect(button, 'clicked()', someobject, 'okClicked_void');
All widgets need to be named appropriately as they are clearly referenced from the XML designer file via DOM methods by their widget name.
It is almost always the case that code that uses widgets or dialogs will want to create a class to organize the data and UI and create slots for the signals generated by the UI elements.
Menu entries can be merged into the Kst menus by creating KActions and loading an appropriate XMLUI rc file:
gui = KstUIMerge.loadGUI("myuserinterface.rc");
action = new KAction(gui.actionCollection(), "my_action_name");
action.text = "&Name Of My Action";
action.connect(action, 'activated()', someobject, 'show');
gui.merge();
KstJSUIBuilder loadGUI(String filename);
Loads a XMLUI file for merging with Kst's GUI. Returns a KstJSUIBuilder instance with the XMLUI loaded and ready to merge.
String filename The filename of the .rc file to load.KActionCollection actionCollection();
Obtain a reference to the action collection for creating new actions. Returns a KActionCollection instance for storing newly created actions to be merged with Kst's GUI.
void merge();
Merge the action collection with Kst's GUI according to the rules of the loaded XMLUI file. Must be called after all actions are created as a part of the actionCollection().
Kst.gui.close();
It is possible, but unclear at this time, that script user-interfaces developed with Trolltech's Qt Designer product must be licensed under one of Trolltech's licensing models. This includes the GPL. This may only apply if such UI files are redistributed.