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

Method Refetch

Modules/QtWidgets/src/QmitkSliceNavigationWidget.cpp:119–193  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117}
118
119void QmitkSliceNavigationWidget::Refetch()
120{
121 if (!m_InRefetch)
122 {
123 m_InRefetch = true;
124
125 if (m_Stepper->GetSteps() == 0)
126 {
127 m_Controls->m_Slider->setMaximum(0);
128 m_Controls->m_Slider->setValue(0);
129 m_Controls->m_SpinBox->setMaximum(0);
130 m_Controls->m_SpinBox->setValue(0);
131 }
132 else
133 {
134 unsigned int maximumSteps = m_Stepper->GetSteps() - 1;
135 unsigned int currentPosition = m_Stepper->GetPos();
136
137 // set slider value
138 m_Controls->m_Slider->setMaximum(maximumSteps);
139 if (m_InverseDirection)
140 {
141 m_Controls->m_Slider->setValue(maximumSteps - currentPosition);
142 }
143 else
144 {
145 m_Controls->m_Slider->setValue(currentPosition);
146 }
147
148 // set spinbox values
149 m_Controls->m_SpinBox->setMaximum(maximumSteps);
150 if (m_InverseDirection)
151 {
152 m_Controls->m_SpinBox->setValue(maximumSteps - currentPosition);
153 }
154 else
155 {
156 m_Controls->m_SpinBox->setValue(currentPosition);
157 }
158 }
159
160 if (m_Stepper->HasRange() && m_HasLabels)
161 {
162 // Show slider with labels according to settings below
163 m_Controls->m_SliderLabelLeft->setHidden(false);
164 m_Controls->m_SliderLabelRight->setHidden(false);
165
166 if (m_Stepper->HasValidRange())
167 {
168 this->SetLabelValuesValid(true, true);
169 this->SetLabelValues(m_Stepper->GetRangeMin(), m_Stepper->GetRangeMax());
170 }
171 else
172 {
173 this->SetLabelValuesValid(false, false);
174 }
175
176 if (m_Stepper->HasUnitName())

Callers 4

SetInverseDirectionMethod · 0.95
SliderChangedMethod · 0.95
SpinBoxChangedMethod · 0.95
SetStepperMethod · 0.45

Calls 11

SetLabelValuesValidMethod · 0.95
SetLabelValuesMethod · 0.95
SetLabelUnitMethod · 0.95
SetLabelsMethod · 0.95
HasRangeMethod · 0.80
HasValidRangeMethod · 0.80
HasUnitNameMethod · 0.80
GetUnitNameMethod · 0.80
GetPosMethod · 0.45
GetRangeMinMethod · 0.45
GetRangeMaxMethod · 0.45

Tested by

no test coverage detected