【Qt】重启

Qt 实现电脑重启(需要管理员)

1
2
3
4
5
6
7
8
inline void reboot()
{
QString program = QApplication::applicationFilePath();
QStringList arguments = QApplication::arguments();
QString workingDirectory = QDir::currentPath();
QProcess::startDetached(program, arguments, workingDirectory);
QApplication::exit();
}

【Qt】重启
https://hodlyounger.github.io/B_Code/Qt/【Qt】重启/
作者
mingming
发布于
2023年10月27日
许可协议