mirror-chatterino2/src/controllers/accounts/accountmodel.cpp

29 lines
818 B
C++
Raw Normal View History

2018-05-06 12:52:47 +02:00
#include "accountmodel.hpp"
namespace chatterino {
namespace controllers {
namespace accounts {
AccountModel::AccountModel(QObject *parent)
: util::SignalVectorModel<std::shared_ptr<Account>>(1, parent)
{
}
// turn a vector item into a model row
std::shared_ptr<Account> AccountModel::getItemFromRow(std::vector<QStandardItem *> &,
const std::shared_ptr<Account> &original)
2018-05-06 12:52:47 +02:00
{
return original;
2018-05-06 12:52:47 +02:00
}
// turns a row in the model into a vector item
void AccountModel::getRowFromItem(const std::shared_ptr<Account> &item,
std::vector<QStandardItem *> &row)
{
row[0]->setData(item->toString(), Qt::DisplayRole);
}
} // namespace accounts
} // namespace controllers
} // namespace chatterino