diff options
author | Arno <am@disconnect.de> | 2014-04-10 16:14:32 +0200 |
---|---|---|
committer | Arno <am@disconnect.de> | 2014-04-10 16:14:32 +0200 |
commit | b0d671fede5adfadad2b465fb4c8ae50b40516f3 (patch) | |
tree | 0215645b3be6eea7dd11c72c987222eddc0a0faa /archivemodel.h | |
parent | 9f314ad26720a925e8e7a7f1a9f61330f3fd29c1 (diff) | |
download | SheMov-b0d671fede5adfadad2b465fb4c8ae50b40516f3.tar.gz SheMov-b0d671fede5adfadad2b465fb4c8ae50b40516f3.tar.bz2 SheMov-b0d671fede5adfadad2b465fb4c8ae50b40516f3.zip |
Implement Drag and Drop in Movie Archive
Well, this was actually a bit of a drag. You have read the docs very
carefully to get it right. For one, don't construct the drag object in
mousePressEvent if you also want a double click, otherwise you end up
with very weird behavior.
Same goes for the receiving end. Differentiate between dragEnterEvent
and dragMoveEvent, otherwise you'll only be able to drop items if you
hit the right row on entering.
There are some artefacts during the drag, but I guess that's a Qt bug.
Didn't bother to look into it.
Diffstat (limited to 'archivemodel.h')
-rw-r--r-- | archivemodel.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/archivemodel.h b/archivemodel.h index a9a11eb..20f878c 100644 --- a/archivemodel.h +++ b/archivemodel.h @@ -31,6 +31,8 @@ class ArchiveModel : public SmTreeModel { enum NodeType { SeriesNode = 1, SeriesPartNode = 2, GenreNode = 4, ActorNode = 8, AllNodes = 15 }; explicit ArchiveModel(const QStringList &headers, QObject *parent = 0); virtual ~ArchiveModel(); + virtual Qt::ItemFlags flags(const QModelIndex &index) const; + virtual Qt::DropActions supportedDragActions() const; const QStringList availableOrders() const; const QHash<QString, int> availableOrdersHash() const { return mAvailableOrders; } virtual QVariant data(const QModelIndex &index, int role) const; @@ -103,6 +105,7 @@ class ArchiveFilesModel : public SmTreeModel { bool isMovie(const QModelIndex &idx) const; void populate(const QSet<int> &seriesPartIds); QStringList filesForSeriespart(int seriesPartId) const; + void updateSeriesPartForFile(const QString &md5sum, int newSeriesPart); public slots: void refresh(); |