| 90 | |
| 91 | int T_TableViewModel::columnCount(const QModelIndex& parent) const |
| 92 | { |
| 93 | if (parent.isValid()) |
| 94 | { |
| 95 | return 0; |
| 96 | } |
| 97 | return _header.count(); |
| 98 | } |
| 99 | |
| 100 | QVariant T_TableViewModel::data(const QModelIndex& index, int role) const |
| 101 | { |
| 102 | if (!index.isValid() || index.row() < 0 || index.row() >= rowCount() || index.column() < 0 || index.column() >= columnCount()) |
| 103 | { |
| 104 | return QVariant(); |
| 105 | } |
| 106 | if ((role == Qt::DisplayRole || role == Qt::ToolTipRole) && index.column() != 0) |
| 107 | { |
| 108 | return _dataList[index.row() % 9][index.column() - 1]; |
| 109 | } |
| 110 | else if (role == Qt::DecorationRole && index.column() == 0) |
| 111 | { |
| 112 | return _iconList[index.row() % 9]; |
| 113 | } |
| 114 | else if (role == Qt::DecorationPropertyRole) |
nothing calls this directly
no outgoing calls
no test coverage detected