32 const ParameterRow& row = mRows[
index.
row()];
45 return row.defaultValue;
58 return row.enumValues;
71 const char* horizontalHeader[] = {
"Name",
"Type",
"Size",
"Default",
"Value"};
74 return QString(horizontalHeader[section]);
86 const Parameter& decl = declAndValue.first;
107 std::sort(rows.
begin(), rows.
end(), [](
const ParameterRow& a,
const ParameterRow& b) { return a.name < b.name; });
111 bool sameRows = (gate == mGate && rows.
size() == mRows.
size());
112 for (
int i = 0; sameRows && i < rows.
size(); ++i)
114 sameRows = (rows.
at(i).name == mRows.
at(i).name);
Sets the value of an existing typed parameter on a gate.
const std::unordered_map< std::string, std::pair< Parameter, std::string > > & get_parameters() const
Qt::ItemFlags flags(const QModelIndex &index) const override
int columnCount(const QModelIndex &parent=QModelIndex()) const override
QVariant headerData(int section, Qt::Orientation orientation, int role) const override
void updateData(Gate *gate)
ParameterTableModel(QObject *parent=nullptr)
QVariant data(const QModelIndex &index, int role) const override
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
int rowCount(const QModelIndex &parent=QModelIndex()) const override
The UserActionObject class represents a single object used in UserAction.
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector< int > &roles)
virtual Qt::ItemFlags flags(const QModelIndex &index) const const override
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const const override
QString fromStdString(const std::string &str)
QString number(int n, int base)
QString toString() const const
void append(const T &value)
const T & at(int i) const const
QVector::iterator begin()
bool isEmpty() const const
const std::vector< std::string > & get_enum_values() const
const std::string & get_default_value() const