fixed some build related problems
[qsqlmon.git] / libqf / libqfgui / gui / widgets / qfprototypedobjecttreemodel / qfprototypedobjecttreemodel.h
blob45302d3ef72d925723fc62a58e70552594e75a77
2 //
3 // Author: Frantisek Vacek <fanda.vacek@volny.cz>, (C) 2010
4 //
5 // Copyright: See COPYING file that comes with this distribution
6 //
8 #ifndef QFPROTOTYPEDOBJECTTREEMODEL_H
9 #define QFPROTOTYPEDOBJECTTREEMODEL_H
11 #include<qfguiglobal.h>
12 #include<qfprototypedobject.h>
14 #include <QStandardItemModel>
16 //! TODO: write class documentation.
17 class QFGUI_DECL_EXPORT QFPrototypedObjectTreeModel : public QStandardItemModel
19 Q_OBJECT;
20 public:
21 class QFGUI_DECL_EXPORT Item : public QStandardItem
23 public:
24 QStringList path;
25 //QVariant value;
26 QVariantMap meta;
27 public:
28 QString valueType() const {return meta.value("type").toString();}
29 //QStringList path() const {return f_path;}
30 //void setPath(const QStringList &p) {f_path = p;}
31 public:
32 virtual ~Item() {}
34 protected:
35 QFPrototypedObject f_rootObject;
36 QStringList f_designPath;
37 protected:
38 void reload_helper(const QStringList &path, QStandardItem *it);
39 public slots:
40 void reload();
41 signals:
42 void propertyChanged(const QStringList &design_path, const QStringList &object_path, const QVariant &value);
43 public:
44 void setRoot(const QFPrototypedObject &o);
45 QVariant itemValue(const QModelIndex &ix, int *status = NULL) const;
46 Item* itemFromIndex(const QModelIndex &ix) const;
47 public:
48 virtual int columnCount(const QModelIndex &parent_ix = QModelIndex()) const;
49 virtual QModelIndex index( int row, int column, const QModelIndex & parent = QModelIndex() ) const;
50 virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
51 virtual QVariant data(const QModelIndex &ix, int role = Qt::DisplayRole) const;
52 virtual bool setData(const QModelIndex &index, const QVariant &val, int role = Qt::EditRole);
53 virtual Qt::ItemFlags flags(const QModelIndex &ix) const;
54 public:
55 QFPrototypedObjectTreeModel(QObject *parent = NULL);
56 virtual ~QFPrototypedObjectTreeModel();
59 #endif // QFPROTOTYPEDOBJECTTREEMODEL_H