Results 1 to 8 of 8

Thread: how to detect mouse click on qwtPlot?

  1. #1
    Join Date
    Nov 2009
    Posts
    94
    Thanks
    14
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default how to detect mouse click on qwtPlot?

    Hello,

    could you give me an idea of how my plan can be easily fulfilled in Qt or Qwt. Following plan:
    My programm has got several QwtPlots for visualization of curves from different settings. The user should be able to click on one of the plots and thus I have to detect which of plots was clicked on. How can it be achieved?

    Thank you.

    Vitali

  2. #2
    Join Date
    Nov 2009
    Posts
    94
    Thanks
    14
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: how to detect mouse click on qwtPlot?

    The problem is now solved, by using QwtPlotPickers for every QwtPlot and connecting their "selected" SIGNALs to a "map()" SLOT of class QSignalMapper. Then the SIGNAL "mapped(int)" is connected with my SLOT "clickedOnPlot(int)", so that I get info which of pickers has caused this signal...

  3. #3
    Join Date
    Mar 2013
    Posts
    3
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X

    Default Re: how to detect mouse click on qwtPlot?

    Hello rambo83!

    I'm having the same problem you have, I need to know which of the pickers is causing the signal.
    I haven't tried your solution yet, I'm gonna do it now, but could you please paste this part of your code here?
    It's always helpful to have an example to follow.

    Thank you!!

  4. #4
    Join Date
    Nov 2009
    Posts
    94
    Thanks
    14
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: how to detect mouse click on qwtPlot?

    Hello,

    I'm sorry, but I do not have any source code of the corresponding project anymore, since it was a project for my internship several years ago.

    Good luck

    Vitali

  5. #5
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,312
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: how to detect mouse click on qwtPlot?

    See QObject::sender()

    Uwe

  6. #6
    Join Date
    Mar 2013
    Posts
    3
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X

    Default Re: how to detect mouse click on qwtPlot?

    I figured this might happen hahaha
    Thanks anyway Vitali!

    I will check it out Uwe!
    Thank you for your help.

    Best wishes,
    Points.

  7. #7
    Join Date
    Mar 2013
    Posts
    3
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X

    Default Re: how to detect mouse click on qwtPlot?

    Problem soved!

    If anyone has this problem, I suggest taking a look at this post from Vitali I found in qtforum.de: http://www.qtforum.de/forum/viewtopic.php?p=53467
    You may find the example code there.

    Thank you,
    Points.

  8. #8
    Join Date
    Aug 2013
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: how to detect mouse click on qwtPlot?

    I am facinfg the problem with qwtplot when i am click the plot i want to show menu but i can't Please help

Similar Threads

  1. How to disable mouse click over a QSplashScreen
    By graciano in forum Qt Programming
    Replies: 2
    Last Post: 8th November 2009, 16:02
  2. QGraphicItem mouse click detection
    By PrimeCP in forum Qt Programming
    Replies: 3
    Last Post: 20th July 2007, 11:35
  3. QListWidget right-mouse click
    By Skizmo in forum Qt Programming
    Replies: 6
    Last Post: 20th June 2007, 13:13
  4. mouse click in QGprahicsScene
    By Morea in forum Qt Programming
    Replies: 11
    Last Post: 21st December 2006, 08:21
  5. mouse click event
    By vijay anandh in forum Qt Programming
    Replies: 1
    Last Post: 1st May 2006, 09:24

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.