Hi
The label displaying the pixmap is the central widget in a mainwindow. Do I need to create my own qlabel , enable mousetracking and reimplement the event handler to catch the tooltip event?
Thanks
Hi
The label displaying the pixmap is the central widget in a mainwindow. Do I need to create my own qlabel , enable mousetracking and reimplement the event handler to catch the tooltip event?
Thanks
I guess you have 2 options to proceed with -
1) show position as tool tip
This simply requires you to set mouse position as tool tip in mouseMoveEvent of QLabel.
But this will limit as tooltip display takes some time to popup.
2) Display position in status bar of QMainWindow.
You can capture mouse move events in main window, translate them to label cordinates and show in status bar
Thanks
So if I want to display pixel position attached to the cursor as the mouse moves over the image, the tooltip is not the solution as it is too slow updating the cursor position.
The second option would only display the cursor position in the status bar, I would like the position attched to the mouse cursor as it is moved over the image
Thanks
So subclass the label and reimplement its paintEvent() as already said.
Hi,
I have just started working with Qt. I want to extract the pixel coordinates on mouse click and this thread seemed relevant. Can I get a snippet of your code to understand how to implement it?
Thanks.
Bookmarks