MCPcopy Create free account
hub / github.com/ckaiser/Lightscreen / mousePressEvent

Method mousePressEvent

dialogs/previewdialog.cpp:407–429  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

405}
406
407void PreviewDialog::mousePressEvent(QMouseEvent *event)
408{
409 if (!(event->buttons() & Qt::LeftButton))
410 return;
411
412 if ((event->pos() - mDragStartPosition).manhattanLength()
413 < QApplication::startDragDistance())
414 return;
415
416 Screenshot *screenshot = mStack->currentWidget()->property("screenshotObject").value<Screenshot *>();
417
418 if (screenshot) {
419 QFileInfo info(screenshot->unloadedFileName());
420
421 QDrag *drag = new QDrag(this);
422 QMimeData *mimeData = new QMimeData;
423
424 mimeData->setUrls(QList<QUrl>() << QUrl::fromLocalFile(info.absoluteFilePath()));
425 drag->setMimeData(mimeData);
426
427 drag->exec(Qt::CopyAction | Qt::MoveAction);
428 }
429}
430
431void PreviewDialog::mouseMoveEvent(QMouseEvent *event)
432{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected