Commit eb3712e3 authored by Jan Möbius's avatar Jan Möbius
Browse files

Warning fixes (deprecated Pixmap calls)

parent 2e057d5e
......@@ -122,11 +122,23 @@ void ImageDialog::mouseButtonMoveEvent ( QPoint _p) {
// Calculate the free space above and before the real image
// As we are working on the pixmap widget, we need to consider these offsets to calculate
// coordinates inside the real pixmap.
int xoffset = (400 - image->pixmap()->width() ) / 2;
int yoffset = (400 - image->pixmap()->height()) / 2;
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
int xoffset = (400 - image->pixmap()->width() ) / 2;
int yoffset = (400 - image->pixmap()->height()) / 2;
#else
int xoffset = (400 - image->pixmap(Qt::ReturnByValue).width() ) / 2;
int yoffset = (400 - image->pixmap(Qt::ReturnByValue).height()) / 2;
#endif
// Calculate the scaling factor that is used to fit the image to the widget
const double scale = (double)imageWidth_ / (double)image->pixmap()->width();
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
const double scale = (double)imageWidth_ / (double)image->pixmap()->width();
#else
const double scale = (double)imageWidth_ / (double)image->pixmap(Qt::ReturnByValue).width();
#endif
int newXMin = (std::min(dragStartPoint_.x(),_p.x()) - xoffset ) * scale;
int newXMax = (std::max(dragStartPoint_.x(),_p.x()) - xoffset ) * scale;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment