mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2025-07-19 05:24:59 -04:00
feat: Add basic task flow run and edit (#212)
This commit is contained in:
29
TaskFlow/Editor/TaskConnectionsModel.cpp
Normal file
29
TaskFlow/Editor/TaskConnectionsModel.cpp
Normal file
@ -0,0 +1,29 @@
|
||||
#include "TaskConnectionsModel.hpp"
|
||||
|
||||
namespace QodeAssist::TaskFlow {
|
||||
|
||||
TaskConnectionsModel::TaskConnectionsModel(Flow *flow, QObject *parent)
|
||||
: QAbstractListModel(parent)
|
||||
, m_flow(flow)
|
||||
{}
|
||||
|
||||
int TaskConnectionsModel::rowCount(const QModelIndex &parent) const
|
||||
{
|
||||
return m_flow->connections().size();
|
||||
}
|
||||
|
||||
QVariant TaskConnectionsModel::data(const QModelIndex &index, int role) const
|
||||
{
|
||||
if (role == TaskConnectionsRoles::TaskConnectionsRole)
|
||||
return QVariant::fromValue(m_flow->connections().at(index.row()));
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
QHash<int, QByteArray> TaskConnectionsModel::roleNames() const
|
||||
{
|
||||
QHash<int, QByteArray> roles;
|
||||
roles[TaskConnectionsRoles::TaskConnectionsRole] = "connectionData";
|
||||
return roles;
|
||||
}
|
||||
|
||||
} // namespace QodeAssist::TaskFlow
|
Reference in New Issue
Block a user