Metrics Builder Dialog¶
Wizard for customizing custom activity metrics table.
ActivityMetricsBuilder ¶
Bases: QWizard
, WidgetUi
Wizard for customizing custom activity metrics table.
Source code in src/cplus_plugin/gui/metrics_builder_dialog.py
229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 |
|
activities
property
writable
¶
Gets the activities in the model.
Returns:
Type | Description |
---|---|
All the activities in the model. |
activity_table_model
property
¶
Gets the activity table model used to show the metric for each activity and column.
Returns:
Type | Description |
---|---|
ActivityMetricTableModel
|
The activity table model. |
column_list_model
property
¶
Gets the columns list model used in the wizard.
Returns:
Type | Description |
---|---|
MetricColumnListModel
|
The columns list model used in the model. |
metric_configuration
property
¶
Gets the user configuration for metric column and corresponding cell metric configuration.
Returns:
Type | Description |
---|---|
MetricConfiguration
|
User metric configuration. |
profile_collection
property
writable
¶
Gets the profile collection used in the wizard.
Returns:
Type | Description |
---|---|
MetricProfileCollection
|
The profile collection used in the wizard. |
add_column_item ¶
Adds a metric column item.
If there is a column with a similar name, the item will not be added.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
item |
MetricColumnListItem
|
Metrics column item to be added. |
required |
Source code in src/cplus_plugin/gui/metrics_builder_dialog.py
can_add_new_column ¶
Checks if the maximum limit has been reached.
Returns:
Type | Description |
---|---|
bool
|
True if the limit has not been reached else False if MAX_COLUMNS has been reached. |
Source code in src/cplus_plugin/gui/metrics_builder_dialog.py
check_duplicate_profile_name ¶
Check if a profile name already exists.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
clean_profile_name |
str
|
The cleaned profile name to check |
required |
Returns:
Type | Description |
---|---|
bool
|
True if duplicate exists, False otherwise |
Source code in src/cplus_plugin/gui/metrics_builder_dialog.py
clean_profile_name
staticmethod
¶
Remove special characters from profile name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
profile_name |
str
|
The raw profile name |
required |
Returns:
Type | Description |
---|---|
str
|
Cleaned profile name with special characters removed |
Source code in src/cplus_plugin/gui/metrics_builder_dialog.py
clear_activities ¶
Removes all activities in the activity metrics table.
clear_column_properties ¶
Clear widget values for column properties.
clear_columns ¶
Remove columns from the UI list model.
Source code in src/cplus_plugin/gui/metrics_builder_dialog.py
clear_views ¶
eventFilter ¶
Captures events sent to specific widgets in the wizard.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
observed_object |
QObject
|
Object receiving the event. |
required |
event |
QEvent
|
The specific event being received by the observed object. |
required |
Source code in src/cplus_plugin/gui/metrics_builder_dialog.py
initialize_collection ¶
Creates an initial profile collection. Use this if None is specified.
Source code in src/cplus_plugin/gui/metrics_builder_dialog.py
is_activity_metrics_page_valid ¶
Validates the activity metrics page.
Returns:
Type | Description |
---|---|
bool
|
True if the activity metrics page is valid, else False. |
Source code in src/cplus_plugin/gui/metrics_builder_dialog.py
is_columns_page_valid ¶
Validates the columns page.
Returns:
Type | Description |
---|---|
bool
|
True if the columns page is valid, else False. |
Source code in src/cplus_plugin/gui/metrics_builder_dialog.py
load_column_properties ¶
Load the properties of the column item in the corresponding UI controls.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
column_item |
MetricColumnListItem
|
Column item whose properties are to be loaded. |
required |
Source code in src/cplus_plugin/gui/metrics_builder_dialog.py
load_configuration ¶
Load a metric configuration.
All the columns in the configuration will be loaded, with an attempt to restore the metric configuration of similar activities that existed in the configuration with those currently being configured.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
configuration |
MetricConfiguration
|
Configuration containing mapping of metric columns and cell metrics. |
required |
Source code in src/cplus_plugin/gui/metrics_builder_dialog.py
load_summary_details ¶
Load items summarizing the metric configuration.
Source code in src/cplus_plugin/gui/metrics_builder_dialog.py
on_accepted ¶
Slot raised when the wizard has been accepted by the user.
Used to save any changes for the current metric configuration profile.
on_add_column ¶
Slot raised to add a new column.
Source code in src/cplus_plugin/gui/metrics_builder_dialog.py
on_add_profile ¶
Slot to add a new profile.
Source code in src/cplus_plugin/gui/metrics_builder_dialog.py
on_column_selection_changed ¶
Slot raised when selection in the columns view has changed.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
selected |
QItemSelection
|
Current item selection. |
required |
deselected |
QItemSelection
|
Previously selected items that have been deselected. |
required |
Source code in src/cplus_plugin/gui/metrics_builder_dialog.py
on_copy_profile ¶
Slot to copy the current profile.
Source code in src/cplus_plugin/gui/metrics_builder_dialog.py
on_customize_number ¶
Slot raised to customize number formatting options.
Source code in src/cplus_plugin/gui/metrics_builder_dialog.py
on_delete_profile ¶
Slot to delete the current profile.
Source code in src/cplus_plugin/gui/metrics_builder_dialog.py
on_format_number_checked ¶
Slot raised when the format number checkbox has been checked or unchecked.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
checked |
bool
|
True if checked or False if unchecked. |
required |
Source code in src/cplus_plugin/gui/metrics_builder_dialog.py
on_help_requested ¶
Slot raised when the help button has been clicked.
Opens the online help documentation in the user's browser.
on_move_down_column ¶
Slot raised to move the selected column one level down.
Source code in src/cplus_plugin/gui/metrics_builder_dialog.py
on_move_up_column ¶
Slot raised to move the selected column one level up.
Source code in src/cplus_plugin/gui/metrics_builder_dialog.py
on_page_id_changed ¶
Slot raised when the page ID changes.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
page_id |
int
|
ID of the new page. |
required |
Source code in src/cplus_plugin/gui/metrics_builder_dialog.py
on_profile_changed ¶
Slot raised when the profile has changed.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
index |
int
|
Index of the current profile. |
required |
Source code in src/cplus_plugin/gui/metrics_builder_dialog.py
on_remove_column ¶
Slot raised to remove the selected column.
Source code in src/cplus_plugin/gui/metrics_builder_dialog.py
on_rename_profile ¶
Slot to rename the current profile.
Source code in src/cplus_plugin/gui/metrics_builder_dialog.py
push_activity_metric_message ¶
Push a message to the notification bar in the activity metric wizard page.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message |
str
|
Message to the show in the notification bar. |
required |
level |
MessageLevel
|
Severity of the message. Warning is the default. |
Warning
|
clear_first |
bool
|
Clear any current messages in the notification bar, default is False. |
False
|
Source code in src/cplus_plugin/gui/metrics_builder_dialog.py
push_column_message ¶
Push a message to the notification bar in the columns wizard page.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
message |
str
|
Message to the show in the notification bar. |
required |
level |
MessageLevel
|
Severity of the message. Warning is the default. |
Warning
|
clear_first |
bool
|
Clear any current messages in the notification bar, default is False. |
False
|
Source code in src/cplus_plugin/gui/metrics_builder_dialog.py
remove_column ¶
Remove a metric column with the given name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
Name of the metric column to be removed. |
required |
Source code in src/cplus_plugin/gui/metrics_builder_dialog.py
resize_activity_table_columns ¶
Resize column width of activity metrics table for the entire width to be occupied.
Use a reasonable size if the table has only one column.
Source code in src/cplus_plugin/gui/metrics_builder_dialog.py
save_column_properties ¶
Updates the properties of the metric column based on the values of the UI controls for the current selected column item.
Source code in src/cplus_plugin/gui/metrics_builder_dialog.py
select_column ¶
Select the column item in the specified row.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
row |
int
|
Column item in the specified row number to be selected. |
required |
Source code in src/cplus_plugin/gui/metrics_builder_dialog.py
selected_column_items ¶
Returns the selected column items in the column list view.
Returns:
Type | Description |
---|---|
list
|
A collection of the selected column items. |
Source code in src/cplus_plugin/gui/metrics_builder_dialog.py
set_current_profile ¶
Updates the UI to set the current metric profile.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
profile |
Union[str, MetricConfigurationProfile]
|
Profile or profile ID to be set. It must exist in the profile collection. |
required |
Source code in src/cplus_plugin/gui/metrics_builder_dialog.py
update_current_profile ¶
Saves the current profile to the profile collection.
Source code in src/cplus_plugin/gui/metrics_builder_dialog.py
validateCurrentPage ¶
Validates the current page.
Returns:
Type | Description |
---|---|
bool
|
True if the current page is valid, else False. |
Source code in src/cplus_plugin/gui/metrics_builder_dialog.py
ColumnMetricItemDelegate ¶
Bases: QStyledItemDelegate
Delegate that allows the user to choose the type of metric for a particular activity column.
createEditor ¶
Creates a combobox for choosing the metric type.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
parent |
QWidget
|
Parent widget. |
required |
option |
QStyleOptionViewItem
|
Options for drawing the widget in the view. |
required |
idx |
QModelIndex
|
Location of the request in the data model. |
required |
Returns:
Type | Description |
---|---|
QtWidgets.QLineEdit
|
The editor widget. |
Source code in src/cplus_plugin/gui/metrics_builder_dialog.py
on_metric_type_changed ¶
Slot raised when the metric type has changed.
We use this to load the expression builder if a cell metric is selected.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
index |
int
|
Index of the current selection. |
required |
Source code in src/cplus_plugin/gui/metrics_builder_dialog.py
setEditorData ¶
Sets the data to be displayed and edited by the editor.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
widget |
QWidget
|
Editor widget. |
required |
idx |
QModelIndex
|
Location in the data model. |
required |
Source code in src/cplus_plugin/gui/metrics_builder_dialog.py
setModelData ¶
Gets data from the editor widget and stores it in the specified model at the item index.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
widget |
QWidget
|
Editor widget. |
required |
model |
QAbstractItemModel
|
Model to store the editor data in. |
required |
idx |
QModelIndex
|
Location in the data model. |
required |
Source code in src/cplus_plugin/gui/metrics_builder_dialog.py
updateEditorGeometry ¶
Updates the geometry of the editor for the item with the given index, according to the rectangle specified in the option.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
widget |
QWidget
|
Widget whose geometry will be updated. |
required |
option |
QStyleOptionViewItem
|
Option containing the rectangle for updating the widget. |
required |
idx |
QModelIndex
|
Location of the widget in the data model. |
required |