mirror of
https://github.com/YACReader/yacreader
synced 2025-05-25 18:00:46 -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) {
|
if (event->button() == Qt::LeftButton) {
|
||||||
viewer->drag = true;
|
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);
|
viewer->setCursor(Qt::ClosedHandCursor);
|
||||||
event->accept();
|
event->accept();
|
||||||
return;
|
return;
|
||||||
@ -54,7 +59,11 @@ void YACReader::MouseHandler::mouseReleaseEvent(QMouseEvent *event)
|
|||||||
event->accept();
|
event->accept();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||||
auto position = event->position();
|
auto position = event->position();
|
||||||
|
#else
|
||||||
|
auto position = QPointF(event->x(), event->y());
|
||||||
|
#endif
|
||||||
auto dragDistance = QLineF(position, dragOrigin).length();
|
auto dragDistance = QLineF(position, dragOrigin).length();
|
||||||
|
|
||||||
auto mouseMode = Configuration::getConfiguration().getMouseMode();
|
auto mouseMode = Configuration::getConfiguration().getMouseMode();
|
||||||
@ -101,7 +110,11 @@ void YACReader::MouseHandler::mouseMoveEvent(QMouseEvent *event)
|
|||||||
viewer->showCursor();
|
viewer->showCursor();
|
||||||
viewer->hideCursorTimer->start(2500);
|
viewer->hideCursorTimer->start(2500);
|
||||||
|
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||||
auto position = event->position();
|
auto position = event->position();
|
||||||
|
#else
|
||||||
|
auto position = QPointF(event->x(), event->y());
|
||||||
|
#endif
|
||||||
|
|
||||||
if (viewer->magnifyingGlassShown)
|
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));
|
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