Changeset 769 for trunk/src/gui/widgets/qscrollbar.cpp
- Timestamp:
- Aug 2, 2010, 9:27:30 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.6.3 (added) merged: 768 /branches/vendor/nokia/qt/current merged: 767 /branches/vendor/nokia/qt/4.6.2 removed
- Property svn:mergeinfo changed
-
trunk/src/gui/widgets/qscrollbar.cpp
r651 r769 522 522 d_func()->updateHoverControl(he->pos()); 523 523 break; 524 #ifndef QT_NO_WHEELEVENT 525 case QEvent::Wheel: { 526 // override wheel event without adding virtual function override 527 QWheelEvent *ev = static_cast<QWheelEvent *>(event); 528 int delta = ev->delta(); 529 // scrollbar is a special case - in vertical mode it reaches minimum 530 // value in the upper position, however QSlider's minimum value is on 531 // the bottom. So we need to invert a value, but since the scrollbar is 532 // inverted by default, we need to inverse the delta value for the 533 // horizontal orientation. 534 if (ev->orientation() == Qt::Horizontal) 535 delta = -delta; 536 Q_D(QScrollBar); 537 if (d->scrollByDelta(ev->orientation(), ev->modifiers(), delta)) 538 event->accept(); 539 return true; 540 } 541 #endif 524 542 default: 525 543 break;
Note:
See TracChangeset
for help on using the changeset viewer.