Product Documentation
Cadence User Interface SKILL Reference
Product Version IC23.1, September 2023

nrGetSelectedIndexes

nrGetSelectedIndexes(
t_widget
)
=> l_indices / nil

Description

Returns a list comprising the selected indexes of lists or tree widgets.

The compact list representation is created when you select a range of items in a list or a tree widget, or is returned when you query the value property of a widget in the following way:

form->tree->value

This function can be used to obtain the expanded list.

This function applies only to Cadence widgets created in Qt with the native replay layer. Using this function with other widget types, such as widgets created using HI SKILL functions will, result in an error.

Arguments

o_widget

Name of the widget for which the expanded selection is required.

Values Returned

l_indices

List describing each selected index in the specified list or tree widget.

nil

The operation failed.

Examples

Selects an adjacent range of items (Item_1 to Item_5) in a tree widget:

range = form->treeWidget->value
> (("Item_1" "Item_5"))

The variable range stores only the selected items from the extended range, instead of returning one item for each selected index.

Retrieve the extended list of selected indexes directly from the widget.

nrGetSelectedIndexes( form->treeWidget )

Returns the following list of expanded indexes:

(("Item_1" 0) 
 ("Item_2" 0) 
 ("Item_3" 0) 
 ("Item_4" 0) 
 ("Item_5" 0)
)

Each element in the list is itself a list representing a single selected index in a list or a tree widget, comprising an identifier for the row (usually the text in the first column), and the column number.

Most item views that select the full row (all columns) use 0 as the column number

Item views that feature more granular selection, allowing individual row/column combinations, use a non-zero column number.

Related Topics

QtReplay Functions


Return to top
 ⠀
X