GUI API
QtBind
is what I have decided to call my small Python -> Qt wrapper. It creates a translation layer between Python and C++ for the GUI.
gui init(ModuleName, TabName)
Initializes the GUI. Only call this when the module first loads. You must save the return value in order to create widgets on the interface. You must keep the module name as __name__
. This is so GUI events are passed to the script.
widget createButton(QtBind, CallBack, Text, X, Y)
Creates a button on the UI. The callback parameter is a string containing your function name.
widget createCheckBox(QtBind, CallBack, Text, X, Y)
Creates a check box on the UI. The callback parameter is a string containing your function name. The callback will be passed the check state. True/False.
widget createLabel(QtBind, Text, X, Y)
Creates a label on the UI.
widget createLineEdit(QtBind, Text, X, Y, W, H)
Creates a line edit on the UI. To get the text a user has typed in the box, use the text()
function.
widget createList(QtBind, X, Y, W, H)
Creates a list widget on the UI. To get the current selected item text, use the text()
function.
widget createCombobox(QtBind, X, Y, W, H)
Creates a combox on the UI. To get the current selected item text, use the text()
function.
setText(QtBind, Widget, Text)
Sets the text of a widget.
setChecked(QtBind, Widget, State)
Sets the checked state of a check box.
string text(QtBind, Widget)
Returns the text of a widget. Or returns the current selected item text in a list widget.
destroy(QtBind, Widget)
Destroys a widget.
move(QtBind, Widget, X, Y)
Moves a widget.
boolean isChecked(QtBind, Widget)
Returns the checked state of a check box. Do NOT call this function on anything but a check box!
clear(QtBind, Widget)
Erases the text in a widget or clears the entire widget if it is a list widget.
append(QtBind, Widget, text)
Appends text to a list widget.
int currentIndex(QtBind, Widget)
Returns the currently selected index of a list widget.
remove(QtBind, Widget, text)
Removes all items with the value specified in a list widget.
removeAt(QtBind, Widget, index)
Removes an item at a specified index in a list widget.
getItems(QtBind, Widget)
Returns a list of all items in a list widget.
Last updated