mirror of
https://github.com/YACReader/yacreader
synced 2025-07-21 06:24:39 -04:00
fixed performDrag in YACReaderTableView for delegating the setup of the mimedata to the model
This commit is contained in:
@ -7,6 +7,7 @@
|
||||
#include <QDrag>
|
||||
#include <QMimeData>
|
||||
#include <QApplication>
|
||||
#include <QBuffer>
|
||||
|
||||
#include "comic_item.h"
|
||||
|
||||
@ -148,12 +149,8 @@ void YACReaderTableView::leaveEvent(QEvent * event)
|
||||
|
||||
void YACReaderTableView::performDrag()
|
||||
{
|
||||
QMimeData *mimeData = new QMimeData;
|
||||
|
||||
mimeData->setText("comic"); //TODO set the right mime data
|
||||
|
||||
QDrag *drag = new QDrag(this);
|
||||
drag->setMimeData(mimeData);
|
||||
drag->setMimeData(model()->mimeData(selectionModel()->selectedRows()));
|
||||
drag->setPixmap(QPixmap(":/images/openInYACReader.png")); //TODO add better image
|
||||
|
||||
Qt::DropAction dropAction = drag->exec(Qt::CopyAction | Qt::MoveAction, Qt::CopyAction);
|
||||
|
Reference in New Issue
Block a user