mirror of
https://github.com/x-tools-author/x-tools.git
synced 2025-09-15 15:28:40 +08:00
chore: update files of project
This commit is contained in:
parent
cf2bd6283d
commit
ca3111248a
@ -6,7 +6,7 @@
|
||||
* QtSwissArmyKnife is licensed according to the terms in the file LICENCE in the root of the source
|
||||
* code directory.
|
||||
**************************************************************************************************/
|
||||
#include "sakapplication.h"
|
||||
#include "application.h"
|
||||
|
||||
#include <QFile>
|
||||
#include <QPushButton>
|
||||
@ -17,15 +17,15 @@
|
||||
#include <QTranslator>
|
||||
|
||||
#include "sakdatastructure.h"
|
||||
#include "sakmainwindow.h"
|
||||
#include "mainwindow.h"
|
||||
#include "saksettings.h"
|
||||
#include "saktranslator.h"
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
#include "saksystemtrayicon.h"
|
||||
#include "systemtrayicon.h"
|
||||
#endif
|
||||
|
||||
SAKApplication::SAKApplication(int argc, char** argv)
|
||||
Application::Application(int argc, char** argv)
|
||||
: QApplication(argc, argv)
|
||||
{
|
||||
// It can avoid app crash in this way to show a splashScreen. If you create a QSplashScreen and
|
||||
@ -57,22 +57,22 @@ SAKApplication::SAKApplication(int argc, char** argv)
|
||||
QString language = SAKSettings::instance()->language();
|
||||
SAKTranslator::instance()->setupLanguage(language);
|
||||
showSplashScreenMessage(tr("Initializing main window..."));
|
||||
|
||||
auto mainWindow = new SAKMainWindow();
|
||||
|
||||
auto mainWindow = new MainWindow();
|
||||
m_splashScreen->finish(mainWindow);
|
||||
QObject::connect(this,
|
||||
&SAKApplication::activeMainWindow,
|
||||
&Application::activeMainWindow,
|
||||
mainWindow,
|
||||
&SAKMainWindow::activateWindow);
|
||||
&MainWindow::activateWindow);
|
||||
mainWindow->show();
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
// Setup system tray icon.
|
||||
auto systemTrayIcon = new SAKSystemTrayIcon(this);
|
||||
QObject::connect(systemTrayIcon, &SAKSystemTrayIcon::invokeExit, this, [=]() {
|
||||
auto systemTrayIcon = new SystemTrayIcon(this);
|
||||
QObject::connect(systemTrayIcon, &SystemTrayIcon::invokeExit, this, [=]() {
|
||||
mainWindow->close();
|
||||
});
|
||||
QObject::connect(systemTrayIcon, &SAKSystemTrayIcon::invokeShowMainWindow, this, [=]() {
|
||||
QObject::connect(systemTrayIcon, &SystemTrayIcon::invokeShowMainWindow, this, [=]() {
|
||||
mainWindow->show();
|
||||
});
|
||||
systemTrayIcon->show();
|
||||
@ -100,12 +100,12 @@ SAKApplication::SAKApplication(int argc, char** argv)
|
||||
qInfo() << qPrintable(msg);
|
||||
}
|
||||
|
||||
void SAKApplication::showSplashScreenMessage(const QString &msg)
|
||||
void Application::showSplashScreenMessage(const QString &msg)
|
||||
{
|
||||
m_splashScreen->showMessage(msg, Qt::AlignBottom, QColor(255, 255, 255));
|
||||
}
|
||||
|
||||
void SAKApplication::setupPalette(const QString& fileName)
|
||||
void Application::setupPalette(const QString& fileName)
|
||||
{
|
||||
QFile file(fileName);
|
||||
if (file.open(QFile::ReadOnly)) {
|
||||
|
||||
@ -1,23 +1,23 @@
|
||||
/***************************************************************************************************
|
||||
* Copyright 2018-2023 Qsaker(qsaker@foxmail.com). All rights reserved.
|
||||
* Copyright 2018-2024 Qsaker(qsaker@foxmail.com). All rights reserved.
|
||||
*
|
||||
* The file is encoded using "utf8 with bom", it is a part of QtSwissArmyKnife project.
|
||||
*
|
||||
* QtSwissArmyKnife is licensed according to the terms in the file LICENCE in the root of the source
|
||||
* code directory.
|
||||
**************************************************************************************************/
|
||||
#ifndef SAKAPPLICATION_H
|
||||
#define SAKAPPLICATION_H
|
||||
#ifndef APPLICATION_H
|
||||
#define APPLICATION_H
|
||||
|
||||
#include <QApplication>
|
||||
#include <QSplashScreen>
|
||||
|
||||
class SAKApplication : public QApplication
|
||||
class Application : public QApplication
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit SAKApplication(int argc, char **argv);
|
||||
~SAKApplication() override = default;
|
||||
explicit Application(int argc, char **argv);
|
||||
~Application() override = default;
|
||||
|
||||
void showSplashScreenMessage(const QString &msg);
|
||||
|
||||
|
||||
10
src/main.cc
10
src/main.cc
@ -1,5 +1,5 @@
|
||||
/***************************************************************************************************
|
||||
* Copyright 2018-2023 Qsaker(qsaker@foxmail.com). All rights reserved.
|
||||
* Copyright 2018-2024 Qsaker(qsaker@foxmail.com). All rights reserved.
|
||||
*
|
||||
* The file is encoded using "utf8 with bom", it is a part of QtSwissArmyKnife project.
|
||||
*
|
||||
@ -7,7 +7,7 @@
|
||||
* code directory.
|
||||
**************************************************************************************************/
|
||||
#include "sak.h"
|
||||
#include "sakapplication.h"
|
||||
#include "application.h"
|
||||
|
||||
int main(const int argc, char *argv[])
|
||||
{
|
||||
@ -16,9 +16,9 @@ int main(const int argc, char *argv[])
|
||||
appName += QObject::tr("(Community)");
|
||||
#endif
|
||||
sakDoSomethingBeforeAppCreated(argv, appName);
|
||||
|
||||
SAKApplication app(argc, argv);
|
||||
int ret = SAKApplication::exec();
|
||||
|
||||
Application app(argc, argv);
|
||||
int ret = Application::exec();
|
||||
|
||||
sakDoSomethingAfterAppExited();
|
||||
|
||||
|
||||
@ -1,12 +1,13 @@
|
||||
/***************************************************************************************************
|
||||
* Copyright 2018-2023 Qsaker(qsaker@foxmail.com). All rights reserved.
|
||||
* Copyright 2018-2024 Qsaker(qsaker@foxmail.com). All rights reserved.
|
||||
*
|
||||
* The file is encoded using "utf8 with bom", it is a part of QtSwissArmyKnife project.
|
||||
*
|
||||
* QtSwissArmyKnife is licensed according to the terms in the file LICENCE in the root of the source
|
||||
* code directory.
|
||||
**************************************************************************************************/
|
||||
#include "sakmainwindow.h"
|
||||
#include "mainwindow.h"
|
||||
#include "ui_mainwindow.h"
|
||||
|
||||
#include <QAction>
|
||||
#include <QActionGroup>
|
||||
@ -55,8 +56,6 @@
|
||||
#include "SAKPrivateModbusServer.h"
|
||||
#endif
|
||||
|
||||
#include "ui_sakmainwindow.h"
|
||||
|
||||
#define SAK_QT_CONF (qApp->applicationDirPath() + "/qt.conf")
|
||||
|
||||
QString palettePath()
|
||||
@ -69,9 +68,9 @@ QString palettePath()
|
||||
return logPath;
|
||||
}
|
||||
|
||||
SAKMainWindow::SAKMainWindow(QWidget* parent)
|
||||
MainWindow::MainWindow(QWidget* parent)
|
||||
: QMainWindow(parent)
|
||||
, ui(new Ui::SAKMainWindow)
|
||||
, ui(new Ui::MainWindow)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
@ -116,12 +115,12 @@ SAKMainWindow::SAKMainWindow(QWidget* parent)
|
||||
initWindowMenu();
|
||||
}
|
||||
|
||||
SAKMainWindow::~SAKMainWindow()
|
||||
MainWindow::~MainWindow()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void SAKMainWindow::initMenuBar()
|
||||
void MainWindow::initMenuBar()
|
||||
{
|
||||
menuBar()->setPalette(qApp->palette());
|
||||
|
||||
@ -135,7 +134,7 @@ void SAKMainWindow::initMenuBar()
|
||||
}
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
void SAKMainWindow::closeEvent(QCloseEvent* event)
|
||||
void MainWindow::closeEvent(QCloseEvent* event)
|
||||
{
|
||||
auto key = mSettingsKey.exitToSystemTray;
|
||||
bool ignore = SAKSettings::instance()->value(key).toBool();
|
||||
@ -146,7 +145,7 @@ void SAKMainWindow::closeEvent(QCloseEvent* event)
|
||||
}
|
||||
#endif
|
||||
|
||||
void SAKMainWindow::initFileMenu()
|
||||
void MainWindow::initFileMenu()
|
||||
{
|
||||
QMenu* fileMenu = new QMenu(tr("&File"), this);
|
||||
menuBar()->addMenu(fileMenu);
|
||||
@ -196,11 +195,11 @@ void SAKMainWindow::initFileMenu()
|
||||
fileMenu->addSeparator();
|
||||
QAction* importAction = new QAction(tr("Import Palette"), fileMenu);
|
||||
fileMenu->addAction(importAction);
|
||||
connect(importAction, &QAction::triggered, this, &SAKMainWindow::onImportActionTriggered);
|
||||
connect(importAction, &QAction::triggered, this, &MainWindow::onImportActionTriggered);
|
||||
|
||||
QAction* exportAction = new QAction(tr("Export Palette"), fileMenu);
|
||||
fileMenu->addAction(exportAction);
|
||||
connect(exportAction, &QAction::triggered, this, &SAKMainWindow::onExportActionTriggered);
|
||||
connect(exportAction, &QAction::triggered, this, &MainWindow::onExportActionTriggered);
|
||||
|
||||
fileMenu->addSeparator();
|
||||
QAction* exitAction = new QAction(tr("Exit"), this);
|
||||
@ -208,7 +207,7 @@ void SAKMainWindow::initFileMenu()
|
||||
connect(exitAction, SIGNAL(triggered(bool)), this, SLOT(close()));
|
||||
}
|
||||
|
||||
void SAKMainWindow::initToolMenu()
|
||||
void MainWindow::initToolMenu()
|
||||
{
|
||||
QMenu* toolMenu = new QMenu(tr("&Tools"));
|
||||
menuBar()->addMenu(toolMenu);
|
||||
@ -233,7 +232,7 @@ void SAKMainWindow::initToolMenu()
|
||||
}
|
||||
}
|
||||
|
||||
void SAKMainWindow::initOptionMenu()
|
||||
void MainWindow::initOptionMenu()
|
||||
{
|
||||
QMenu* optionMenu = new QMenu(tr("&Options"));
|
||||
menuBar()->addMenu(optionMenu);
|
||||
@ -249,7 +248,7 @@ void SAKMainWindow::initOptionMenu()
|
||||
initOptionMenuPalette(optionMenu);
|
||||
}
|
||||
|
||||
void SAKMainWindow::initOptionMenuAppStyleMenu(QMenu* optionMenu)
|
||||
void MainWindow::initOptionMenuAppStyleMenu(QMenu* optionMenu)
|
||||
{
|
||||
// Initializing application style menu.
|
||||
static QActionGroup gActionGroup(this);
|
||||
@ -291,7 +290,7 @@ void SAKMainWindow::initOptionMenuAppStyleMenu(QMenu* optionMenu)
|
||||
}
|
||||
}
|
||||
|
||||
void SAKMainWindow::initOptionMenuMainWindowMenu(QMenu* optionMenu)
|
||||
void MainWindow::initOptionMenuMainWindowMenu(QMenu* optionMenu)
|
||||
{
|
||||
if (!optionMenu) {
|
||||
return;
|
||||
@ -315,14 +314,14 @@ void SAKMainWindow::initOptionMenuMainWindowMenu(QMenu* optionMenu)
|
||||
});
|
||||
}
|
||||
|
||||
void SAKMainWindow::initOptionMenuSettingsMenu(QMenu* optionMenu)
|
||||
void MainWindow::initOptionMenuSettingsMenu(QMenu* optionMenu)
|
||||
{
|
||||
QMenu* menu = new QMenu(tr("Settings"), this);
|
||||
optionMenu->addMenu(menu);
|
||||
|
||||
QAction* action = new QAction(tr("Clear Configuration"), this);
|
||||
menu->addAction(action);
|
||||
connect(action, &QAction::triggered, this, &SAKMainWindow::clearConfiguration);
|
||||
connect(action, &QAction::triggered, this, &MainWindow::clearConfiguration);
|
||||
action = new QAction(tr("Open configuration floder"), this);
|
||||
menu->addAction(action);
|
||||
connect(action, &QAction::triggered, this, [=]() {
|
||||
@ -334,7 +333,7 @@ void SAKMainWindow::initOptionMenuSettingsMenu(QMenu* optionMenu)
|
||||
}
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
|
||||
void SAKMainWindow::initOptionMenuHdpiPolicy(QMenu* optionMenu)
|
||||
void MainWindow::initOptionMenuHdpiPolicy(QMenu* optionMenu)
|
||||
{
|
||||
QMenu* menu = new QMenu(tr("HDPI Policy"));
|
||||
QActionGroup* ag = new QActionGroup(this);
|
||||
@ -421,7 +420,7 @@ void SAKMainWindow::initOptionMenuHdpiPolicy(QMenu* optionMenu)
|
||||
}
|
||||
#endif
|
||||
|
||||
void SAKMainWindow::initOptionMenuPalette(QMenu* optionMenu)
|
||||
void MainWindow::initOptionMenuPalette(QMenu* optionMenu)
|
||||
{
|
||||
static QActionGroup ag(this);
|
||||
QAction* systemAction = new QAction(tr("System"), this);
|
||||
@ -496,12 +495,12 @@ void SAKMainWindow::initOptionMenuPalette(QMenu* optionMenu)
|
||||
}
|
||||
}
|
||||
|
||||
void SAKMainWindow::initWindowMenu()
|
||||
void MainWindow::initWindowMenu()
|
||||
{
|
||||
// Nothing to do.
|
||||
}
|
||||
|
||||
void SAKMainWindow::initLanguageMenu()
|
||||
void MainWindow::initLanguageMenu()
|
||||
{
|
||||
QMenu* languageMenu = new QMenu(tr("&Languages"), this);
|
||||
#if 0
|
||||
@ -530,7 +529,7 @@ void SAKMainWindow::initLanguageMenu()
|
||||
}
|
||||
}
|
||||
|
||||
void SAKMainWindow::initHelpMenu()
|
||||
void MainWindow::initHelpMenu()
|
||||
{
|
||||
QMenu* helpMenu = new QMenu(tr("&Help"), this);
|
||||
menuBar()->addMenu(helpMenu);
|
||||
@ -542,7 +541,7 @@ void SAKMainWindow::initHelpMenu()
|
||||
|
||||
QAction* aboutAction = new QAction(tr("About QtSwissArmyKnife"), this);
|
||||
helpMenu->addAction(aboutAction);
|
||||
connect(aboutAction, &QAction::triggered, this, &SAKMainWindow::aboutSoftware);
|
||||
connect(aboutAction, &QAction::triggered, this, &MainWindow::aboutSoftware);
|
||||
#ifdef Q_OS_WIN
|
||||
QString tips = tr("Buy from Microsoft App Store");
|
||||
QIcon buy(":/resources/icon/IconBuy.svg");
|
||||
@ -574,18 +573,18 @@ void SAKMainWindow::initHelpMenu()
|
||||
|
||||
QAction* releaseHistoryAction = new QAction(tr("Release History"), this);
|
||||
helpMenu->addAction(releaseHistoryAction);
|
||||
connect(releaseHistoryAction, &QAction::triggered, this, &SAKMainWindow::showHistory);
|
||||
connect(releaseHistoryAction, &QAction::triggered, this, &MainWindow::showHistory);
|
||||
|
||||
helpMenu->addSeparator();
|
||||
QAction* qrCodeAction = new QAction(tr("QR Code"), this);
|
||||
helpMenu->addAction(qrCodeAction);
|
||||
connect(qrCodeAction, &QAction::triggered, this, &SAKMainWindow::showQrCode);
|
||||
connect(qrCodeAction, &QAction::triggered, this, &MainWindow::showQrCode);
|
||||
#ifndef SAK_IMPORT_MODULE_PRIVATE
|
||||
helpMenu->addAction(tr("Donate"), this, &SAKMainWindow::showDonation);
|
||||
#endif
|
||||
}
|
||||
|
||||
void SAKMainWindow::initLinksMenu()
|
||||
void MainWindow::initLinksMenu()
|
||||
{
|
||||
QMenu* linksMenu = new QMenu(tr("&Links"), this);
|
||||
menuBar()->addMenu(linksMenu);
|
||||
@ -627,7 +626,7 @@ void SAKMainWindow::initLinksMenu()
|
||||
}
|
||||
}
|
||||
|
||||
void SAKMainWindow::initDemoMenu()
|
||||
void MainWindow::initDemoMenu()
|
||||
{
|
||||
QMenu* demoMenu = new QMenu(tr("&Demo"), this);
|
||||
menuBar()->addMenu(demoMenu);
|
||||
@ -655,7 +654,7 @@ void SAKMainWindow::initDemoMenu()
|
||||
}
|
||||
}
|
||||
|
||||
void SAKMainWindow::initNav()
|
||||
void MainWindow::initNav()
|
||||
{
|
||||
QToolBar* tb = new QToolBar(this);
|
||||
addToolBar(Qt::LeftToolBarArea, tb);
|
||||
@ -758,7 +757,7 @@ void SAKMainWindow::initNav()
|
||||
#endif
|
||||
}
|
||||
|
||||
void SAKMainWindow::initNav(const NavContext& ctx)
|
||||
void MainWindow::initNav(const NavContext& ctx)
|
||||
{
|
||||
bool isTextBesideIcon = SAKSettings::instance()->isTextBesideIcon();
|
||||
auto style = isTextBesideIcon ? Qt::ToolButtonTextBesideIcon : Qt::ToolButtonIconOnly;
|
||||
@ -793,13 +792,13 @@ void SAKMainWindow::initNav(const NavContext& ctx)
|
||||
}
|
||||
}
|
||||
|
||||
void SAKMainWindow::initStatusBar()
|
||||
void MainWindow::initStatusBar()
|
||||
{
|
||||
ui->statusbar->showMessage("Hello world", 10 * 1000);
|
||||
ui->statusbar->hide();
|
||||
}
|
||||
|
||||
void SAKMainWindow::aboutSoftware()
|
||||
void MainWindow::aboutSoftware()
|
||||
{
|
||||
struct Info
|
||||
{
|
||||
@ -860,13 +859,13 @@ void SAKMainWindow::aboutSoftware()
|
||||
dialog.exec();
|
||||
}
|
||||
|
||||
void SAKMainWindow::clearConfiguration()
|
||||
void MainWindow::clearConfiguration()
|
||||
{
|
||||
SAKSettings::instance()->setClearSettings(true);
|
||||
rebootRequestion();
|
||||
}
|
||||
|
||||
void SAKMainWindow::rebootRequestion()
|
||||
void MainWindow::rebootRequestion()
|
||||
{
|
||||
int ret = QMessageBox::information(this,
|
||||
tr("Reboot application to effective"),
|
||||
@ -880,7 +879,7 @@ void SAKMainWindow::rebootRequestion()
|
||||
}
|
||||
}
|
||||
|
||||
void SAKMainWindow::showHistory()
|
||||
void MainWindow::showHistory()
|
||||
{
|
||||
QDialog dialog;
|
||||
dialog.setModal(true);
|
||||
@ -901,7 +900,7 @@ void SAKMainWindow::showHistory()
|
||||
dialog.exec();
|
||||
}
|
||||
|
||||
void SAKMainWindow::showQrCode()
|
||||
void MainWindow::showQrCode()
|
||||
{
|
||||
QDialog dialog;
|
||||
dialog.setWindowTitle(tr("QR Code"));
|
||||
@ -931,7 +930,7 @@ void SAKMainWindow::showQrCode()
|
||||
dialog.exec();
|
||||
}
|
||||
|
||||
void SAKMainWindow::showDonation()
|
||||
void MainWindow::showDonation()
|
||||
{
|
||||
QDialog dialog(this);
|
||||
dialog.setModal(true);
|
||||
@ -946,7 +945,7 @@ void SAKMainWindow::showDonation()
|
||||
dialog.exec();
|
||||
}
|
||||
|
||||
void SAKMainWindow::createQtConf()
|
||||
void MainWindow::createQtConf()
|
||||
{
|
||||
QString fileName = SAK_QT_CONF;
|
||||
QFile file(fileName);
|
||||
@ -960,7 +959,7 @@ void SAKMainWindow::createQtConf()
|
||||
}
|
||||
}
|
||||
|
||||
void SAKMainWindow::onImportActionTriggered()
|
||||
void MainWindow::onImportActionTriggered()
|
||||
{
|
||||
auto str = QFileDialog::getOpenFileName(this, tr("Save Palette"), "Palete", tr("All (*)"));
|
||||
if (str.isEmpty()) {
|
||||
@ -997,7 +996,7 @@ void SAKMainWindow::onImportActionTriggered()
|
||||
}
|
||||
}
|
||||
|
||||
void SAKMainWindow::onExportActionTriggered()
|
||||
void MainWindow::onExportActionTriggered()
|
||||
{
|
||||
auto str = QFileDialog::getSaveFileName(this, tr("Save Palette"), "Palete", tr("All (*)"));
|
||||
if (str.isEmpty()) {
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
/***************************************************************************************************
|
||||
* Copyright 2018-2023 Qsaker(qsaker@foxmail.com). All rights reserved.
|
||||
/***************************************************************************************************
|
||||
* Copyright 2018-2024 Qsaker(qsaker@foxmail.com). All rights reserved.
|
||||
*
|
||||
* The file is encoded using "utf8 with bom", it is a part of QtSwissArmyKnife project.
|
||||
*
|
||||
* QtSwissArmyKnife is licensed according to the terms in the file LICENCE in the root of the source
|
||||
* code directory.
|
||||
**************************************************************************************************/
|
||||
#ifndef SAKMAINWINDOW_HH
|
||||
#define SAKMAINWINDOW_HH
|
||||
#ifndef MAINWINDOW_H
|
||||
#define MAINWINDOW_H
|
||||
|
||||
#include <QAction>
|
||||
#include <QButtonGroup>
|
||||
@ -24,15 +24,15 @@
|
||||
#include <QTranslator>
|
||||
|
||||
namespace Ui {
|
||||
class SAKMainWindow;
|
||||
class MainWindow;
|
||||
}
|
||||
|
||||
class SAKMainWindow : public QMainWindow
|
||||
class MainWindow : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit SAKMainWindow(QWidget* parent = Q_NULLPTR);
|
||||
~SAKMainWindow() override;
|
||||
explicit MainWindow(QWidget* parent = Q_NULLPTR);
|
||||
~MainWindow() override;
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
protected:
|
||||
@ -55,7 +55,7 @@ private:
|
||||
|
||||
private:
|
||||
const QLoggingCategory mLoggingCategory{"sak.mainwindow"};
|
||||
Ui::SAKMainWindow* ui;
|
||||
Ui::MainWindow* ui;
|
||||
|
||||
private:
|
||||
void initMenuBar();
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>SAKMainWindow</class>
|
||||
<widget class="QMainWindow" name="SAKMainWindow">
|
||||
<class>MainWindow</class>
|
||||
<widget class="QMainWindow" name="MainWindow">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
@ -38,7 +38,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>530</width>
|
||||
<height>23</height>
|
||||
<height>17</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
|
||||
@ -1,17 +1,17 @@
|
||||
/***************************************************************************************************
|
||||
* Copyright 2022-2023 Qsaker(qsaker@foxmail.com). All rights reserved.
|
||||
* Copyright 2022-2024 Qsaker(qsaker@foxmail.com). All rights reserved.
|
||||
*
|
||||
* The file is encoded using "utf8 with bom", it is a part of QtSwissArmyKnife project.
|
||||
*
|
||||
* QtSwissArmyKnife is licensed according to the terms in the file LICENCE in the root of the source
|
||||
* code directory.
|
||||
**************************************************************************************************/
|
||||
#include "saksystemtrayicon.h"
|
||||
#include "systemtrayicon.h"
|
||||
#include <QAction>
|
||||
#include <QDir>
|
||||
#include <QMenu>
|
||||
|
||||
SAKSystemTrayIcon::SAKSystemTrayIcon(QObject *parent)
|
||||
SystemTrayIcon::SystemTrayIcon(QObject *parent)
|
||||
: QSystemTrayIcon(parent)
|
||||
{
|
||||
setIcon(QIcon(":/resources/images/SAKLogo.png"));
|
||||
@ -24,7 +24,7 @@ SAKSystemTrayIcon::SAKSystemTrayIcon(QObject *parent)
|
||||
setContextMenu(menu);
|
||||
}
|
||||
|
||||
SAKSystemTrayIcon::~SAKSystemTrayIcon()
|
||||
SystemTrayIcon::~SystemTrayIcon()
|
||||
{
|
||||
this->hide();
|
||||
QMenu *menu = contextMenu();
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/***************************************************************************************************
|
||||
/***************************************************************************************************
|
||||
* Copyright 2022-2023 Qsaker(qsaker@foxmail.com). All rights reserved.
|
||||
*
|
||||
* The file is encoded using "utf8 with bom", it is a part of QtSwissArmyKnife project.
|
||||
@ -6,20 +6,20 @@
|
||||
* QtSwissArmyKnife is licensed according to the terms in the file LICENCE in the root of the source
|
||||
* code directory.
|
||||
**************************************************************************************************/
|
||||
#ifndef SAKSYSTEMTRAYICON_H
|
||||
#define SAKSYSTEMTRAYICON_H
|
||||
#ifndef SYSTEMTRAYICON_H
|
||||
#define SYSTEMTRAYICON_H
|
||||
|
||||
#include <QSystemTrayIcon>
|
||||
|
||||
class SAKSystemTrayIcon : public QSystemTrayIcon
|
||||
class SystemTrayIcon : public QSystemTrayIcon
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit SAKSystemTrayIcon(QObject *parent = Q_NULLPTR);
|
||||
~SAKSystemTrayIcon();
|
||||
explicit SystemTrayIcon(QObject *parent = Q_NULLPTR);
|
||||
~SystemTrayIcon();
|
||||
signals:
|
||||
void invokeExit();
|
||||
void invokeShowMainWindow();
|
||||
};
|
||||
|
||||
#endif // SAKSYSTEMTRAYICON_H
|
||||
#endif // SYSTEMTRAYICON_H
|
||||
|
||||
Loading…
Reference in New Issue
Block a user