reading sublists are now sortable using Drag&Drop

This commit is contained in:
Luis Ángel San Martín
2015-01-18 20:36:19 +01:00
parent e0b6581003
commit 400acb077e
10 changed files with 182 additions and 20 deletions

View File

@ -40,6 +40,7 @@ public:
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);
QMimeData *mimeData(const QModelIndexList &indexes) const;
//Convenience methods
void setupReadingListsData(QString path);
@ -86,12 +87,15 @@ private:
void setupLabels(QSqlDatabase &db);
void setupReadingLists(QSqlDatabase &db);
int addLabelIntoList(LabelItem *item);
void reorderingChildren(QList<ReadingListItem *> children);
bool rowIsSpecialList(int row, const QModelIndex & parent = QModelIndex()) const;
bool rowIsLabel(int row, const QModelIndex & parent = QModelIndex()) const;
bool rowIsReadingList(int row, const QModelIndex & parent = QModelIndex()) const;
bool rowIsSeparator(int row, const QModelIndex & parent = QModelIndex()) const;
bool dropComics(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent);
bool dropSublist(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent);
//Special lists
QList<SpecialListItem *> specialLists;