Skip to content
Snippets Groups Projects
Commit 249f5020 authored by Jan's avatar Jan
Browse files

Replaced obsolete grabWidget Call

parent 1f40e5b9
Branches
No related tags found
1 merge request!185Fix warnings qt
......@@ -505,9 +505,10 @@ void CoreWidget::applicationSnapshotDialog() {
snapshotName_ = newName;
//grabs only the widget (espacially in windows)
//todo: deprecated in QT 5.0, use QScreen instead
QPixmap pic = QPixmap::grabWindow( winId() );
dialog.hide();
QScreen* screen = window()->screen();
QPixmap pic = screen->grabWindow( winId() );
QPainter painter (&pic);
......@@ -534,8 +535,11 @@ void CoreWidget::applicationSnapshotDialog() {
///Take a snapshot of the whole application
void CoreWidget::applicationSnapshot() {
QScreen* screen = window()->screen();
QPixmap pix = screen->grabWindow( winId() );
// Write image asynchronously
QImage* pic = new QImage(QPixmap::grabWindow( winId() ).toImage());
QImage* pic = new QImage(pix.toImage());
writeImageAsynchronously(pic, suggestSnapshotFilename(snapshotName_));
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment