mirror of
https://github.com/YACReader/yacreader
synced 2025-05-25 09:50:33 -04:00
Fix Qt5 compilation
This commit is contained in:
parent
90a370680e
commit
bba15bef4d
@ -25,7 +25,12 @@ void YACReader::MouseHandler::mousePressEvent(QMouseEvent *event)
|
||||
{
|
||||
if (event->button() == Qt::LeftButton) {
|
||||
viewer->drag = true;
|
||||
dragOrigin = dragLatestPosition = event->position();
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
auto position = event->position();
|
||||
#else
|
||||
auto position = QPointF(event->x(), event->y());
|
||||
#endif
|
||||
dragOrigin = dragLatestPosition = position;
|
||||
viewer->setCursor(Qt::ClosedHandCursor);
|
||||
event->accept();
|
||||
return;
|
||||
@ -54,7 +59,11 @@ void YACReader::MouseHandler::mouseReleaseEvent(QMouseEvent *event)
|
||||
event->accept();
|
||||
}
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
auto position = event->position();
|
||||
#else
|
||||
auto position = QPointF(event->x(), event->y());
|
||||
#endif
|
||||
auto dragDistance = QLineF(position, dragOrigin).length();
|
||||
|
||||
auto mouseMode = Configuration::getConfiguration().getMouseMode();
|
||||
@ -101,7 +110,11 @@ void YACReader::MouseHandler::mouseMoveEvent(QMouseEvent *event)
|
||||
viewer->showCursor();
|
||||
viewer->hideCursorTimer->start(2500);
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
auto position = event->position();
|
||||
#else
|
||||
auto position = QPointF(event->x(), event->y());
|
||||
#endif
|
||||
|
||||
if (viewer->magnifyingGlassShown)
|
||||
viewer->mglass->move(static_cast<int>(position.x() - float(viewer->mglass->width()) / 2), static_cast<int>(position.y() - float(viewer->mglass->height()) / 2));
|
||||
|
Loading…
Reference in New Issue
Block a user