mirror of
https://github.com/YACReader/yacreader
synced 2025-07-23 15:35:03 -04:00
added custom drag to comic table view, drops are accepted in lists view
This commit is contained in:
@ -186,6 +186,17 @@ QModelIndex ReadingListModel::parent(const QModelIndex &index) const
|
||||
return QModelIndex();
|
||||
}
|
||||
|
||||
bool ReadingListModel::canDropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) const
|
||||
{
|
||||
return data->formats().contains("application/yacreaderlibrary-comics-ids");
|
||||
}
|
||||
|
||||
bool ReadingListModel::dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent)
|
||||
{
|
||||
QLOG_DEBUG() << "drop mimedata into row = " << row << "column column = " << column << "parent" << parent;
|
||||
return true;
|
||||
}
|
||||
|
||||
void ReadingListModel::setupReadingListsData(QString path)
|
||||
{
|
||||
beginResetModel();
|
||||
|
@ -38,6 +38,8 @@ public:
|
||||
QModelIndex index(int row, int column,
|
||||
const QModelIndex &parent = QModelIndex()) const;
|
||||
QModelIndex parent(const QModelIndex &index) const;
|
||||
bool canDropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) const;
|
||||
bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent);
|
||||
|
||||
//Convenience methods
|
||||
void setupReadingListsData(QString path);
|
||||
|
Reference in New Issue
Block a user