Commit ae7ca448 authored by Clinton Stimpson's avatar Clinton Stimpson

ENH:  Provide double click support for PyQt.
      Addresses 1681 in the bug tracker.
parent 5e9e172e
......@@ -242,8 +242,11 @@ class QVTKRenderWindowInteractor(qt.QWidget):
def mousePressEvent(self,ev):
ctrl, shift = self._GetCtrlShift(ev)
repeat = 0
if ev.type() == qt.QEvent.MouseButtonDblClick:
repeat = 1
self._Iren.SetEventInformationFlipY(ev.x(), ev.y(),
ctrl, shift, chr(0), 0, None)
ctrl, shift, chr(0), repeat, None)
self._ActiveButton = 0
if ev.button() == 1:
......@@ -306,6 +309,10 @@ class QVTKRenderWindowInteractor(qt.QWidget):
#-----------------------------------------------------------------------
def foo(obj, event):
print event
print obj.GetRepeatCount()
def QVTKRenderWidgetConeExample():
"""A simple example that uses the QVTKRenderWindowInteractor
class. """
......@@ -319,6 +326,7 @@ def QVTKRenderWidgetConeExample():
widget.Start()
# if you dont want the 'q' key to exit comment this.
widget.AddObserver("ExitEvent", lambda o, e, a=app: a.quit())
widget.AddObserver("LeftButtonPressEvent", foo)
ren = vtk.vtkRenderer()
widget.GetRenderWindow().AddRenderer(ren)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment