I'm a new java / qt programmer and i'm trying to build a gui using java and qt jambi.
I put a pixmap inside a label and it works good, but, now i need to get the image coordinates when i click on the pixmap inside the label. I don't need the QWidget coordinates. I just need the pixmap coordinates to work over the image on the clicked point.
i think i should override the mousePressEvent event, but i don't know how to attach it to "pixmap onclick".
Can you please make me an easy example?
I hope i have explained my problem in the right way, my english is not awesome, sorry!
You seem to be confusing events and signals together. The former is a QEvent, the latter is a signal. What you need is the former, and you do not need the latter.
You would need to subclass the QLabel class and write something like this when writing C++ (not Qt Jambi in Java, but you can take it as pseudo-code either way).
So, depending your use case, you would need to look into the documentation of these methods:
and then this is the method to get the local position that also works with Qt 4. You may wish to consider localPos() or other methods introduced in Qt 5 if you need more precision with float, etc.