A form Control is a UI interface for the user to interact with the application.
Bellow we can find the description of all the Controls implemented in the PyForms library.
All the Controls inherit from this Control, therefore you can find its functions and properties in all the other controls listed below.
label - Control label.
defaultValue - Initial value of the control.
helptext - Text shown when the mouse is over the control.
Load the control UI and initiate all the events.
Loads the value of the control.
data - Is a dictionary with the required information to load the control.
Save a value of the control to a dictionary.
data - Dictionary where the control value should be saved.
Show the control.
Hide the control.
Add an option to the Control popup menu.
Add submenu options to the Control popup menu.
Function called when ever the Control value is changed.
Function called before the Control popup menu is opened.
This property returns or set what the control should manage or store.
This property returns or set the name of the control.
Returns or sets the label of the control.
Returns the QWidget of the control.
Returns or set the parent basewidget where the Control is.
Returns or set the tip box of the control.
Returns or set if the control is enable or disable.
defaultValue - The default value is a list containing in the first element the lower value and in the second element the upper value.
min - Defines the minimum value that can be selected.
max - Defines the maximum value that can be selected.
horizontal - Flag indicating if the Bounding slider should be draw horizontally or vertically.
Gets and sets the value of the Control. This value is a list containing in the first element the lower value and in the second element the upper value.
Gets and sets the the minimum value that can be selected in the bounding slider.
Gets and sets the the maximum value that can be selected in the bounding slider.
If True the control works only with Integer values. If False the control will return Float values.
checkable - Flag indicating if the button is checkable or not.
Because the value of this Control is a function, nothing is loaded
Because the value of this Control is a function, nothing is saved
This function simulates a click of a button.
The value should be a pointer to function, that will be called everytime the button is pressed.
In case the button was initiated with the flag checkable=True, it will get and set the checked state of the button.
Gets and sets a boolean indicating the state of the checkbox.
Add more elements to the list. Usage:
controlVar += ('Element', True) or
controlVar += 'Element'Clear all the elements from the list.
Return how many elements the list have.
Returns the Elements with which have the checkboxes checked.
It gets and sets all the List values. This property receives a list where each element is a Row in the list.
controlVar.value = [('item1',True), ('item2',False), 'item3']Add an item to the ComboBox. Items may have a value associated to it.
controlVar.addItem('Portugal', 'pt')
controlVar.addItem('Angola', 'ao')
controlVar.addItem('Moçambique', 'mz')
controlVar.addItem('Brazil', 'br')
controlVar.addItem('Cabo Verde', 'cv')Clear all the items of the ComboBox.
Called when the user selectes an item in the combobox.
index - Activated item's index.
Called when the user passes with the mouse over an item in the combobox.
index - highlighted item's index.
Returns all the items of the combobox.
It returns the selected value of the combo box.
Gets and set the current selected item text.
This control is used to select a directory.
This control is used to create DockWidget.
side - Side where the dock widget should be initiated. It can assumes the values: left, right, top or bottom.
This Control may be used to display a BaseWidget or another Control inside.
The constructer receives only a label.
It may receive an element, or a list of elements from the types BaseWidget or BaseControl.
The control may be used to select a file.
Gets and sets a file path.
Show the directory files in a tree view
⋅⋅⋅Note Is not fully developed yet.⋅⋅
Gets and sets a directory path.
Displays an image or a list of images.
Redraw the image or set of images
This property receives an image path, a numpy image or a list of numpy images.
Usage:
controlVar.value = 'lena_color.png'or
controlVar.value = cv2.imread('lena_color.png', 1)or
img1 = cv2.imread('lena_color.png', 1)
img2 = cv2.imread('lena_color.png', 1)
controlVar.value = [img1, img2]Note: the value can only be set outside the constructor and the initForm function.
Displays a text.
Displays a list of values.
defaultValue - plusFunction - minusFunction -
Clear all the values from the list.
Inserts a new row with the list of values.
Removes the row with the index.
Set the value of a specific cell.
Get the value of a specific cell.
Get and set the horizontal headers in the table list.
Accepts a boolean indicating if should allow only the selection of the entire row or not.
Return the number of rows.
Get and set the list values.
Return the selected indexes.
Return the selected index.
Gets and sets the icon size.
The constructer receives only a label.
Usage:
controlVar += baseWidgetor
controlVar += [baseWidget1 , baseWidget2]Boolean flag, indicating if should show the subwindows close button or not.
Sets a BaseWidget or a list of BaseWidgets representing the windows.
min - Defines the minimum value that can be selected.
max - Defines the maximum value that can be selected.
Defines the minimum value that can be selected.
Defines the maximum value that can be selected.
Returns the selected number.
Refresh the GL scene.
Reset all the zoom and scene rotations.
Gets and sets a GL scene.
Gets the GL window width
Gets the GL window height
Toggle video play.
Refresh the last painted frame.
Returns a boolean indicating if the video is playing.
Function called before the frame is rendered.
Gets and sets the function called on double click event.
The funtion receives the next parameters: onDoubleClick(event, x, y)
Gets and sets the function called on click event.
The funtion receives the next parameters: onClick(event, x, y)
Gets and sets the function called during a drag event.
The funtion receives the next parameters: onDrag(startPoint, endPoint)
Gets and sets the function called when a drag event ends.
The funtion receives the next parameters: onEndDrag(startPoint, endPoint)
When not None, it returns a cv2.VideoCapture object.
It may receives a video file path, or a cv2.VideoCapture object.
Usage:
controlVar.value = '~/home/ricardo/video.avi'or
controlVar.value = cv2.VideoCapture('~/home/ricardo/video.avi')Gets and sets the first frame.
Gets and sets the last frame.
Returns the current frame index.
Returns the total number of frames of a video.
Returns and sets the image beeing rendered.
Returns and sets the video FPS.
Return and set the help text that should be rendered in the video.
label - This is the text that will be shown in the ProgressBar.
min - Defines the minimum value that can be selected.
max - Defines the maximum value that can be selected.
Defines the minimum value that can be selected.
Defines the maximum value that can be selected.
Current position.
min - Defines the minimum value that can be selected.
max - Defines the maximum value that can be selected.
Defines the minimum value that can be selected.
Defines the maximum value that can be selected.
Event called when the user ends the control edition.
It returns and receives a list of BaseWidgets.
Repaint the points
Gets and sets a list of 2D or 3D points to display.
Set the graph legend
(True or False). Show a grid in the graph
Set the graph title
Set the x axis label.
Set the y axis label.
Set the z axis label.
Repaint the image.
Gets and sets an numpy array image with volume.
Gets and sets the color map to display.
It can receives the next values: CM_BONE, CM_COOL, CM_COPPER, CM_GRAY, CM_HOT, CM_HSV, CM_JET, CM_PINK, CM_AUTUMN, CM_SPRING, CM_SUMMER, CM_WINTER.
Check out VisVis documentation.

























