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

nrGetIndexesFromSelection

nrGetIndexesFromSelection(
t_widget
l_selection
)
=> l_indices / nil

Description

Expands the specified compact list representing a selection of items from other lists or tree widgets into the corresponding expanded list representation detailing each selected item.

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 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.

l_selection

Compact list representing a selection of other lists or tree widgets.

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.

If the range is stored in a variable, the indexes in that range can be queried in the following way:

nrGetIndexesFromSelection( form->treeWidget range)

The names of both the widget and the range are required. The widget is required to expand the compact list to a full list of indexes. The current selection in the widget does not impact the current selection or the return value from this function.

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