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