feat(editor): added quit button
This commit is contained in:
parent
5bf89b0a2c
commit
4abf480646
2 changed files with 18 additions and 0 deletions
|
@ -14,6 +14,7 @@
|
|||
#include <memory>
|
||||
#include <optional>
|
||||
#include <qglobal.h>
|
||||
#include <qicon.h>
|
||||
#include <qnamespace.h>
|
||||
#include <qwindowdefs.h>
|
||||
#include <sstream>
|
||||
|
@ -47,6 +48,10 @@ MainWindow::MainWindow(QWidget *parent)
|
|||
setCorner(Qt::BottomRightCorner, Qt::RightDockWidgetArea);
|
||||
setCorner(Qt::BottomLeftCorner, Qt::LeftDockWidgetArea);
|
||||
|
||||
connect(ui->actionQuit, &QAction::triggered, [&]() {
|
||||
this->close();
|
||||
});
|
||||
|
||||
// Logger
|
||||
|
||||
Logger::addLogListener(std::bind(&MainWindow::handleLog, this, std::placeholders::_1, std::placeholders::_2));
|
||||
|
|
|
@ -51,6 +51,8 @@
|
|||
<addaction name="actionNew"/>
|
||||
<addaction name="actionOpen"/>
|
||||
<addaction name="actionSave"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionQuit"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuEdit">
|
||||
<property name="title">
|
||||
|
@ -455,6 +457,17 @@
|
|||
<enum>QAction::MenuRole::NoRole</enum>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionQuit">
|
||||
<property name="icon">
|
||||
<iconset theme="application-exit"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Exit Openblocks Editor</string>
|
||||
</property>
|
||||
<property name="menuRole">
|
||||
<enum>QAction::MenuRole::QuitRole</enum>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
|
|
Loading…
Add table
Reference in a new issue