QGLWidget mouse movement tracking
-
-
-
Hi
yes, QOpenGLWidget is also a QWidget and offer same virtual functions to override.
mouseClickEvent = mousePressEvent.- also using mouseevent, if i click the button, how do i display the x,y at the pointer of my mouse.
Do you mean the mouse position over the button
or do you mean the global mouse position at that moment ?
Note there is also
QPoint globalCursorPos = QCursor::pos();
to ask where mouse is in global coordinates.
You can call that from any function and no need for subclassing.
In mousePress, the pos you get there is translated to the local coordinates system.
Very useful if you want to draw on the widget etc.So it really depends on what you really want to archive ?
-
@s002wjh
Hi
It really depends on what you already have.
If you draw the graphs looking thing in the image, you could also just
store the values in variables and draw it as part of the graphs.
Else a Label is not super bad but might not be optimal if you say resize the window etc as
the labels stay in same position. -
Hi
yeah something like
https://het.as.utexas.edu/HET/Software/html/opengl-overpainting.htmlBut i do wonder. how do you draw that graph look ? is that openGL?