17 #include <QMouseEvent>
23 :
QToolButton(parent), m_isLocked(false), m_movement(0.0) {
24 setFocusPolicy(Qt::WheelFocus);
25 setCursor(Qt::SplitVCursor);
30 if (e->button() != Qt::LeftButton)
return;
32 grabMouse(Qt::BlankCursor);
38 if (e->button() != Qt::LeftButton)
return;
48 QPoint center(mapToGlobal(QPoint(width() / 2, height() / 2)));
51 #if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
52 int vchange = (e->globalY() - center.y());
54 int vchange = (e->globalPosition().toPoint().y() - center.y());
72 QCursor::setPos(center);
75 QToolButton::mouseMoveEvent(e);