autooptions.widget module

class autooptions.widget.OptionsWidget(viewer, options, client=None)[source]

Bases: QWidget

Automatically creates a widget from an options object. The option values can be changed in the dialog. When the Apply or the Ok-button is pressed the values are copied from the dialog to the options object and saved to the options file.

addApplyButton(callback)[source]

Add an apply button to the options widget. When the button is pressed the value are copied from the dialog to the options object. The dialog remains open.

Parameters:

callback – The client can register a callback that is called when the apply button is pressed

addCancelButton(callback)[source]

Add a cancel button to the options widget. When the button is pressed the dialog is closed, the values in the dialog are not copied to the options object.

Parameters:

callback – The client can register a callback that is called when the ok button is pressed

addOKButton(callback)[source]

Add an ok button to the options widget. When the button is pressed the value are copied from the dialog to the options object. The dialog is closed.

Parameters:

callback – The client can register a callback that is called when the ok button is pressed

getApplyButton()[source]

Answers the apply button if it exists and None otherwise.

getCancelButton()[source]

Answers the cancel button if it exists and None otherwise.

getImageLayer(name)[source]

Answer the image layer that has the name of the value of the option with the given name. The option must be a layer selection option (image, labels, points, fft).

Parameters:

name – The name of an option

Returns:

The layer that has the name corresponding to the value of the option

getOKButton()[source]

Answers the ok button if it exists and None otherwise.

shut()[source]

Shut down the options widget. Removes the dock-widget from the window and closes the widget.