Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
@@ -0,0 +1,56 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* HMI Plugin for ExerciseManangement - Exercise Overview Dialog Model
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2016-02-29
|
||||
*/
|
||||
|
||||
#include "dev_debug_flags_dialog_model.h"
|
||||
|
||||
#include <LtsSession/lts_session_data.h>
|
||||
|
||||
namespace DeveloperTools
|
||||
{
|
||||
DebugFlagsDialogModel::DebugFlagsDialogModel(QObject *parent)
|
||||
: LtsWidgets::LtsAbstractTableModel<DebugFlag>({tr("Name"),
|
||||
tr("Value")}
|
||||
, parent)
|
||||
{
|
||||
refresh();
|
||||
}
|
||||
|
||||
|
||||
void DebugFlagsDialogModel::refresh()
|
||||
{
|
||||
m_vecData.clear();
|
||||
|
||||
LtsSessionData::LtsSessionData *sessionData = LtsSessionData::LtsSessionData::getInstance();
|
||||
const QMap<QString, QVariant> &debugFlags = sessionData->debugFlags();
|
||||
|
||||
for (auto i = debugFlags.constBegin(); i != debugFlags.constEnd(); ++i)
|
||||
m_vecData.append({ i.key(), i.value() });
|
||||
|
||||
emit dataChanged(QModelIndex(), QModelIndex());
|
||||
}
|
||||
|
||||
|
||||
QVariant DebugFlagsDialogModel::data(const QModelIndex &index, int role) const
|
||||
{
|
||||
if (role != Qt::DisplayRole || !indexIsValid(index))
|
||||
return QVariant();
|
||||
|
||||
const DebugFlag &df = m_vecData.at(index.row());
|
||||
|
||||
switch (index.column())
|
||||
{
|
||||
case DebugFlagsDialogModel::Columns::Name:
|
||||
return df.name;
|
||||
case DebugFlagsDialogModel::Columns::Value:
|
||||
return df.value;
|
||||
}
|
||||
|
||||
return QVariant();
|
||||
}
|
||||
} // namespace DeveloperTools
|
||||
Reference in new issue
Block a user