mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2026-06-10 08:19:25 -04:00
34 lines
944 B
C++
34 lines
944 B
C++
// Copyright (C) 2025-2026 Petr Mironychev
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
// Additional attribution terms under GPLv3 §7(b) apply — see LICENSE
|
|
|
|
#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
|