QScreen *screen = QGuiApplication::primaryScreen();
QString filePathName = "full-";
filePathName += QDateTime::currentDateTime().toString("yyyy-MM-dd hh-mm-ss-zzz");
filePathName += ".jpg";
if(!screen->grabWindow(0).save(filePathName, "jpg"))
{
Display("截图失败,请重新尝试!");
}
else
{
Display("截图成功,请查收!");
}