Fixed dock dragging on pyside

Added imageview.setImage argument documentation
This commit is contained in:
Luke Campagnola 2013-02-15 15:22:05 -05:00
parent 783af1a918
commit 86861b5a06
3 changed files with 34 additions and 1 deletions

View File

@ -186,6 +186,7 @@ class Dock(QtGui.QWidget, DockDrop):
def startDrag(self):
print('startDrag')
self.drag = QtGui.QDrag(self)
mime = QtCore.QMimeData()
#mime.setPlainText("asd")
@ -212,6 +213,19 @@ class Dock(QtGui.QWidget, DockDrop):
def __repr__(self):
return "<Dock %s %s>" % (self.name(), self.stretch())
## PySide bug: We need to explicitly redefine these methods
## or else drag/drop events will not be delivered.
def dragEnterEvent(self, *args):
DockDrop.dragEnterEvent(self, *args)
def dragMoveEvent(self, *args):
DockDrop.dragMoveEvent(self, *args)
def dragLeaveEvent(self, *args):
DockDrop.dragLeaveEvent(self, *args)
def dropEvent(self, *args):
DockDrop.dropEvent(self, *args)
class DockLabel(VerticalLabel):

View File

@ -293,5 +293,19 @@ class DockArea(Container, QtGui.QWidget, DockDrop):
self.home.removeTempArea(self)
#self.close()
## PySide bug: We need to explicitly redefine these methods
## or else drag/drop events will not be delivered.
def dragEnterEvent(self, *args):
DockDrop.dragEnterEvent(self, *args)
def dragMoveEvent(self, *args):
DockDrop.dragMoveEvent(self, *args)
def dragLeaveEvent(self, *args):
DockDrop.dragLeaveEvent(self, *args)
def dropEvent(self, *args):
DockDrop.dropEvent(self, *args)

View File

@ -205,7 +205,12 @@ class ImageView(QtGui.QWidget):
*axes* Dictionary indicating the interpretation for each axis.
This is only needed to override the default guess. Format is::
{'t':0, 'x':1, 'y':2, 'c':3};
{'t':0, 'x':1, 'y':2, 'c':3};
*pos* Change the position of the displayed image
*scale* Change the scale of the displayed image
*transform* Set the transform of the dispalyed image. This option overrides *pos*
and *scale*.
============== =======================================================================
"""
prof = debug.Profiler('ImageView.setImage', disabled=True)