15 using namespace swift::misc::input;
44 if (col == 2) {
return m_actionHotkeys[
index.
row()].getAction(); }
46 else if (role == ActionHotkeyRole)
48 const auto hotkey = m_actionHotkeys[
index.
row()];
62 case 0:
return QStringLiteral(
"Machine");
63 case 1:
return QStringLiteral(
"Combination");
64 case 2:
return QStringLiteral(
"Action");
87 Q_ASSERT(position + rows - 1 < m_actionHotkeys.
size());
89 for (
int row = 0; row < rows; ++row)
91 auto toRemove = m_actionHotkeys[position + row];
92 m_actionHotkeys.
remove(toRemove);
113 m_actionHotkeys.
clear();
bool removeRows(int position, int rows, const QModelIndex &index)
QVariant headerData(int section, Qt::Orientation orientation, int role) const
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const
int rowCount(const QModelIndex &parent=QModelIndex()) const
bool setData(const QModelIndex &index, const QVariant &var, int role)
int columnCount(const QModelIndex &parent=QModelIndex()) const
bool insertRows(int position, int rows, const QModelIndex &index)
Value object encapsulating information identifying a component of a modular distributed swift process...
const QString & getMachineName() const
Machine name.
size_type size() const
Returns number of elements in the sequence.
void push_back(const T &value)
Appends an element at the end of the sequence.
void clear()
Removes all elements in the sequence.
int remove(const T &object)
Remove all elements equal to the given object, if it is contained.
Models to be used with views, mainly QTableView.
Free functions in swift::misc.
void beginInsertRows(const QModelIndex &parent, int first, int last)
void beginRemoveRows(const QModelIndex &parent, int first, int last)
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QList< int > &roles)
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const const override
bool isValid() const const
QVariant fromValue(T &&value)