Adjusted exit action

This commit is contained in:
Jesse Qu 2025-05-29 10:11:03 +08:00
parent 15b1db4bb6
commit 08ece7a7f6
3 changed files with 18 additions and 0 deletions

View File

@ -17,6 +17,9 @@ public:
MainWindow(QWidget *parent = nullptr); MainWindow(QWidget *parent = nullptr);
~MainWindow(); ~MainWindow();
private slots:
void on_actionExit_triggered();
private: private:
Ui::MainWindow *ui; Ui::MainWindow *ui;
}; };

View File

@ -16,3 +16,9 @@ MainWindow::~MainWindow()
{ {
delete ui; delete ui;
} }
void MainWindow::on_actionExit_triggered()
{
close();
}

View File

@ -74,6 +74,9 @@
<property name="text"> <property name="text">
<string>&amp;About</string> <string>&amp;About</string>
</property> </property>
<property name="shortcut">
<string>Ctrl+I</string>
</property>
</action> </action>
<action name="actionExit"> <action name="actionExit">
<property name="icon"> <property name="icon">
@ -82,6 +85,12 @@
<property name="text"> <property name="text">
<string>E&amp;xit</string> <string>E&amp;xit</string>
</property> </property>
<property name="shortcut">
<string>Ctrl+Q</string>
</property>
<property name="menuRole">
<enum>QAction::MenuRole::QuitRole</enum>
</property>
</action> </action>
</widget> </widget>
<resources/> <resources/>