Skip to content

Commit

Permalink
mouse-wheel control for timeline support
Browse files Browse the repository at this point in the history
  • Loading branch information
lheric committed Oct 26, 2013
1 parent bc9c727 commit de2ee1d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/model/common/comrom.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
extern QSettings g_cAppSetting;


#define ANALYZER_VERSION "1.2.0" ///< version number
#define ANALYZER_VERSION "1.3.0" ///< version number


#endif // COMROM_H
15 changes: 15 additions & 0 deletions src/views/timelineview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include "model/common/comsequence.h"
#include "gitlivkcmdevt.h"
#include <QDebug>
#include <QWheelEvent>

TimeLineView::TimeLineView(QWidget *parent) :
QGraphicsView(parent)
Expand Down Expand Up @@ -78,6 +79,20 @@ void TimeLineView::frameBarClicked(int iPoc)
}


void TimeLineView::wheelEvent(QWheelEvent * event)
{
if( event->delta() < 0 ) /// rotated towards user
{
GitlIvkCmdEvt cEvt("next_frame");
cEvt.dispatch();
}
else
{
GitlIvkCmdEvt cEvt("prev_frame");
cEvt.dispatch();
}
}

void TimeLineView::xDrawFrameBars(ComSequence* pcSequence)
{
QRectF cRect(0,0,20,50);
Expand Down
4 changes: 4 additions & 0 deletions src/views/timelineview.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ class TimeLineView : public QGraphicsView, public GitlView
public slots:
void frameBarClicked(int iPoc);


protected:
void wheelEvent(QWheelEvent * event);

private:
void xDrawFrameBars(ComSequence* pcSequence);
void xClearAllDrawing();
Expand Down

0 comments on commit de2ee1d

Please sign in to comment.