37
39
int rowCount(const QModelIndex& parent = QModelIndex()) const;
38
40
int columnCount (const QModelIndex& parent = QModelIndex()) const;
39
41
QVariant data(const QModelIndex& index, int role) const;
42
bool setData ( const QModelIndex & index, const QVariant & value, int role = Qt::EditRole );
40
43
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
41
44
QModelIndex index(int row, int column, const QModelIndex & parent = QModelIndex() ) const;
42
45
QModelIndex parent(const QModelIndex& index) const;
43
46
Qt::ItemFlags flags(const QModelIndex& index) const;
49
QString indexToOptionName(QModelIndex idx) const;
46
52
void setFlat(bool);
49
enum Section { Name = 0, Type = 1, Value = 2, Comment = 3};
55
enum Section { Name = 0, Type = 1, Value = 2, Comment = 3, SectionBound=4};
56
QString getParentName(const QString &option) const;
57
QModelIndex index(const QString &option, Section sec=Name) const;
58
int nameToIndex(QString name) const;
59
bool internalNode(QString name) const;
63
void optionChanged(const QString& option);
64
void optionAboutToBeInserted(const QString& option);
65
void optionInserted(const QString& option);
66
void optionAboutToBeRemoved(const QString& option);
67
void optionRemoved(const QString& option);
52
71
OptionsTree* tree_;
73
mutable QHash<int, QString> indexMap;
74
mutable QHash<QString, int> nameMap;
76
QStack<bool> realRemove;