RTC Toolkit 6.0.0
Loading...
Searching...
No Matches
gui.ndarray_edit_base.NdarrayEditBase Class Reference

Widgets used for editing ndarray data objects. More...

Inheritance diagram for gui.ndarray_edit_base.NdarrayEditBase:

Public Member Functions

 __init__ (self, parent=None, *args, **kwargs)
 Initialise the ndarray data model.
 
 emit_commit_data (self)
 Helper slot method for classes deriving from this one to forward QAbstractItemDelegate signals as a commit_data signal.
 
 get_value (self)
 Getter for the value property will return the original object set.
 
 set_value (self, numpy.ndarray value)
 Setter for the value property.
 

Public Attributes

 data_model = NdarrayModel()
 

Static Public Attributes

 value_changed = Signal(numpy.ndarray)
 This signal is emitted whenever the value property changes.
 
 commit_data = Signal(QWidget)
 This signal is emitted whenever the user has made modifications to the data using this edit widget that should be committed.
 
 value
 

Protected Member Functions

 _data_model_changed (self, start_index, end_index, roles)
 Handles the matrix data model changes by emitting appropriate value_changed signals.
 
 _data_shape_changed (self, parent, first, last)
 Handles row/column inserts and removals by emitting appropriate value_changed signals.
 
 _data_model_reset (self)
 Handles whole model resets by emitting the value_changed signal in cases where the dataChanged signal will not be called, such as when the data has zero rows or columns.
 

Protected Attributes

 _data_model_changed
 
 _data_shape_changed
 
 _data_model_reset
 

Detailed Description

Widgets used for editing ndarray data objects.

This is a base class that introduces a value property and appropriate signal interface for a composite widget that allows editing and viewing ndarray data.

Constructor & Destructor Documentation

◆ __init__()

gui.ndarray_edit_base.NdarrayEditBase.__init__ ( self,
parent = None,
* args,
** kwargs )

Initialise the ndarray data model.

Parameters
parentThe optional parent Qt widget object.
argsAdditional positional arguments passed onto the base class.
kwargsAdditional keyword arguments passed onto the base class.

Member Function Documentation

◆ _data_model_changed()

gui.ndarray_edit_base.NdarrayEditBase._data_model_changed ( self,
start_index,
end_index,
roles )
protected

Handles the matrix data model changes by emitting appropriate value_changed signals.

◆ _data_model_reset()

gui.ndarray_edit_base.NdarrayEditBase._data_model_reset ( self)
protected

Handles whole model resets by emitting the value_changed signal in cases where the dataChanged signal will not be called, such as when the data has zero rows or columns.

◆ _data_shape_changed()

gui.ndarray_edit_base.NdarrayEditBase._data_shape_changed ( self,
parent,
first,
last )
protected

Handles row/column inserts and removals by emitting appropriate value_changed signals.

◆ emit_commit_data()

gui.ndarray_edit_base.NdarrayEditBase.emit_commit_data ( self)

Helper slot method for classes deriving from this one to forward QAbstractItemDelegate signals as a commit_data signal.

◆ get_value()

gui.ndarray_edit_base.NdarrayEditBase.get_value ( self)

Getter for the value property will return the original object set.

◆ set_value()

gui.ndarray_edit_base.NdarrayEditBase.set_value ( self,
numpy.ndarray value )

Setter for the value property.

Parameters
valueThe 2D Numpy ndarray object that will be viewed/edited by this widget.

Member Data Documentation

◆ _data_model_changed

gui.ndarray_edit_base.NdarrayEditBase._data_model_changed
protected

◆ _data_model_reset

gui.ndarray_edit_base.NdarrayEditBase._data_model_reset
protected

◆ _data_shape_changed

gui.ndarray_edit_base.NdarrayEditBase._data_shape_changed
protected

◆ commit_data

gui.ndarray_edit_base.NdarrayEditBase.commit_data = Signal(QWidget)
static

This signal is emitted whenever the user has made modifications to the data using this edit widget that should be committed.

◆ data_model

gui.ndarray_edit_base.NdarrayEditBase.data_model = NdarrayModel()

◆ value

gui.ndarray_edit_base.NdarrayEditBase.value
static
Initial value:
= Property(
type=numpy.ndarray,
fget=get_value,
fset=set_value,
user=True,
notify=value_changed,
doc="The Ndarray being edited by this composite widget.",
)

◆ value_changed

gui.ndarray_edit_base.NdarrayEditBase.value_changed = Signal(numpy.ndarray)
static

This signal is emitted whenever the value property changes.


The documentation for this class was generated from the following file: