add:添加历史可以双击选取。
This commit is contained in:
@@ -3,8 +3,7 @@
|
||||
#include "src/ui_uhistory.h"
|
||||
#include "ui_uhistory.h"
|
||||
|
||||
CUIHistory::CUIHistory(QWidget* parent, CHistory* his)
|
||||
: QDialog(parent), ui(new Ui::CUIHistory)
|
||||
CUIHistory::CUIHistory(QWidget* parent, CHistory* his) : QDialog(parent), ui(new Ui::CUIHistory)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
his_ = his;
|
||||
@@ -12,6 +11,7 @@ CUIHistory::CUIHistory(QWidget* parent, CHistory* his)
|
||||
connect(ui->btnExit, &QPushButton::clicked, this, [&]() { close(); });
|
||||
connect(ui->btnOk, &QPushButton::clicked, this, [&]() { select_ok(); });
|
||||
connect(ui->btnDel, &QPushButton::clicked, this, [&]() { del_item(); });
|
||||
connect(ui->listWidget, &QListWidget::doubleClicked, this, [&](const QModelIndex& index) { double_click(index); });
|
||||
}
|
||||
|
||||
CUIHistory::~CUIHistory()
|
||||
@@ -63,3 +63,9 @@ void CUIHistory::del_item()
|
||||
}
|
||||
his_->write_file(vec);
|
||||
}
|
||||
|
||||
void CUIHistory::double_click(const QModelIndex& index)
|
||||
{
|
||||
cur_ = index.data().toString();
|
||||
close();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user