Changeset View
Changeset View
Standalone View
Standalone View
src/SpectacleCore.cpp
Show First 20 Lines • Show All 273 Lines • ▼ Show 20 Line(s) | |||||
274 | { | 274 | { | ||
275 | QUrl tempFile = mExportManager->tempSave(); | 275 | QUrl tempFile = mExportManager->tempSave(); | ||
276 | if (!tempFile.isValid()) { | 276 | if (!tempFile.isValid()) { | ||
277 | return; | 277 | return; | ||
278 | } | 278 | } | ||
279 | 279 | | |||
280 | QMimeData *mimeData = new QMimeData; | 280 | QMimeData *mimeData = new QMimeData; | ||
281 | mimeData->setUrls(QList<QUrl> { tempFile }); | 281 | mimeData->setUrls(QList<QUrl> { tempFile }); | ||
282 | mimeData->setImageData(mExportManager->pixmap()); | | |||
283 | mimeData->setData(QStringLiteral("application/x-kde-suggestedfilename"), QFile::encodeName(tempFile.fileName())); | 282 | mimeData->setData(QStringLiteral("application/x-kde-suggestedfilename"), QFile::encodeName(tempFile.fileName())); | ||
284 | 283 | | |||
285 | QDrag *dragHandler = new QDrag(this); | 284 | QDrag *dragHandler = new QDrag(this); | ||
286 | dragHandler->setMimeData(mimeData); | 285 | dragHandler->setMimeData(mimeData); | ||
287 | dragHandler->setPixmap(mExportManager->pixmap().scaled(256, 256, Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation)); | 286 | dragHandler->setPixmap(mExportManager->pixmap().scaled(256, 256, Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation)); | ||
288 | dragHandler->exec(Qt::CopyAction); | 287 | dragHandler->exec(Qt::CopyAction); | ||
289 | } | 288 | } | ||
290 | 289 | | |||
Show All 14 Lines |