RTC Toolkit 6.0.0
Loading...
Searching...
No Matches
gui.repository_panel.RepositoryPanel._TreeViewDelegate Class Reference

This helper delegate is used in the tree view to allow editing only certain scalar types. More...

Inheritance diagram for gui.repository_panel.RepositoryPanel._TreeViewDelegate:
gui.repository_panel.RepositoryPanel._CustomDelegate

Public Member Functions

 __init__ (self, *args, **kwargs)
 
 createEditor (self, parent, option, index)
 Create an editor widget only for certain scalar types and return None for all other cases.
 
 setEditorData (self, editor, index)
 Fills the editor widget with current data from the given model index.
 
 setModelData (self, editor, model, index)
 Updates the model at the given index with modified data from the editor widget.
 
- Public Member Functions inherited from gui.repository_panel.RepositoryPanel._CustomDelegate
 __init__ (self, *args, **kwargs)
 

Static Public Attributes

tuple integer_types
 
tuple floating_point_types
 
tuple other_scalar_types
 

Detailed Description

This helper delegate is used in the tree view to allow editing only certain scalar types.

The setEditorData and setModelData are specialised to improve the user experience when interacting with the tree view during editing. For example, the current type of the datapoint is automatically selected in the TypeComboBox, and we avoid updating the model if the data did not actually change to prevent the Commit button from becoming enabled.

Constructor & Destructor Documentation

◆ __init__()

gui.repository_panel.RepositoryPanel._TreeViewDelegate.__init__ ( self,
* args,
** kwargs )

Member Function Documentation

◆ createEditor()

gui.repository_panel.RepositoryPanel._TreeViewDelegate.createEditor ( self,
parent,
option,
index )

Create an editor widget only for certain scalar types and return None for all other cases.

This will effectively prevent modifications of matrix and vector types in the tree view. In addition, map modifications of the model's "type" column to a combobox.

◆ setEditorData()

gui.repository_panel.RepositoryPanel._TreeViewDelegate.setEditorData ( self,
editor,
index )

Fills the editor widget with current data from the given model index.

Reimplemented from gui.repository_panel.RepositoryPanel._CustomDelegate.

◆ setModelData()

gui.repository_panel.RepositoryPanel._TreeViewDelegate.setModelData ( self,
editor,
model,
index )

Updates the model at the given index with modified data from the editor widget.

Reimplemented from gui.repository_panel.RepositoryPanel._CustomDelegate.

Member Data Documentation

◆ floating_point_types

tuple gui.repository_panel.RepositoryPanel._TreeViewDelegate.floating_point_types
static
Initial value:
= (
RtcFloat,
RtcDouble,
)

◆ integer_types

tuple gui.repository_panel.RepositoryPanel._TreeViewDelegate.integer_types
static
Initial value:
= (
RtcInt8,
RtcInt16,
RtcInt32,
RtcInt64,
RtcUInt8,
RtcUInt16,
RtcUInt32,
RtcUInt64,
)

◆ other_scalar_types

tuple gui.repository_panel.RepositoryPanel._TreeViewDelegate.other_scalar_types
static
Initial value:
= (
RtcBool,
RtcString,
)

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