summaryrefslogtreecommitdiffstats
path: root/filestreewidget.cpp
diff options
context:
space:
mode:
authorArno <am@disconnect.de>2010-06-24 21:26:44 +0200
committerArno <am@disconnect.de>2010-06-24 21:26:44 +0200
commit7ad391f932c9ec33cccf49eff8996ccaf2d303d5 (patch)
tree0d6afdf4c4d69505a122c842424f9f9def7a7a8c /filestreewidget.cpp
parent32243b83a02e479e772d7d6fd94ddc35fd7d6880 (diff)
downloadSheMov-7ad391f932c9ec33cccf49eff8996ccaf2d303d5.tar.gz
SheMov-7ad391f932c9ec33cccf49eff8996ccaf2d303d5.tar.bz2
SheMov-7ad391f932c9ec33cccf49eff8996ccaf2d303d5.zip
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<QVariant> 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.
Diffstat (limited to 'filestreewidget.cpp')
-rw-r--r--filestreewidget.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/filestreewidget.cpp b/filestreewidget.cpp
index 5b1211d..e8afe7c 100644
--- a/filestreewidget.cpp
+++ b/filestreewidget.cpp
@@ -5,14 +5,22 @@
2 of the License, or (at your option) any later version.
*/
+#include <QHBoxLayout>
+
#include "filestreewidget.h"
#include "smmodelsingleton.h"
#include "filestreemodel.h"
FilesTreeWidget::FilesTreeWidget(QWidget *parent) : QWidget(parent){
+ //the view
mView = new FilesTreeView;
mModel = static_cast<FilesTreeModel*>(SmModelSingleton::instance()->model("FilesModel"));
mView->setModel(mModel);
+
+ //layout
+ QHBoxLayout *mainLayout = new QHBoxLayout;
+ mainLayout->addWidget(mView);
+ setLayout(mainLayout);
}
FilesTreeView::FilesTreeView(QWidget *parent) : QTreeView(parent) {}