r18212 by fschmid - Eyedropper: adapt to Qt5

scribus-commit scribus-commit at lists.scribus.net
Sun Mar 17 10:46:33 UTC 2013


Author: fschmid
Date: Sun Mar 17 10:46:33 2013
New Revision: 18212

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=18212
Log:
Eyedropper: adapt to Qt5

Modified:
    trunk/Scribus/scribus/canvasmode_eyedropper.cpp

Modified: trunk/Scribus/scribus/canvasmode_eyedropper.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18212&path=/trunk/Scribus/scribus/canvasmode_eyedropper.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_eyedropper.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_eyedropper.cpp Sun Mar 17 10:46:33 2013
@@ -24,6 +24,9 @@
 #include <QMouseEvent>
 #include <QPoint>
 #include <QRect>
+#ifdef USE_QT5
+	#include <QScreen>
+#endif
 #include <QDebug>
 
 #include "canvas.h"
@@ -116,6 +119,7 @@
 	/*m->accept();
 	if (commonMouseMove(m))
 		return;*/
+	m->accept();
 }
 
 void CanvasMode_EyeDropper::mousePressEvent(QMouseEvent *m)
@@ -139,8 +143,14 @@
 	releaseMouse();
 
 	m_view->setCursor(QCursor(Qt::ArrowCursor));
-
+#ifdef USE_QT5
+	QPixmap pm;
+	QScreen *screen = QGuiApplication::primaryScreen();
+	if (screen)
+		pm = screen->grabWindow( QApplication::desktop()->winId(), m->globalPos().x(), m->globalPos().y(), 1, 1);
+#else
 	QPixmap pm = QPixmap::grabWindow( QApplication::desktop()->winId(), m->globalPos().x(), m->globalPos().y(), 1, 1);
+#endif
 	QImage i = pm.toImage();
 	QColor selectedColor=i.pixel(0, 0);
 




More information about the scribus-commit mailing list