| 37 | } |
| 38 | |
| 39 | QVariant ToolPluginModel::data(const QModelIndex &index, int role) const |
| 40 | { |
| 41 | if (!index.isValid()) |
| 42 | return QVariant(); |
| 43 | |
| 44 | const int row = index.row(); |
| 45 | const int column = index.column(); |
| 46 | if (role == Qt::DisplayRole) { |
| 47 | ToolFactory *factory = m_tools[row]; |
| 48 | switch (column) { |
| 49 | case 0: |
| 50 | return factory->id(); |
| 51 | case 1: |
| 52 | return factory->supportedTypesString(); |
| 53 | } |
| 54 | } |
| 55 | return QVariant(); |
| 56 | } |
| 57 | |
| 58 | QVariant ToolPluginModel::headerData(int section, Qt::Orientation orientation, int role) const |
| 59 | { |