NPV Priority Weighting Layer Manager Dialog
Dialog for creating a new financial PWL.
DisplayValueFormatterItemDelegate
Bases: QStyledItemDelegate
Delegate for formatting numeric values using thousand comma separator, number of decimal places etc.
displayText
Format the value to incorporate thousand comma separator.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value |
float
|
Value of the display role provided by the model. |
required |
locale |
QLocale
|
Locale for the value in the display role. |
required |
Returns:
Type | Description |
---|---|
str
|
Formatted value of the display role data. |
Source code in src/cplus_plugin/gui/financials/npv_manager_dialog.py
FinancialValueItemDelegate
Bases: DisplayValueFormatterItemDelegate
Delegate for ensuring only numbers are specified in financial value fields.
createEditor
Creates a line edit control whose input value is limited to numbers only.
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/financials/npv_manager_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/financials/npv_manager_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/financials/npv_manager_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 |
Source code in src/cplus_plugin/gui/financials/npv_manager_dialog.py
NpvPwlManagerDialog
Bases: QDialog
, WidgetUi
Dialog for managing NPV priority weighting layers for activities.
Source code in src/cplus_plugin/gui/financials/npv_manager_dialog.py
173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 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 |
|
npv_collection
property
Gets the Activity NPV collection as defined by the user.
Returns:
Type | Description |
---|---|
ActivityNpvCollection
|
The Activity NPV collection containing the NPV parameters for activities. |
compute_npv
Computes the NPV based on the total of the discounted value and sets it in the corresponding text control.
Source code in src/cplus_plugin/gui/financials/npv_manager_dialog.py
copy_npv
enable_npv_parameters_widgets
Enable or disable the UI widgets for specifying NPV parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
enable |
bool
|
True to enable the widgets, else False to disable. |
required |
Source code in src/cplus_plugin/gui/financials/npv_manager_dialog.py
eventFilter
Captures events sent to specific widgets.
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/financials/npv_manager_dialog.py
is_valid
Verifies if the input data is valid.
Returns:
Type | Description |
---|---|
bool
|
True if the user input is invalid, else False. |
Source code in src/cplus_plugin/gui/financials/npv_manager_dialog.py
load_activity_npv
Loads NPV parameters for an activity.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
activity_npv |
ActivityNpv
|
Object containing the NPV parameters for an activity. |
required |
Source code in src/cplus_plugin/gui/financials/npv_manager_dialog.py
on_activity_selection_changed
Slot raised when the selection of activities changes.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
selected |
QItemSelection
|
Selected items. |
required |
deselected |
QItemSelection
|
Deselected items. |
required |
Source code in src/cplus_plugin/gui/financials/npv_manager_dialog.py
on_discount_rate_changed
Slot raised when discount rate has changed.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
discount_rate |
float
|
New discount rate. |
required |
Source code in src/cplus_plugin/gui/financials/npv_manager_dialog.py
on_npv_computation_item_changed
Slot raised when the data of an item has changed.
Use this to compute discounted value as well as the NPV.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
item |
QStandardItem
|
Item whose value has changed. |
required |
Source code in src/cplus_plugin/gui/financials/npv_manager_dialog.py
on_number_years_changed
Slot raised when the number of years change.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
years |
int
|
The number of years. |
required |
Source code in src/cplus_plugin/gui/financials/npv_manager_dialog.py
on_total_npv_value_changed
Slot raised when the total NPV has changed either through automatic computation or manual input.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value |
float
|
NPV value. |
required |
Source code in src/cplus_plugin/gui/financials/npv_manager_dialog.py
on_use_computed_npvs_toggled
Slot raised when the checkbox for using computed min/max NPVs is toggled.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
checked |
bool
|
True to use computed NPVs else False for the user to manually define the min/max values. |
required |
Source code in src/cplus_plugin/gui/financials/npv_manager_dialog.py
on_years_removed
Slot raised when the year rows have been removed.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
index |
QModelIndex
|
Reference item at the given location. |
required |
start |
int
|
Start location of the items that have been removed. |
required |
end |
int
|
End location of the items that have been removed. |
required |
Source code in src/cplus_plugin/gui/financials/npv_manager_dialog.py
open_help
reset_npv_values
Resets the values for computing the NPV.
Source code in src/cplus_plugin/gui/financials/npv_manager_dialog.py
resize_column_widths
Resize column widths of the NPV revenue and cost table based on its current width.
Source code in src/cplus_plugin/gui/financials/npv_manager_dialog.py
selected_activity
Gets the current selected activity.
Returns:
Type | Description |
---|---|
Activity
|
Current selected activity or None if there is no selection. |
Source code in src/cplus_plugin/gui/financials/npv_manager_dialog.py
update_all_discounted_values
Updates all discounted values that had already been computed using the revised discount rate.
Source code in src/cplus_plugin/gui/financials/npv_manager_dialog.py
update_discounted_value
Updated the discounted value for the given row number.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
row |
int
|
Row number to compute the discounted value. |
required |