From 7ad391f932c9ec33cccf49eff8996ccaf2d303d5 Mon Sep 17 00:00:00 2001 From: Arno Date: Thu, 24 Jun 2010 21:26:44 +0200 Subject: Made FilesTreeWidget work It wasn't as easy as I thought. Quite big changes: 1. I changed the query for setIds in FilesTreeModel. Initially it executed a database query for every id. Changed it to WHERE seriespart_id IN (ids). I didn't have a chance to test the first version, but this one is blazing fast. 2. Fixed a recursio ad infinitum in FilesTreeModel. This happens if you call data() from data(). Either use the *item or use a role different from what you've been called. 3. Introduce a new function in SeriesTreeModel: QList childrenColumnList. It returns a QList from the children values of the given column. 4. Lot's of UI changes. Hide unneded columns, align the remaining ones properly. What doesn't work: we can't let the database do the sorting of files. We need a proxy for this. --- archivetreeview.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'archivetreeview.h') diff --git a/archivetreeview.h b/archivetreeview.h index 613bdc6..9958138 100644 --- a/archivetreeview.h +++ b/archivetreeview.h @@ -9,12 +9,14 @@ #define ARCHIVETREEVIEW_H #include -#include +#include class SmUberModel; class SeriesTreeWidget; class FilesTreeWidget; class FilesTreeModel; +class SeriesTreeModel; +class QItemSelection; class ArchiveTreeView : public QWidget { @@ -25,14 +27,17 @@ class ArchiveTreeView : public QWidget FilesTreeWidget *filesWidget() { return mFilesWidget; } private slots: - void currentChanged(); + void currentChanged(const QItemSelection &selected, const QItemSelection &deselected); private: //widgets SeriesTreeWidget *mSeriesWidget; FilesTreeWidget *mFilesWidget; - QList mSelectedPartIds; FilesTreeModel *mFilesModel; + SeriesTreeModel *mSeriesModel; + + //lists + QModelIndexList mSelectedItems; }; #endif -- cgit v1.2.3-70-g09d2