Edit pyqtgraph mouse interactivity capabilities?
-
I'd like to add some functionality to pyqtgraph to allow zooming into graph section with mouse drag like in matplot lib and another where a rect floatting bubble near the mouse cursor tells you according to the cursor in steps (or analog for more mathy data analysis) what the Y components equals to in each X the mouse is pointing to and I'd like to ask how one would approach such a development?
Can you add all this functionality externally with Qt framework or would I have to dig into how pyqtgraph library works(if so where is it even located(cant find it is local data and lib internal folders))?
How does that hover bubble for the mouse called in QT BTW?
-
Hi,
You might be talking about QToolTip.
As for PyQtGraph, you should contact the authors of that module.
@SGaist Yeah QToolTip is probably what I'm looking for with message that follows the mouse cursor and I meant to ask this as a general question regarding how'd one debug inheritance and function of an external Qt widget module and add interactivity upon a functioning Widget,
For example I'm about to go with the approach of creating a class that inherits from pg.PlotWidget and copy the function content of mouseMoveEvent() from GraphicsView.py of the pyqtgraph library file to my redefinition of it and in my file and then add my functionality at the end of the function.But that seem quite cumbersome and what if I don't want to copy the correct content of the mouseMoveFucntion()? is it possible to just add more lines to that function without redefining it?
Also there is a signal emitted every time the mouse move, is it possible to connect to it another callback function? I think I might have tyed that and it haven't worked.
Anyways this are the kind of questions I'm trying to address with this post.
-
If you want to have the complete code of the original function run, just call the base class implementation in your method overload.
There are no signals sent when the mouse moves. There are the mouse event handlers.