mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
fixed some potential crashes down the line
This commit is contained in:
parent
9d885d951c
commit
f4a6b769e5
1 changed files with 3 additions and 3 deletions
|
@ -59,18 +59,18 @@ EditableModelView::EditableModelView(QAbstractTableModel *model)
|
||||||
// move up
|
// move up
|
||||||
QPushButton *moveUp = new QPushButton("Move up");
|
QPushButton *moveUp = new QPushButton("Move up");
|
||||||
buttons->addWidget(moveUp);
|
buttons->addWidget(moveUp);
|
||||||
QObject::connect(moveUp, &QPushButton::clicked,
|
QObject::connect(moveUp, &QPushButton::clicked, this,
|
||||||
[this] { this->moveRow(-1); });
|
[this] { this->moveRow(-1); });
|
||||||
|
|
||||||
// move down
|
// move down
|
||||||
QPushButton *moveDown = new QPushButton("Move down");
|
QPushButton *moveDown = new QPushButton("Move down");
|
||||||
buttons->addWidget(moveDown);
|
buttons->addWidget(moveDown);
|
||||||
QObject::connect(moveDown, &QPushButton::clicked,
|
QObject::connect(moveDown, &QPushButton::clicked, this,
|
||||||
[this] { this->moveRow(1); });
|
[this] { this->moveRow(1); });
|
||||||
|
|
||||||
buttons->addStretch();
|
buttons->addStretch();
|
||||||
|
|
||||||
QObject::connect(this->model_, &QAbstractTableModel::rowsMoved,
|
QObject::connect(this->model_, &QAbstractTableModel::rowsMoved, this,
|
||||||
[this](const QModelIndex &parent, int start, int end,
|
[this](const QModelIndex &parent, int start, int end,
|
||||||
const QModelIndex &destination,
|
const QModelIndex &destination,
|
||||||
int row) { this->selectRow(row); });
|
int row) { this->selectRow(row); });
|
||||||
|
|
Loading…
Reference in a new issue