Override mouse click/drag event

29 views
Skip to first unread message

Erlich_Bachman

unread,
Jun 25, 2019, 7:40:25 AM6/25/19
to pyqtgraph
Hello All,

Thank you in advance for taking the time to read this, and for any responses you may offer.

I am creating a relatively simple image viewing application, and have a few ImageView widgets which are being used to display 2d images (jpg, png etc).

Example of the code I am using at the moment:

import pyqtgraph as pg

'''
'''

myViewer = pg.ImageView(view=pg.plotItem())
picDataArray = ...
myViewer.setImage(picDataArray, axes={'x': 1, 'y': 0, 'c': 2})

I want to be able to override the right mouse click on this ImageViewer.
At the moment it raises the context menu, however I want to be able to override the functionality of the right mouse click to be dragged in order to rotate the image (I do not need to maintain the context menu functionality, as it is not useful for my particular application).
I have toyed with the solution of implementing a subclass of ImageItem, however I am not 100% sure on how I would achieve this.

Any help is much appreciated!

Kind Regards,

Angus
Reply all
Reply to author
Forward
0 new messages