Void MainWindow: : Screenshot ()
{
QDebug () & lt; & lt;" Screenshot ";
QScreen * screen=QGuiApplication: : primaryScreen ();
QPixmap pixmap=screen - & gt; GrabWindow (QApplication: : desktop () - & gt; WinId ());
Pixmap. Save (" C: \ \ Users \ \ 93216 \ \ Desktop ", "JPG");
}
CodePudding user response:
File name may be wrong