I am working on a project with qwt. And what I am trying to do is obtaining the coordinates where my mouse click on. I searched on the Internet and find it might be relevant to the QwtPlotPicker class. But I can't find any function that may meet my need in the official document. Is there any example I can refer to? Any help will be appreciated.
Asked
Active
Viewed 766 times
0
-
1Show your code please. – eyllanesc Jun 24 '17 at 14:00
-
read this: https://stackoverflow.com/questions/13066035/tool-tip-to-show-plot-values-in-qwt – eyllanesc Jun 24 '17 at 14:02
-
actually it is parts of an unfinished project, is the source code really needed? It is kind of messy. – Andy Fan Jun 24 '17 at 14:04
-
Check the link that you put in my next comment, there is your answer. – eyllanesc Jun 24 '17 at 14:05
-
Here is another example: https://github.com/pvbrowser/pvb/blob/master/qwt/examples/bode/bode.cpp – eyllanesc Jun 24 '17 at 14:09
-
thanks, I am studying on it. – Andy Fan Jun 24 '17 at 14:09
-
1Possible duplicate of [Tool tip to show plot values in Qwt](https://stackoverflow.com/questions/13066035/tool-tip-to-show-plot-values-in-qwt) – eyllanesc Jun 24 '17 at 14:10
-
I try the code in "Tool tip to show plot values in Qwt", but what I get is coordinates floating around my mouse, but I still can't understand how to get the exact values stored in variables. http://imgur.com/a/pLAiN – Andy Fan Jun 24 '17 at 14:38
-
Do you want the position in pixels or do you want the point on the plot? – eyllanesc Jun 24 '17 at 15:11
-
yes, I want the point on the plot. – Andy Fan Jun 24 '17 at 15:14
-
You can share your project even if it is not finished, so you can start testing it. – eyllanesc Jun 24 '17 at 15:15
-
Here is my project. https://drive.google.com/file/d/0B7VyGeuv2EoGZW11SENwdUdLQU0/view?usp=sharing – Andy Fan Jun 24 '17 at 15:23
-
That code works, if you realize it shows you the position of the click with respect to the plot. – eyllanesc Jun 24 '17 at 16:16
-
Please you could explain something more detailed because it seems that your explanation is ambiguous. – eyllanesc Jun 24 '17 at 16:16
-
Actually, I don't even need anything to be displayed on my screen. I want to get the position coordinates in silence after I clicking my mouse(nothing should be displayed), and pass the value to other function that do the further operation. – Andy Fan Jun 25 '17 at 02:18
-
Para obtener la posición lo debes a traves de la señal selected de QwtPlotPicker, para poder verlo en la clase LSPlot este debe heredar de QObject, todas esas modificaciones la hice en el siguiente link: https://github.com/eyllanesc/stackoverflow/tree/master/RE_LightScan – eyllanesc Jun 25 '17 at 04:46