MCPcopy Create free account
hub / github.com/MITK/MITK / SetSyncGroup

Method SetSyncGroup

Modules/QtWidgets/src/QmitkRenderWindowUtilityWidget.cpp:119–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117}
118
119void QmitkRenderWindowUtilityWidget::SetSyncGroup(const GroupSyncIndexType index)
120{
121 if (index < 1)
122 {
123 mitkThrow() << "Invalid synchronization group index '" << index
124 << "'. Group index must be >= 1.";
125 }
126 // Locate the combobox row that carries this group index in its userData.
127 // The group must already be registered with this widget (via a prior
128 // 'OnSyncGroupAdded'); silently de-selecting on a missing index would mask
129 // a contract violation by the caller.
130 const int row = m_SyncGroupSelector->findData(QVariant(index));
131 if (row < 0)
132 {
133 mitkThrow() << "Synchronization group '" << index
134 << "' is not registered with this widget. Ensure the owning "
135 "multi widget has emitted 'SyncGroupAdded(" << index
136 << ")' before calling 'SetSyncGroup'.";
137 }
138 m_SyncGroupSelector->setCurrentIndex(row);
139}
140
141QmitkRenderWindowUtilityWidget::GroupSyncIndexType QmitkRenderWindowUtilityWidget::GetSyncGroup() const
142{

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected