diff options
author | Arno <am@disconnect.de> | 2010-06-16 22:45:24 +0200 |
---|---|---|
committer | Arno <am@disconnect.de> | 2010-06-16 22:45:24 +0200 |
commit | f5a7d411051d3112a90e26f1e382dc1e00fb9a00 (patch) | |
tree | 568cb272df4a645d5208a2177b2e09647b689be3 /smtreemodel.cpp | |
parent | c7e25a4bb75417f1615b71940694f5f4479f9043 (diff) | |
download | SheMov-f5a7d411051d3112a90e26f1e382dc1e00fb9a00.tar.gz SheMov-f5a7d411051d3112a90e26f1e382dc1e00fb9a00.tar.bz2 SheMov-f5a7d411051d3112a90e26f1e382dc1e00fb9a00.zip |
Treemodel Development
-Changed the database schema. Attached quality to files
-Subclassed SmTreeModel for SeriesTreeModel
-Made SmTreeModel virtual for that
Well, it seems there is a serious problem with the database schema.
Curiously everything inside the model works beside the db update. Seems
I have it wrong with the fks :(
Diffstat (limited to 'smtreemodel.cpp')
-rw-r--r-- | smtreemodel.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/smtreemodel.cpp b/smtreemodel.cpp index c762802..292ed20 100644 --- a/smtreemodel.cpp +++ b/smtreemodel.cpp @@ -118,6 +118,14 @@ bool SmTreeModel::setRoot(SmTreeItem *rootItem){ return false; } +SmTreeItem *SmTreeModel::parentItem(const QModelIndex &child) const{ + QModelIndex parent = child.parent(); + if(parent == QModelIndex()){ + return mRootItem; + } + return static_cast<SmTreeItem*>(child.parent().internalPointer()); +} + bool SmTreeModel::insertRows(int row, int count, const QModelIndex &parent){ SmTreeItem *parentItem = itemAt(parent); bool retval; |