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