add:添加历史可以双击选取。
This commit is contained in:
parent
c2c3f6f2ca
commit
ba08530203
@ -20,7 +20,7 @@ MainWidget::MainWidget(QWidget* parent) : QWidget(parent), ui(new Ui::MainWidget
|
|||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
setWindowTitle(u8"OneLevelXmlOpr v1.3.9");
|
setWindowTitle(u8"OneLevelXmlOpr v1.3.10");
|
||||||
setWindowIcon(QIcon("://resource/xml.ico"));
|
setWindowIcon(QIcon("://resource/xml.ico"));
|
||||||
|
|
||||||
QScreen* primaryScreen = QGuiApplication::primaryScreen();
|
QScreen* primaryScreen = QGuiApplication::primaryScreen();
|
||||||
|
@ -3,8 +3,7 @@
|
|||||||
#include "src/ui_uhistory.h"
|
#include "src/ui_uhistory.h"
|
||||||
#include "ui_uhistory.h"
|
#include "ui_uhistory.h"
|
||||||
|
|
||||||
CUIHistory::CUIHistory(QWidget* parent, CHistory* his)
|
CUIHistory::CUIHistory(QWidget* parent, CHistory* his) : QDialog(parent), ui(new Ui::CUIHistory)
|
||||||
: QDialog(parent), ui(new Ui::CUIHistory)
|
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
his_ = his;
|
his_ = his;
|
||||||
@ -12,6 +11,7 @@ CUIHistory::CUIHistory(QWidget* parent, CHistory* his)
|
|||||||
connect(ui->btnExit, &QPushButton::clicked, this, [&]() { close(); });
|
connect(ui->btnExit, &QPushButton::clicked, this, [&]() { close(); });
|
||||||
connect(ui->btnOk, &QPushButton::clicked, this, [&]() { select_ok(); });
|
connect(ui->btnOk, &QPushButton::clicked, this, [&]() { select_ok(); });
|
||||||
connect(ui->btnDel, &QPushButton::clicked, this, [&]() { del_item(); });
|
connect(ui->btnDel, &QPushButton::clicked, this, [&]() { del_item(); });
|
||||||
|
connect(ui->listWidget, &QListWidget::doubleClicked, this, [&](const QModelIndex& index) { double_click(index); });
|
||||||
}
|
}
|
||||||
|
|
||||||
CUIHistory::~CUIHistory()
|
CUIHistory::~CUIHistory()
|
||||||
@ -63,3 +63,9 @@ void CUIHistory::del_item()
|
|||||||
}
|
}
|
||||||
his_->write_file(vec);
|
his_->write_file(vec);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CUIHistory::double_click(const QModelIndex& index)
|
||||||
|
{
|
||||||
|
cur_ = index.data().toString();
|
||||||
|
close();
|
||||||
|
}
|
||||||
|
@ -21,6 +21,7 @@ private:
|
|||||||
void showEvent(QShowEvent* event);
|
void showEvent(QShowEvent* event);
|
||||||
void select_ok();
|
void select_ok();
|
||||||
void del_item();
|
void del_item();
|
||||||
|
void double_click(const QModelIndex& index);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
QString cur_{};
|
QString cur_{};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user