opti:1.设置直接回车搜索。
2.取消询问是否确认复制。 3.取消属性编辑界面回车关闭。
This commit is contained in:
parent
dbd694b94e
commit
c0d2c461a4
@ -2,6 +2,7 @@
|
||||
#include <QClipboard>
|
||||
#include <QSettings>
|
||||
#include <QFile>
|
||||
#include <QKeyEvent>
|
||||
#include "./ui_MainWidget.h"
|
||||
|
||||
constexpr std::size_t g_OnePage = 100;
|
||||
@ -101,6 +102,19 @@ void MainWidget::closeEvent(QCloseEvent* event)
|
||||
QWidget::closeEvent(event);
|
||||
}
|
||||
|
||||
void MainWidget::keyPressEvent(QKeyEvent* event)
|
||||
{
|
||||
switch (event->key())
|
||||
{
|
||||
case Qt::Key_Return:
|
||||
search();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
QWidget::keyPressEvent(event);
|
||||
}
|
||||
|
||||
MainWidget::~MainWidget()
|
||||
{
|
||||
delete attri_edit_;
|
||||
@ -296,9 +310,9 @@ void MainWidget::save()
|
||||
|
||||
void MainWidget::copy_select_line()
|
||||
{
|
||||
if (!CUtil::affirm(this, u8"确认", u8"确认复制吗?")) {
|
||||
return;
|
||||
}
|
||||
// if (!CUtil::affirm(this, u8"确认", u8"确认复制吗?")) {
|
||||
// return;
|
||||
// }
|
||||
|
||||
QTableWidgetItem* cur_item = get_current_select_item();
|
||||
if (cur_item == nullptr) {
|
||||
|
@ -42,6 +42,7 @@ private:
|
||||
|
||||
protected:
|
||||
void closeEvent(QCloseEvent* event);
|
||||
void keyPressEvent(QKeyEvent* event);
|
||||
|
||||
private:
|
||||
Element_t* get_element_bykey(const QString& key);
|
||||
|
@ -41,6 +41,9 @@
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnOk">
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>确认</string>
|
||||
</property>
|
||||
@ -48,6 +51,9 @@
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnCancel">
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>取消</string>
|
||||
</property>
|
||||
|
Loading…
x
Reference in New Issue
Block a user