1 #ifndef SERVERTREEMODEL_H
2 #define SERVERTREEMODEL_H
4 /********************************************************************
5 created: 2005/01/02 14:27
6 filename: ServerTreeModel.h
7 author: Fanda Vacek (fanda.vacek@volny.cz)
8 *********************************************************************/
10 #include <qfexception.h>
11 #include <qfobjectitemmodel.h>
12 #include <qfxmlconfigdocument.h>
16 //=============================================
18 //=============================================
20 * Data model for QObject tree and QTreeView.
22 class ServerTreeModel
: public QFObjectItemModel
26 QFXmlConfigElement servers
;
29 Sets model contens to XML file.
30 @return false if error occures
32 //bool setContent(QFile &f) throw(exception);
34 // tyhle musim implementovat pro ReadOnly
36 QModelIndex index(int row, int column, const QModelIndex &parent) const;
37 QModelIndex parent ( const QModelIndex & index ) const;
38 int rowCount( const QModelIndex & parent = QModelIndex() ) const;
39 bool hasChildren ( const QModelIndex & parent = QModelIndex() ) const;
41 int columnCount ( const QModelIndex
& parent
= QModelIndex() ) const;
42 QVariant
data ( const QModelIndex
& index
, int role
= Qt::DisplayRole
) const;
43 QVariant
headerData ( int section
, Qt::Orientation o
, int role
= Qt::DisplayRole
) const;
46 void load(const QFXmlConfigElement
& el
) throw(QFException
);
48 ServerTreeModel(QObject
*parent
= NULL
) : QFObjectItemModel(parent
) { }
50 //qDebug("~ServerTreeModel() - indexedNodes.count(): %i", indexedNodes.count());
53 //=============================================