From f5a7d411051d3112a90e26f1e382dc1e00fb9a00 Mon Sep 17 00:00:00 2001 From: Arno Date: Wed, 16 Jun 2010 22:45:24 +0200 Subject: 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 :( --- smtreeitem.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'smtreeitem.h') diff --git a/smtreeitem.h b/smtreeitem.h index 807e3d7..402d73f 100644 --- a/smtreeitem.h +++ b/smtreeitem.h @@ -17,15 +17,17 @@ class SmTreeItem { SmTreeItem(int rows, SmTreeItem *parent = 0); ~SmTreeItem(); void appendChild(SmTreeItem *child); - SmTreeItem *child(int row); + SmTreeItem *child(int row) const; int childCount() const; int columnCount() const; int row() const; SmTreeItem *parent(); + void setParent(SmTreeItem *parent); QVariant data(int column) const; void setData(int column, const QVariant &data); bool insertChild(int where, SmTreeItem *child); - bool removeChild(int where); + bool removeChild(int where, bool deleteChild = true); + private: QList mChildren; -- cgit v1.2.3-70-g09d2