Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
+55
@@ -0,0 +1,55 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* HMI Plugin for ParticipantManagement - Party Overview Model
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Patric Karwat, SLSE, 2016-11-11
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <ParticipantManagement/ppm_dtc.h>
|
||||
#include <ParticipantManagement/logger.h>
|
||||
#include <ParticipantManagement/ppm_translation.h>
|
||||
|
||||
#include <LtsWidgets/lts_abstract_table_model.h>
|
||||
|
||||
|
||||
namespace ParticipantManagement
|
||||
{
|
||||
struct PartyData
|
||||
{
|
||||
int id = 0;
|
||||
QString name;
|
||||
PartyData() = default;
|
||||
explicit PartyData(const ParticipantManagement::Party &p)
|
||||
: id(p.id())
|
||||
, name(ParticipantManagement::trPartyName(p.name()))
|
||||
{}
|
||||
};
|
||||
// --------------------------------------------------------
|
||||
// PartyModel
|
||||
// --------------------------------------------------------
|
||||
class PartyModel final : public LtsWidgets::LtsAbstractTableModel<PartyData>
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
enum Columns
|
||||
{
|
||||
Id,
|
||||
Name
|
||||
};
|
||||
|
||||
explicit PartyModel(QObject *parent = nullptr);
|
||||
|
||||
bool initModel(const std::shared_ptr<ParticipantManagement::Interface::Dtc> &dtc);
|
||||
|
||||
QVariant data(const QModelIndex &, int) const override;
|
||||
|
||||
protected:
|
||||
|
||||
std::shared_ptr<ParticipantManagement::Interface::Dtc> m_dtc;
|
||||
LOGGER_T m_logger;
|
||||
};
|
||||
} //namespace ParticipantManagement
|
||||
Reference in new issue
Block a user