| 43 | } |
| 44 | |
| 45 | void ReferenceRangeDock::setReferenceRanges(QList<ReferenceRange*> list) { |
| 46 | CONDITIONAL_LOCK_RETURN; |
| 47 | m_rangeList = list; |
| 48 | m_range = list.first(); |
| 49 | setAspects(list); |
| 50 | Q_ASSERT(m_range); |
| 51 | |
| 52 | // initialize widgets for common properties |
| 53 | QList<Line*> lines; |
| 54 | QList<Background*> backgrounds; |
| 55 | for (auto* range : m_rangeList) { |
| 56 | lines << range->line(); |
| 57 | backgrounds << range->background(); |
| 58 | } |
| 59 | lineWidget->setLines(lines); |
| 60 | backgroundWidget->setBackgrounds(backgrounds); |
| 61 | |
| 62 | // show the properties of the first reference range |
| 63 | this->load(); |
| 64 | |
| 65 | updatePlotRangeList(); |
| 66 | |
| 67 | // SIGNALs/SLOTs |
| 68 | connect(m_range, &ReferenceRange::orientationChanged, this, &ReferenceRangeDock::rangeOrientationChanged); |
| 69 | connect(m_range, &ReferenceRange::positionLogicalStartChanged, this, &ReferenceRangeDock::rangePositionLogicalStartChanged); |
| 70 | connect(m_range, &ReferenceRange::positionLogicalEndChanged, this, &ReferenceRangeDock::rangePositionLogicalEndChanged); |
| 71 | } |
| 72 | |
| 73 | /* |
| 74 | * updates the locale in the widgets. called when the application settings are changed. |
no test coverage detected