| 405 | } |
| 406 | |
| 407 | void 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 | |
| 431 | void PreviewDialog::mouseMoveEvent(QMouseEvent *event) |
| 432 | { |
nothing calls this directly
no outgoing calls
no test coverage detected