nqrduck.helpers.formbuilder#

A module that allows for easy creation of form views in the NQRduck framework.

Classes

DuckFormBuilder(*args, **kwargs)

A class that allows for easy creation of forms.

DuckFormCheckboxField(*args, **kwargs)

A form field for checkboxes.

DuckFormDropdownField(*args, **kwargs)

A form field for dropdowns.

DuckFormField(*args, **kwargs)

The base class for all Form Fields.

DuckFormFloatField(*args, **kwargs)

A form field for float values.

DuckFormFunctionSelectionField(*args, **kwargs)

A form field for selecting functions.

DuckFormIntField(*args, **kwargs)

A form field for integer values.

DuckLabelField(*args, **kwargs)

class nqrduck.helpers.formbuilder.DuckFormBuilder(*args: Any, **kwargs: Any)#

A class that allows for easy creation of forms.

This class is used to create forms with different types of fields.

fields#

The list of fields in the form.

Type:

list

add_field(field: DuckFormField)#

Adds a field to the form.

Parameters:

field (DuckFormField) – The field to add.

get_values()#

Returns the values of the form fields.

on_state_changed(state: bool, text: str)#

This method is called when the state of a field changes.

Parameters:
  • state (bool) – The state of the field.

  • text (str) – The text of the field.

class nqrduck.helpers.formbuilder.DuckFormCheckboxField(*args: Any, **kwargs: Any)#

A form field for checkboxes.

return_value()#

Returns the value of the checkbox.

class nqrduck.helpers.formbuilder.DuckFormDropdownField(*args: Any, **kwargs: Any)#

A form field for dropdowns.

return_value()#

Returns the selected option.

class nqrduck.helpers.formbuilder.DuckFormField(*args: Any, **kwargs: Any)#

The base class for all Form Fields.

return_value()#

This method should return the value of the form field.

class nqrduck.helpers.formbuilder.DuckFormFloatField(*args: Any, **kwargs: Any)#

A form field for float values.

return_value()#

Returns the value of the float field.

Returns:

The value of the float field.

Return type:

float

class nqrduck.helpers.formbuilder.DuckFormFunctionSelectionField(*args: Any, **kwargs: Any)#

A form field for selecting functions.

create_message_box(message: str, information: str) None#

Creates a message box with the given message and information and shows it.

Parameters:
  • message (str) – The message to be shown in the message box

  • information (str) – The information to be shown in the message box

delete_active_function() None#

This function is called when the active function is deleted.

It will remove the active function from the layout.

load_active_function() None#

This function is called when the active function is loaded.

It will add the active function to the layout.

on_advanced_settings_button_clicked() None#

This function is called when the advanced settings button is clicked.

It will show or hide the advanced settings.

on_functionbutton_clicked(function) None#

This function is called when a function button is clicked.

It will update the function_option.value to the function that was clicked.

on_replot_button_clicked() None#

This function is called when the replot button is clicked.

It will update the parameters of the function and replots the function.

return_value()#

Returns the selected function.

Returns:

The selected function.

Return type:

Function

update_active_function() None#

This function is called when the active function is updated.

It will update the active function with the new parameters.

class nqrduck.helpers.formbuilder.DuckFormIntField(*args: Any, **kwargs: Any)#

A form field for integer values.

return_value()#

Returns the value of the integer field.

Returns:

The value of the integer field.

Return type:

int

class nqrduck.helpers.formbuilder.DuckLabelField(*args: Any, **kwargs: Any)#