mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
fix deprecation warnings building pictureflow
This commit is contained in:
parent
e1f6f82d6e
commit
1c0c88a2f9
@ -1369,7 +1369,7 @@ qreal PictureFlow::device_pixel_ratio() const {
|
|||||||
|
|
||||||
void PictureFlow::mouseMoveEvent(QMouseEvent* event)
|
void PictureFlow::mouseMoveEvent(QMouseEvent* event)
|
||||||
{
|
{
|
||||||
int x = (int)(event->x() * device_pixel_ratio());
|
int x = (int)(event->position().x() * device_pixel_ratio());
|
||||||
int distanceMovedSinceLastEvent = x - d->previousPos.x();
|
int distanceMovedSinceLastEvent = x - d->previousPos.x();
|
||||||
|
|
||||||
// Check to see if we need to switch from single press mode to a drag mode
|
// Check to see if we need to switch from single press mode to a drag mode
|
||||||
@ -1468,7 +1468,7 @@ void PictureFlow::mouseReleaseEvent(QMouseEvent* event)
|
|||||||
{
|
{
|
||||||
bool accepted = false;
|
bool accepted = false;
|
||||||
int sideWidth = (d->buffer.width() - slideSize().width()) /2;
|
int sideWidth = (d->buffer.width() - slideSize().width()) /2;
|
||||||
int x = (int)(event->x() * device_pixel_ratio());
|
int x = (int)(event->position().x() * device_pixel_ratio());
|
||||||
|
|
||||||
if (d->singlePress)
|
if (d->singlePress)
|
||||||
{
|
{
|
||||||
@ -1495,7 +1495,7 @@ void PictureFlow::mouseReleaseEvent(QMouseEvent* event)
|
|||||||
void PictureFlow::mouseDoubleClickEvent(QMouseEvent* event) {
|
void PictureFlow::mouseDoubleClickEvent(QMouseEvent* event) {
|
||||||
if (event->button() == Qt::LeftButton && d->activateOnDoubleClick) {
|
if (event->button() == Qt::LeftButton && d->activateOnDoubleClick) {
|
||||||
int sideWidth = (d->buffer.width() - slideSize().width()) /2;
|
int sideWidth = (d->buffer.width() - slideSize().width()) /2;
|
||||||
int x = (int)(event->x() * device_pixel_ratio());
|
int x = (int)(event->position().x() * device_pixel_ratio());
|
||||||
if (sideWidth < x && x < sideWidth + slideSize().width() ) {
|
if (sideWidth < x && x < sideWidth + slideSize().width() ) {
|
||||||
emit itemActivated(d->getTarget());
|
emit itemActivated(d->getTarget());
|
||||||
event->accept();
|
event->accept();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user