Chore: Proper Lambda Formatting (#2167)

Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
Leon Richardt
2020-11-08 12:02:19 +01:00
committed by GitHub
parent fbd5df53d8
commit 0eed45ae67
71 changed files with 712 additions and 415 deletions
+12 -8
View File
@@ -36,8 +36,9 @@ EditableModelView::EditableModelView(QAbstractTableModel *model, bool movable)
// add
QPushButton *add = new QPushButton("Add");
buttons->addWidget(add);
QObject::connect(add, &QPushButton::clicked,
[this] { this->addButtonPressed.invoke(); });
QObject::connect(add, &QPushButton::clicked, [this] {
this->addButtonPressed.invoke();
});
// remove
QPushButton *remove = new QPushButton("Remove");
@@ -61,22 +62,25 @@ EditableModelView::EditableModelView(QAbstractTableModel *model, bool movable)
// move up
QPushButton *moveUp = new QPushButton("Move up");
buttons->addWidget(moveUp);
QObject::connect(moveUp, &QPushButton::clicked, this,
[this] { this->moveRow(-1); });
QObject::connect(moveUp, &QPushButton::clicked, this, [this] {
this->moveRow(-1);
});
// move down
QPushButton *moveDown = new QPushButton("Move down");
buttons->addWidget(moveDown);
QObject::connect(moveDown, &QPushButton::clicked, this,
[this] { this->moveRow(1); });
QObject::connect(moveDown, &QPushButton::clicked, this, [this] {
this->moveRow(1);
});
}
buttons->addStretch();
QObject::connect(this->model_, &QAbstractTableModel::rowsMoved, this,
[this](const QModelIndex &parent, int start, int end,
const QModelIndex &destination,
int row) { this->selectRow(row); });
const QModelIndex &destination, int row) {
this->selectRow(row);
});
// add tableview
vbox->addWidget(this->tableView_);