Braviz Qt Widgets¶
This module contain PyQt widgets that may be used in several applications.
-
class
ListValidator
(valid_options)[source]¶ Can be applied to
QLineEdit
so that it will only accept input from a list of possible values.Can be used together with
QCompleter
Parameters: valid_options (set) – Set of valid strings to accept as input
-
class
ContextVariablesPanel
(parent, title='Context', initial_variable_idxs=None, initial_subject=None, app=None, sample=None)[source]¶ A panel that displays and allows to edit variables for a given subject.
The context menu of the panel allows the user to select variables and to make some of them editable. In this case a save changes button will also be displayed. Pressing it will cause the changes to be written into the databases
Parameters: - parent (QObject) – Qt parent
- title (str) – Title for the widget
- initial_variable_idxs (list) – List of variable indices to display at start
- initial_subject – Id of the initial subject whose variable values will be displayed
- app – Optional, an application with the
save_screenshot
andget_state_dict
method. In this case a scenario will be automatically created whenever a variable is first modified. - sample (list) – list of subjects. This sample will be passed on to the variable select dialog deployed by the panel.
Create a context menu which gives the user the option to open a dialog to select variables
Parameters: pos – Position of event
-
get_editables
()[source]¶ Get a list of tuples (var_code, editable) indicating which variables are editable
-
set_sample
(new_sample)[source]¶ Set the sample used in the variable selection dialogs
Parameters: new_sample (list) – List of subject ids