! \reimp */
| 541 | \reimp |
| 542 | */ |
| 543 | void QxtSpanSlider::keyPressEvent(QKeyEvent* event) { |
| 544 | QSlider::keyPressEvent(event); |
| 545 | |
| 546 | bool main = true; |
| 547 | SliderAction action = SliderNoAction; |
| 548 | switch (event->key()) { |
| 549 | case Qt::Key_Left: |
| 550 | main = (orientation() == Qt::Horizontal); |
| 551 | action = !invertedAppearance() ? SliderSingleStepSub : SliderSingleStepAdd; |
| 552 | break; |
| 553 | case Qt::Key_Right: |
| 554 | main = (orientation() == Qt::Horizontal); |
| 555 | action = !invertedAppearance() ? SliderSingleStepAdd : SliderSingleStepSub; |
| 556 | break; |
| 557 | case Qt::Key_Up: |
| 558 | main = (orientation() == Qt::Vertical); |
| 559 | action = invertedControls() ? SliderSingleStepSub : SliderSingleStepAdd; |
| 560 | break; |
| 561 | case Qt::Key_Down: |
| 562 | main = (orientation() == Qt::Vertical); |
| 563 | action = invertedControls() ? SliderSingleStepAdd : SliderSingleStepSub; |
| 564 | break; |
| 565 | case Qt::Key_Home: |
| 566 | main = (qxt_d().mainControl == QxtSpanSlider::LowerHandle); |
| 567 | action = SliderToMinimum; |
| 568 | break; |
| 569 | case Qt::Key_End: |
| 570 | main = (qxt_d().mainControl == QxtSpanSlider::UpperHandle); |
| 571 | action = SliderToMaximum; |
| 572 | break; |
| 573 | default: |
| 574 | event->ignore(); |
| 575 | break; |
| 576 | } |
| 577 | |
| 578 | if (action) |
| 579 | qxt_d().triggerAction(action, main); |
| 580 | } |
| 581 | |
| 582 | /*! |
| 583 | \reimp |
nothing calls this directly
no test coverage detected