E5Gui/E5ModelToolBar.py

changeset 2467
33f1bcfdd65e
parent 2401
4f428de32b69
child 2525
8b507a9a2d40
child 2990
583beaf0b4b8
--- a/E5Gui/E5ModelToolBar.py	Mon Mar 04 19:12:44 2013 +0100
+++ b/E5Gui/E5ModelToolBar.py	Sat Mar 09 13:42:57 2013 +0100
@@ -7,7 +7,7 @@
 Module implementing a tool bar populated from a QAbstractItemModel.
 """
 
-from PyQt4.QtCore import pyqtSignal, Qt, QModelIndex, QPoint, QEvent
+from PyQt4.QtCore import pyqtSignal, qVersion, Qt, QModelIndex, QPoint, QEvent
 from PyQt4.QtGui import QApplication, QDrag, QPixmap, QToolBar, QIcon, QToolButton
 
 
@@ -241,7 +241,10 @@
         drag = QDrag(self)
         drag.setMimeData(self.__model.mimeData([idx]))
         actionRect = self.actionGeometry(act)
-        drag.setPixmap(QPixmap.grabWidget(self, actionRect))
+        if qVersion() >= "5.0.0":
+            drag.setPixmap(self.grab(actionRect))
+        else:
+            drag.setPixmap(QPixmap.grabWidget(self, actionRect))
         
         if drag.exec_() == Qt.MoveAction:
             row = idx.row()

eric ide

mercurial