00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef QOBJECTTREEMODEL_H
00022 #define QOBJECTTREEMODEL_H
00023
00024 #include <QtCore/QAbstractItemModel>
00025
00026 namespace Gluon
00027 {
00028
00029 namespace Creator
00030 {
00031
00032 class QObjectTreeModel : public QAbstractItemModel
00033 {
00034 public:
00035 explicit QObjectTreeModel( QObject* root, QObject* parent = 0 );
00036 virtual QVariant data( const QModelIndex& index, int role = Qt::DisplayRole ) const;
00037 virtual int columnCount( const QModelIndex& parent = QModelIndex() ) const;
00038 virtual int rowCount( const QModelIndex& parent = QModelIndex() ) const;
00039 virtual QModelIndex parent( const QModelIndex& child ) const;
00040 virtual QModelIndex index( int row, int column, const QModelIndex& parent = QModelIndex() ) const;
00041 virtual QVariant headerData( int section, Qt::Orientation orientation, int role ) const;
00042
00043 protected:
00044 QObject* m_root;
00045 int rowIndex( QObject* object ) const;
00046 };
00047 }
00048 }
00049
00050 #endif // QOBJECTTREEMODEL_H