Package node_manager_fkie :: Module capability_table :: Class CapabilityHeader
[frames] | no frames]

Class CapabilityHeader

source code

python_qt_binding.QtWidgets.QHeaderView --+
                                          |
                                         CapabilityHeader

This class is used for visualization of robots or capabilities in header of the capability table. It is also used to manage the displayed robots or capabilities. Furthermore QtGui.QHeaderView.paintSection() method is overridden to paint the images in background of the cell.

Instance Methods
 
__init__(self, orientation, parent=None) source code
int
index(self, name)
Returns the index of the object stored with given name
source code
 
paintSection(self, painter, rect, logicalIndex)
The method paint the robot or capability images in the backgroud of the cell.
source code
 
mousePressEvent(self, event)
Interpret the mouse events to send the description of a robot or capability if the user click on the header.
source code
 
setDescription(self, index, cfg, name, displayed_name, robot_type, description, images)
Sets the values of an existing item to the given items.
source code
 
updateDescription(self, index, cfg, name, displayed_name, robot_type, description, images)
Sets the values of an existing item to the given items only if the current value is empty.
source code
 
removeDescription(self, index)
Removes an existing value from the header.
source code
 
insertItem(self, index)
Inserts an item at the given index into the header.
source code
int
insertSortedItem(self, name, displayed_name)
Insert the new item with given name at the sorted position and return the index of the item.
source code
[int]
removeCfg(self, cfg)
Removes the configuration entries from objects and returns the list with indexes, where the configuration was removed.
source code
int
count(self)
Returns: The count of items in the header.
source code
str
getConfigs(self, index)
Returns: The configurations assigned to the item at the given index
source code
Class Variables
  description_requested_signal = Signal(str, str)
the signal is emitted by click on a header to show a description.
Method Details

index(self, name)

source code 

Returns the index of the object stored with given name

Parameters:
  • name (str) - the name of the item
Returns: int
the index or -1 if the item was not found

paintSection(self, painter, rect, logicalIndex)

source code 

The method paint the robot or capability images in the backgroud of the cell.

removeDescription(self, index)

source code 

Removes an existing value from the header.

Parameters:
  • index (int) - the index of the item to remove.

insertItem(self, index)

source code 

Inserts an item at the given index into the header.

Parameters:
  • index (int) - the index

insertSortedItem(self, name, displayed_name)

source code 

Insert the new item with given name at the sorted position and return the index of the item.

Parameters:
  • name (str) - the name of the new item
Returns: int
index of the inserted item

removeCfg(self, cfg)

source code 

Removes the configuration entries from objects and returns the list with indexes, where the configuration was removed.

Parameters:
  • cfg (str) - configuration to remove
Returns: [int]
the list the indexes, where the configuration was removed

count(self)

source code 
Returns: int
The count of items in the header.

getConfigs(self, index)

source code 
Returns: str
The configurations assigned to the item at the given index