Make the scroll wheel on the pretty image view scroll through images.

This commit is contained in:
David Sansome 2011-01-02 19:17:03 +00:00
parent d78ad452f2
commit d5321475cd
2 changed files with 6 additions and 0 deletions

View File

@ -159,3 +159,8 @@ void PrettyImageView::resizeEvent(QResizeEvent* e) {
QScrollArea::resizeEvent(e);
ScrollTo(current_index_, false);
}
void PrettyImageView::wheelEvent(QWheelEvent* e) {
const int d = e->delta() > 0 ? 1 : -1;
ScrollTo(current_index_ + d, true);
}

View File

@ -43,6 +43,7 @@ public slots:
protected:
void mouseReleaseEvent(QMouseEvent*);
void resizeEvent(QResizeEvent* e);
void wheelEvent(QWheelEvent* e);
private slots:
void ScrollBarReleased();