Hai
How to move the Legend widget using MouseMove Event ?
suggestion please
suree
Bangalore
Hai
How to move the Legend widget using MouseMove Event ?
suggestion please
suree
Bangalore
Override the mouseMoveEvent(), extract mouse position from event object, and use it to set widgets position.
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
Make sure to insert your legend class using QwtPlot::insertLegend(your_legend_p, QwtPlot::ExternalLegend) though. This will make the legend a child of the plot instead of placing it somewhere else. Then you can simply captue the mouseMoveEvent() events and then just set your geometry however you would like on your legend widget.![]()
Thanks for ur reply
Hai
In my Project, I have a Main Widget in that QWT Plot Widget and some other widgets [QList ..].
I can get the MouseMoveEvent of my MainWidget but not able to get QWTPlot MouseMoveEvent.
suggestion please
Qt Code:
{ ------ ------ }To copy to clipboard, switch view to plain text mode
and
my QWTPLOT Mouse Event is
Qt Code:
{ // some code ------------------ ------------------- }To copy to clipboard, switch view to plain text mode
suree
India
One thing to watch out for is that the plot canvas is a separate widget from the plot itself. The canvas is a child of the plot. More than like you need to watch from the mouse move event in uPlot->canvas().
Additionally, you have to turn on the mouse tracking for a widget in order to get mouseMoveEvents. You should use:
Qt Code:
uPlot->setMouseTracking(true); uPlot->canvas()->setMouseTracking(true);To copy to clipboard, switch view to plain text mode
Amos
Qt Programmer Extraordinaire
Current Work:
Ripxx Sports Measurement Device - www.ripxx.com
(Featured in MYTHBUSTERS on 2010-05-19 in S08E08)
Bookmarks