QLabel QPixmap *pixmap() method is deprecated

const QPixmap should perform as fast as a pointer
there is a replacement version for Qt5 but it requires Qt5.15, so we are using indirection witch is unsafer but it should be ok as all the action is happen in the main thread
This commit is contained in:
Luis Ángel San Martín
2021-10-02 08:07:15 +02:00
parent 5fbd100449
commit a7e3c41f34
4 changed files with 25 additions and 20 deletions

View File

@ -978,9 +978,10 @@ void MainWindowViewer::saveImage()
if (!pathFile.isEmpty()) {
QFileInfo fi(pathFile);
currentDirectoryImgDest = fi.absolutePath();
const QPixmap *p = viewer->pixmap();
if (p != nullptr)
p->save(pathFile);
const QPixmap p = viewer->pixmap();
if (!p.isNull()) {
p.save(pathFile);
}
}
}