Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fixed the issue of waiting for restart after exiting #272

Merged
merged 1 commit into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/qml/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ ApplicationWindow {
onClosing: {
FileControl.saveSetting()
FileControl.terminateShortcutPanelProcess() //结束快捷键面板进程
GControl.forceExit();
}

FileDialog {
Expand Down
7 changes: 7 additions & 0 deletions src/src/globalcontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <QEvent>
#include <QThread>
#include <QDebug>
#include <QApplication>

static const int sc_SubmitInterval = 200; // 图片变更提交定时间隔 200ms

Expand Down Expand Up @@ -266,6 +267,12 @@
return false;
}

bool GlobalControl::forceExit()

Check warning on line 270 in src/src/globalcontrol.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

The function 'forceExit' is never used.
{
QApplication::exit(0);
_Exit(0);
}

/**
@brief 设置打开图片列表 \a filePaths , 其中 \a openFile 是首个展示的图片路径,
将更新全局数据源并发送状态变更信号
Expand Down
1 change: 1 addition & 0 deletions src/src/globalcontrol.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ class GlobalControl : public QObject
Q_INVOKABLE bool nextImage();
Q_INVOKABLE bool firstImage();
Q_INVOKABLE bool lastImage();
Q_INVOKABLE bool forceExit();

// 图像文件变更操作
Q_SLOT void setImageFiles(const QStringList &imageFiles, const QString &openFile);
Expand Down