| 217 | } |
| 218 | |
| 219 | void QmitkPointListView::wheelEvent(QWheelEvent *event) |
| 220 | { |
| 221 | if (!m_PointListModel || !m_PointListModel->GetPointSet() || |
| 222 | (int)(m_PointListModel->GetPointSet()->GetTimeSteps()) == 1) |
| 223 | return; |
| 224 | |
| 225 | int whe = event->angleDelta().y(); |
| 226 | mitk::PointSet::Pointer ps = dynamic_cast<mitk::PointSet *>(m_PointListModel->GetPointSet()); |
| 227 | unsigned int numberOfTS = ps->GetTimeSteps(); |
| 228 | |
| 229 | if (numberOfTS == 1) |
| 230 | return; |
| 231 | int currentTS = this->m_PointListModel->GetTimeStep(); |
| 232 | if (whe > 0) |
| 233 | { |
| 234 | if ((currentTS + 1 >= (int)numberOfTS)) |
| 235 | return; |
| 236 | |
| 237 | this->m_PointListModel->SetTimeStep(++currentTS); |
| 238 | } |
| 239 | else |
| 240 | { |
| 241 | if ((currentTS <= 0)) |
| 242 | return; |
| 243 | this->m_PointListModel->SetTimeStep(--currentTS); |
| 244 | } |
| 245 | |
| 246 | QString tooltip = QString("Use the F2/F3 keys to move a point up/down, the Del key to remove a point\nand the mouse " |
| 247 | "wheel to change the timestep.\n\nTimeStep:\t%1") |
| 248 | .arg(currentTS); |
| 249 | this->setToolTip(tooltip); |
| 250 | |
| 251 | emit SignalTimeStepChanged(currentTS); |
| 252 | } |
| 253 | |
| 254 | void QmitkPointListView::ctxMenu(const QPoint &pos) |
| 255 | { |
nothing calls this directly
no test coverage detected