| 164 | } |
| 165 | |
| 166 | QVariant Shape::data(const QModelIndex& index, int role) const |
| 167 | { |
| 168 | switch (FileTree::Column(index.column())) { |
| 169 | case FileTree::Column::NameColorVisible: |
| 170 | switch (role) { |
| 171 | case Qt::DisplayRole: |
| 172 | return QString("%1 (%2)").arg(name()).arg(m_giId); |
| 173 | case Qt::CheckStateRole: |
| 174 | return isVisible() ? Qt::Checked : Qt::Unchecked; |
| 175 | case Qt::DecorationRole: |
| 176 | return icon(); |
| 177 | case FileTree::Id: |
| 178 | return m_giId; |
| 179 | case FileTree::Select: |
| 180 | return isSelected(); |
| 181 | default: |
| 182 | return QVariant(); |
| 183 | } |
| 184 | default: |
| 185 | return QVariant(); |
| 186 | } |
| 187 | } |
| 188 | |
| 189 | Qt::ItemFlags Shape::flags(const QModelIndex& index) const |
| 190 | { |