mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
Add accelerators to EditableModelView
This commit is contained in:
parent
6e104bde7e
commit
9a8e943e70
|
@ -41,14 +41,14 @@ EditableModelView::EditableModelView(QAbstractTableModel *model, bool movable)
|
||||||
vbox->addLayout(buttons);
|
vbox->addLayout(buttons);
|
||||||
|
|
||||||
// add
|
// add
|
||||||
QPushButton *add = new QPushButton("Add");
|
QPushButton *add = new QPushButton("&Add");
|
||||||
buttons->addWidget(add);
|
buttons->addWidget(add);
|
||||||
QObject::connect(add, &QPushButton::clicked, [this] {
|
QObject::connect(add, &QPushButton::clicked, [this] {
|
||||||
this->addButtonPressed.invoke();
|
this->addButtonPressed.invoke();
|
||||||
});
|
});
|
||||||
|
|
||||||
// remove
|
// remove
|
||||||
QPushButton *remove = new QPushButton("Remove");
|
QPushButton *remove = new QPushButton("&Remove");
|
||||||
buttons->addWidget(remove);
|
buttons->addWidget(remove);
|
||||||
QObject::connect(remove, &QPushButton::clicked, [this] {
|
QObject::connect(remove, &QPushButton::clicked, [this] {
|
||||||
auto selected = this->getTableView()->selectionModel()->selectedRows(0);
|
auto selected = this->getTableView()->selectionModel()->selectedRows(0);
|
||||||
|
@ -71,14 +71,14 @@ EditableModelView::EditableModelView(QAbstractTableModel *model, bool movable)
|
||||||
if (movable)
|
if (movable)
|
||||||
{
|
{
|
||||||
// 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, this, [this] {
|
QObject::connect(moveUp, &QPushButton::clicked, this, [this] {
|
||||||
this->moveRow(-1);
|
this->moveRow(-1);
|
||||||
});
|
});
|
||||||
|
|
||||||
// move down
|
// move down
|
||||||
QPushButton *moveDown = new QPushButton("Move down");
|
QPushButton *moveDown = new QPushButton("M&ove down");
|
||||||
buttons->addWidget(moveDown);
|
buttons->addWidget(moveDown);
|
||||||
QObject::connect(moveDown, &QPushButton::clicked, this, [this] {
|
QObject::connect(moveDown, &QPushButton::clicked, this, [this] {
|
||||||
this->moveRow(1);
|
this->moveRow(1);
|
||||||
|
|
Loading…
Reference in a new issue