1 Sep 2009 03:53
no response for mouse event in PyQt4 4.5.4
Grant Tang <grant.tang <at> gmail.com>
2009-09-01 01:53:39 GMT
2009-09-01 01:53:39 GMT
Hi,
We have an software EMAN2 which choose PyQt4 to implement the GUI interface. Which works fine until recently I upgrade my PyQt4 to 4.5.4. After the upgrading, I lose response to all mouse event, including mouse clicking on a 2D/3D image and mouse wheel (I use wheel to zoom in or out of image). I tried PyQt4 4.5.2, still no response for all mouse event. The mouse works perfectly fine for PyQt4 4.4.4. I doubt all 4.5 versions will not work. Could somebody help?
I post some pieces of code for my mouse wheel event, hope it help:
class Main2DWindowEventHandler(BoxEventsHandler):
def __connect_Signals_to_slots(self):
QtCore.QObject.connect(self.main_2d_window.emitter(), QtCore.SIGNAL('mousewheel'), self.mouse_wheel())
class EMImage2DEmitMouseMode(EMImage2DMouseEvents):
def mouse_wheel(self, event):
seld.mediator.emit(QtCore.SIGNAL('mousewheel'), event)
#actual slot function
class EMImage2DModule(EMGUIModule):
def weelEvent(self, event):
#blah, blah
I tried to print out message in this slot function. It prints out in PyQt4.4.4 but nothing got printed in PyQt4.5.*.
Since it works fine with PyQt4 4.4.4 and previous versions. I doubt something new in 4.5.* make it not work.
Thanks for any comments,
Grant
<div>
<p>Hi,</p>
<div><br></div>
<div>We have an software EMAN2 which choose PyQt4 to implement the GUI interface. Which works fine until recently I upgrade my PyQt4 to 4.5.4. After the upgrading, I lose response to all mouse event, including mouse clicking on a 2D/3D image and mouse wheel (I use wheel to zoom in or out of image). I tried PyQt4 4.5.2, still no response for all mouse event. The mouse works perfectly fine for PyQt4 4.4.4. I doubt all 4.5 versions will not work. Could somebody help?</div>
<div><br></div>
<div>I post some pieces of code for my mouse wheel event, hope it help: </div>
<div>class Main2DWindowEventHandler(BoxEventsHandler):</div>
<div> def __connect_Signals_to_slots(self):</div>
<div> QtCore.QObject.connect(self.main_2d_window.emitter(), QtCore.SIGNAL('mousewheel'), self.mouse_wheel())</div>
<div><br></div>
<div>class EMImage2DEmitMouseMode(EMImage2DMouseEvents):</div>
<div> def mouse_wheel(self, event):</div>
<div> seld.mediator.emit(QtCore.SIGNAL('mousewheel'), event)</div>
<div><br></div>
<div>
#actual slot function</div>
<div>class EMImage2DModule(EMGUIModule):</div>
<div> def weelEvent(self, event):</div>
<div> #blah, blah</div>
<div>I tried to print out message in this slot function. It prints out in PyQt4.4.4 but nothing got printed in PyQt4.5.*.</div>
<div><br></div>
<div>Since it works fine with PyQt4 4.4.4 and previous versions. I doubt something new in 4.5.* make it not work.</div>
<div><br></div>
<div>Thanks for any comments, </div>
<div>
<br>Grant<br>
</div>
</div>
> Note that it's __next__ (and not next) even for Python v2.
Though, curiously, next() appears to work, which is why I didn't notice that.
It's even in the tutorial:
RSS Feed