19 #include "mapAlgorithmProfileHelper.h"
27 emit beginResetModel();
41 return m_AlgList.size();
59 if (index.row() < m_AlgList.size())
61 const ::map::deployment::DLLInfo *
info = m_AlgList[index.row()].GetPointer();
63 if (Qt::DisplayRole == role)
65 switch (index.column())
68 result = QVariant(info->getAlgorithmUID().getName().c_str());
71 result = QVariant(info->getAlgorithmUID().getNamespace().c_str());
74 result = QVariant(info->getAlgorithmUID().getVersion().c_str());
77 std::stringstream descriptionString;
78 ::map::algorithm::profile::ValueListType keys =
79 ::map::algorithm::profile::getKeywords(info->getAlgorithmProfileStr());
80 for (::map::algorithm::profile::ValueListType::const_iterator keyPos = keys.begin(); keyPos != keys.end();
83 if (keyPos != keys.begin())
85 descriptionString <<
"; ";
87 descriptionString << *keyPos;
89 descriptionString <<
"</p>";
90 result = QVariant(descriptionString.str().c_str());
94 else if (Qt::UserRole == role)
96 result = QVariant(index.row());
105 Qt::ItemFlags
flags = QAbstractItemModel::flags(index);
112 if ((Qt::DisplayRole == role) && (Qt::Horizontal == orientation))
116 return QVariant(
"Name");
118 else if (section == 1)
120 return QVariant(
"Namespace");
122 else if (section == 2)
124 return QVariant(
"Version");
126 else if (section == 3)
128 return QVariant(
"Keywords");
QmitkAlgorithmListModel(QObject *parent=NULL)
virtual int columnCount(const QModelIndex &parent=QModelIndex()) const
static void info(const char *fmt,...)
virtual Qt::ItemFlags flags(const QModelIndex &index) const
virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const
virtual QVariant data(const QModelIndex &index, int role) const
void SetAlgorithms(::map::deployment::DLLDirectoryBrowser::DLLInfoListType algList)
virtual int rowCount(const QModelIndex &parent=QModelIndex()) const