Edition widgets#

FloatEdit#

Module contains a float editor

class FloatEdit(parent=None, value=None)[source]#

Bases: QLineEdit

Field to edit a float value.

The value can be modified with value() and setValue().

The property widgetResizable() allow to change the default behaviour in order to automatically resize the widget to the displayed value. Use setMinimumWidth() to enforce the minimum width.

Parameters:
  • parent (QWidget | None) – Parent of the widget

  • value (float | None) – The value to set the QLineEdit to.

value()[source]#

Return the QLineEdit current value as a float.

Return type:

float

setValue(value)[source]#

Set the current value of the LineEdit

Parameters:

value (float) – The value to set the QLineEdit to.

widgetResizable()[source]#

Returns whether or not the widget auto resizes itself based on it’s content

Return type:

bool

setWidgetResizable(resizable)[source]#

If true, the widget will automatically resize itself to its displayed content.

This avoids to have to scroll to see the widget’s content, and allow to take advantage of extra space.

Parameters:

resizable (bool)

minimumWidth()[source]#

Returns the user defined minimum width.

Return type:

int

IntEdit#

class IntEdit(parent=None)[source]#

Bases: QLineEdit

QLineEdit for integers with a default value and update on validation.

Parameters:

parent (QWidget)

sigValueChanged#

Signal emitted when the value has changed (on editing finished)

getValue()[source]#

Return current value (None if never set).

Return type:

int | None

setRange(bottom, top)[source]#

Set the range of valid values

Parameters:
  • bottom (int)

  • top (int)

getRange()[source]#

Returns the current range of valid values

Return type:

tuple[int, int]

Returns:

(bottom, top)

setDefaultValue(value, extend_range=False)[source]#

Set default value when QLineEdit is empty

Parameters:
  • value (int)

  • extend_range (bool) – True to extend range if needed. False to clip value if needed

getDefaultValue()[source]#

Return the default value or the bottom one if not set

Return type:

int | None

setCurrentValue(value, extend_range=False)[source]#

Set the currently displayed value

Parameters:
  • value (int)

  • extend_range (bool) – True to extend range if needed. False to clip value if needed

getCurrentValue()[source]#

Returns the displayed value or None if not correct

Return type:

int | None