mirror of
https://github.com/x-tools-author/x-tools.git
synced 2025-09-15 15:28:40 +08:00
chore: do something make file menu happy
This commit is contained in:
parent
a02e283699
commit
9f1c512cf8
@ -58,7 +58,7 @@ void xToolsMainWindow::initMenuFile()
|
||||
{
|
||||
QMenuBar* menu_bar = menuBar();
|
||||
m_fileMenu = menu_bar->addMenu(tr("&File"));
|
||||
m_fileMenu->addAction(tr("&Exit"), this, &xToolsMainWindow::close);
|
||||
m_exitAction = m_fileMenu->addAction(tr("&Exit"), this, &xToolsMainWindow::close);
|
||||
}
|
||||
|
||||
void xToolsMainWindow::initMenuOption()
|
||||
|
||||
@ -28,6 +28,8 @@ protected:
|
||||
QMenu* m_languageMenu;
|
||||
QMenu* m_helpMenu;
|
||||
|
||||
QAction* m_exitAction;
|
||||
|
||||
private:
|
||||
QActionGroup* m_appStyleActionGroup;
|
||||
QActionGroup* m_languageActionGroup;
|
||||
|
||||
@ -160,10 +160,10 @@ void MainWindow::initFileMenu()
|
||||
}
|
||||
|
||||
// Other tools
|
||||
#ifdef X_TOOLS_IMPORT_MODULE_MODBUSSTUDIO
|
||||
#ifdef X_TOOLS_IMPORT_MODULE_MODBUS_STUDIO
|
||||
QAction* modbusAction = new QAction("Modbus Studio", this);
|
||||
connect(modbusAction, &QAction::triggered, this, [=]() {
|
||||
SAKModbusUi* w = new SAKModbusUi();
|
||||
xToolsModbusStudioUi* w = new xToolsModbusStudioUi();
|
||||
w->setContentsMargins(9, 9, 9, 9);
|
||||
w->setAttribute(Qt::WA_DeleteOnClose, true);
|
||||
w->resize(1024, 480);
|
||||
@ -171,11 +171,12 @@ void MainWindow::initFileMenu()
|
||||
});
|
||||
windowMenu->addAction(modbusAction);
|
||||
#endif
|
||||
|
||||
#ifndef SAK_RELEASE_FOR_APP_STORE
|
||||
#ifdef X_TOOLS_IMPORT_MODULE_CANBUSSTUDIO
|
||||
#ifdef X_TOOLS_IMPORT_MODULE_CANBUS_STUDIO
|
||||
QAction* canbusAction = new QAction("CANBus Studio", this);
|
||||
connect(canbusAction, &QAction::triggered, this, [=]() {
|
||||
SAKCanBusUi* w = new SAKCanBusUi();
|
||||
xToolsModbusStudioUi* w = new xToolsModbusStudioUi();
|
||||
w->setContentsMargins(9, 9, 9, 9);
|
||||
w->setAttribute(Qt::WA_DeleteOnClose, true);
|
||||
w->resize(1024, 480);
|
||||
@ -195,9 +196,7 @@ void MainWindow::initFileMenu()
|
||||
connect(exportAction, &QAction::triggered, this, &MainWindow::onExportActionTriggered);
|
||||
|
||||
m_fileMenu->addSeparator();
|
||||
QAction* exitAction = new QAction(tr("Exit"), this);
|
||||
m_fileMenu->addAction(exitAction);
|
||||
connect(exitAction, SIGNAL(triggered(bool)), this, SLOT(close()));
|
||||
m_fileMenu->addAction(m_exitAction);
|
||||
}
|
||||
|
||||
void MainWindow::initToolMenu()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user