Mercurial > projects > qtd
diff demos/interview/model.d @ 197:4536633518e1
build script update
author | eldar |
---|---|
date | Mon, 13 Jul 2009 11:39:10 +0000 |
parents | a1b48a630f73 |
children | cab015969047 |
line wrap: on
line diff
--- a/demos/interview/model.d Mon Jul 13 11:13:47 2009 +0000 +++ b/demos/interview/model.d Mon Jul 13 11:39:10 2009 +0000 @@ -81,7 +81,7 @@ } - QModelIndex index(int row, int column, QModelIndex parent) + QModelIndex index(int row, int column, const QModelIndex parent) { if (row < rc && row >= 0 && column < cc && column >= 0) { Node p = cast(Node) parent.internalPointer(); @@ -92,7 +92,7 @@ return QModelIndex(); } - QModelIndex parent(QModelIndex child) + QModelIndex parent(const QModelIndex child) { if (child.isValid()) { Node n = cast(Node) child.internalPointer(); @@ -103,17 +103,17 @@ return QModelIndex(); } - int rowCount(QModelIndex parent) + int rowCount(const QModelIndex parent) { return (parent.isValid() && parent.column() != 0) ? 0 : rc; } - int columnCount(QModelIndex parent) + int columnCount(const QModelIndex parent) { return cc; } - QVariant data(QModelIndex index, int role) + QVariant data(const QModelIndex index, int role) { if (!index.isValid) return new QVariant; @@ -137,14 +137,14 @@ return QAbstractItemModel.headerData(section, orientation, role); } - bool hasChildren(QModelIndex parent) + bool hasChildren(const QModelIndex parent) { if (parent.isValid && parent.column != 0) return false; return rc > 0 && cc > 0; } - int flags(QModelIndex index) + int flags(const QModelIndex index) { if (!index.isValid) return 0;