X-Git-Url: http://git.maemo.org/git/?p=family-shop-mgr;a=blobdiff_plain;f=code%2Ffamily-shop-mgr%2FShoppingTreeModel.h;h=55609e3dc71052178a8b0b9a0d370ee25fe8e99c;hp=726e93400a3392e59e5fc5ad57efe093217d79a0;hb=7de11476c900a10373c5f5e1bd9c0f983e5fec0a;hpb=f55462957389d848375fe362136eaa1858b2fe4f diff --git a/code/family-shop-mgr/ShoppingTreeModel.h b/code/family-shop-mgr/ShoppingTreeModel.h index 726e934..55609e3 100644 --- a/code/family-shop-mgr/ShoppingTreeModel.h +++ b/code/family-shop-mgr/ShoppingTreeModel.h @@ -24,11 +24,33 @@ #include #include +#include +#include + +class ShoppingTreeItem; class ShoppingTreeModel : public QAbstractItemModel { public: - ShoppingTreeModel(); + ShoppingTreeModel(const QString &xmlFileName, QObject *parent = 0); + ~ShoppingTreeModel(); + + QVariant data(const QModelIndex &index, int role) const; + QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; + QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const; + QModelIndex parent(const QModelIndex &index) const; + + int rowCount(const QModelIndex &parent = QModelIndex()) const; + int columnCount(const QModelIndex &parent = QModelIndex()) const; + + Qt::ItemFlags flags(const QModelIndex &index) const; + bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole); + bool setHeaderData(int section, Qt::Orientation orientation, const QVariant &value, int role = Qt::EditRole); + + bool insertColumns(int position, int columns, const QModelIndex &parent = QModelIndex()); + bool removeColumns(int position, int columns, const QModelIndex &parent = QModelIndex()); + bool insertRows(int position, int rows, const QModelIndex &parent = QModelIndex()); + bool removeRows(int position, int rows, const QModelIndex &parent = QModelIndex()); private: QDomDocument m_document;