Lets the control know about the Options Model (and its signals) */
| 1515 | |
| 1516 | /** Lets the control know about the Options Model (and its signals) */ |
| 1517 | void UnitDisplayStatusBarControl::setOptionsModel(OptionsModel *_optionsModel) |
| 1518 | { |
| 1519 | if (_optionsModel) |
| 1520 | { |
| 1521 | this->optionsModel = _optionsModel; |
| 1522 | |
| 1523 | // be aware of a display unit change reported by the OptionsModel object. |
| 1524 | connect(_optionsModel, &OptionsModel::displayUnitChanged, this, &UnitDisplayStatusBarControl::updateDisplayUnit); |
| 1525 | |
| 1526 | // initialize the display units label with the current value in the model. |
| 1527 | updateDisplayUnit(_optionsModel->getDisplayUnit()); |
| 1528 | } |
| 1529 | } |
| 1530 | |
| 1531 | /** When Display Units are changed on OptionsModel it will refresh the display text of the control on the status bar */ |
| 1532 | void UnitDisplayStatusBarControl::updateDisplayUnit(int newUnits) |
no test coverage detected