8#ifndef _KO_GENERIC_REGISTRY_MODEL_H_
9#define _KO_GENERIC_REGISTRY_MODEL_H_
11#include <QAbstractListModel>
34 int rowCount(
const QModelIndex &parent = QModelIndex())
const override;
40 QVariant
data(
const QModelIndex &index,
int role = Qt::DisplayRole)
const override;
45 T
get(
const QModelIndex &index)
const;
66 return m_registry->keys().size();
72 if (!index.isValid()) {
75 if (role == Qt::DisplayRole || role == Qt::EditRole) {
76 return QVariant(
get(index)->name());
84 return m_registry->get(m_registry->keys()[index.row()]);
VertexDescriptor get(PredecessorMap const &m, VertexDescriptor v)
T get(const QModelIndex &index) const
KoGenericRegistry< T > * m_registry
int rowCount(const QModelIndex &parent=QModelIndex()) const override
KoGenericRegistryModel(KoGenericRegistry< T > *registry)
~KoGenericRegistryModel() override
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override