QPixmap use the other overload which returns QPixmap by-value

(cherry picked from commit 65ff17441628e20c4890f806d02f53647b9e1277)
This commit is contained in:
Yuriy Puchkov
2021-02-22 17:38:21 +02:00
committed by borgmanJeremy
parent a5c68a6f5b
commit d3140a9ad6

View File

@@ -116,12 +116,24 @@ void CaptureLauncher::startDrag()
{
QDrag* dragHandler = new QDrag(this);
QMimeData* mimeData = new QMimeData;
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
mimeData->setImageData(m_imageLabel->pixmap(Qt::ReturnByValue));
#else
mimeData->setImageData(m_imageLabel->pixmap());
#endif
dragHandler->setMimeData(mimeData);
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
dragHandler->setPixmap(
m_imageLabel->pixmap(Qt::ReturnByValue)
.scaled(
256, 256, Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation));
dragHandler->exec();
#else
dragHandler->setPixmap(m_imageLabel->pixmap()->scaled(
256, 256, Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation));
dragHandler->exec();
#endif
}
void CaptureLauncher::connectCaptureSlots()