mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-28 05:34:47 +01:00
Compare commits
2 Commits
19dd0786ea
...
1fb7448afd
Author | SHA1 | Date | |
---|---|---|---|
|
1fb7448afd | ||
|
9bb04d7154 |
@ -346,11 +346,7 @@ void GraphView::mouseMoveEvent(QMouseEvent *e)
|
||||
{
|
||||
if (e->buttons() & Qt::MiddleButton) {
|
||||
QScrollBar *sb = horizontalScrollBar();
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
|
||||
int x = e->x();
|
||||
#else // QT 5.15
|
||||
int x = e->position().toPoint().x();
|
||||
#endif // QT 5.15
|
||||
sb->setSliderPosition(sb->sliderPosition() - (x - _xStartDrag));
|
||||
_xStartDrag = x;
|
||||
}
|
||||
@ -360,17 +356,10 @@ void GraphView::mouseMoveEvent(QMouseEvent *e)
|
||||
|
||||
void GraphView::mousePressEvent(QMouseEvent *e)
|
||||
{
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
|
||||
if (e->button() == Qt::LeftButton)
|
||||
newSliderPosition(mapToScene(e->pos()));
|
||||
else if (e->button() == Qt::MiddleButton)
|
||||
_xStartDrag = e->x();
|
||||
#else // QT 5.15
|
||||
if (e->button() == Qt::LeftButton)
|
||||
newSliderPosition(mapToScene(e->position().toPoint()));
|
||||
else if (e->button() == Qt::MiddleButton)
|
||||
_xStartDrag = e->position().toPoint().x();
|
||||
#endif // QT 5.15
|
||||
|
||||
QGraphicsView::mousePressEvent(e);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user