Skip to content

Commit aa7d53a

Browse files
committed
feat: 从产品角度出发,在保存或者复制后不quit工具进程,因为用户可能还想截屏
1 parent 5102f9e commit aa7d53a

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

screenshotwidget.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2431,8 +2431,13 @@ void ScreenshotWidget::saveScreenshot()
24312431
}
24322432
emit screenshotTaken(); // 发射截图完成信号
24332433
hide(); // 隐藏当前窗口
2434-
QApplication::quit(); // 退出整个应用程序
2434+
// QApplication::quit(); // 退出整个应用程序
24352435
// 如果用户取消保存,不做任何操作,保持当前状态(工具栏仍然可见)
2436+
if (mainWindow)
2437+
{
2438+
mainWindow->show();
2439+
}
2440+
close();
24362441
}
24372442
}
24382443

@@ -2575,7 +2580,12 @@ void ScreenshotWidget::copyToClipboard()
25752580

25762581
emit screenshotTaken();
25772582
hide();
2578-
QApplication::quit();
2583+
// QApplication::quit();
2584+
if (mainWindow)
2585+
{
2586+
mainWindow->show();
2587+
}
2588+
close();
25792589
}
25802590

25812591
void ScreenshotWidget::drawArrow(QPainter &painter, const QPointF &start, const QPointF &end, const QColor &color, int width, double scale)

0 commit comments

Comments
 (0)