summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Faure <[email protected]>2016-05-13 14:55:33 +0200
committerDavid Faure <[email protected]>2016-05-13 14:55:33 +0200
commite410d659592c18e3b3c402fc65fbd1e70d1b3126 (patch)
treedcab422ce72d54f32ced758b526ef6e71b9abc73
parentb041bcad87701f4504817b51da4474eaca080d6f (diff)
Fix runtime warning about using QPixmap::grabWindow. Not perfect, but not worse.
-rw-r--r--kmagzoomview.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/kmagzoomview.cpp b/kmagzoomview.cpp
index 7f71315..ce37446 100644
--- a/kmagzoomview.cpp
+++ b/kmagzoomview.cpp
@@ -31,6 +31,7 @@
#include <QBitmap>
#include <QDesktopWidget>
#include <QScrollBar>
+#include <QScreen>
// include files for KDE
#include <KLocalizedString>
@@ -948,8 +949,9 @@ void KMagZoomView::grabFrame()
QRect selRect = m_selRect.normalized();
// grab screenshot from the screen and put it in the pixmap
- m_coloredPixmap = QPixmap::grabWindow(QApplication::desktop()->winId(), selRect.x(), selRect.y(),
- selRect.width(), selRect.height());
+ QScreen *screen = qApp->primaryScreen(); // ## How to select the right screen?
+ m_coloredPixmap = screen->grabWindow(QApplication::desktop()->winId(), selRect.x(), selRect.y(),
+ selRect.width(), selRect.height());
// colorize the grabbed pixmap
if (m_colormode != 0)