Results 1 to 6 of 6

Thread: Tooltip in Qwt

  1. #1
    Join Date
    Oct 2006
    Location
    Bangalore
    Posts
    32
    Qt products
    Qt4
    Platforms
    Windows

    Question Tooltip in Qwt

    Hi,

    I am plotting graphs using QWT in my application (Qt4).


    Qt4 provides QTooltip class for displaying tooltips but I wanted to know whether QWT provides any function or class for displaying tooltips for the points in the graphs?

    Pls let me know

  2. #2
    Join Date
    Jun 2009
    Posts
    27
    Thanks
    3
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: Tooltip in Qwt

    Hi,

    Did you find the solution for this. I am trying to implement the same thing. A Tooltip that shows the name of the point. I have values (x,y) in two arrays and labels for these values in a 3rd array. How can I display the label of each point as tooltip.

    would appreciate for your help.


    cheers,

  3. #3
    Join Date
    May 2009
    Posts
    20
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Tooltip in Qwt

    Subclass a qwtplotpicker. Supply it with your data and what you want to display. Enable the tracker. enable mouse tracking on the plot. Attach it to the plot.

    the function virtual QwtText trackerText(const QwtDoublePoint & pos) const
    will receive points as the cursor moves over them and returns text based on whatever you want it to return.

  4. #4
    Join Date
    Jun 2009
    Posts
    27
    Thanks
    3
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: Tooltip in Qwt

    Hi Ban-Chan,

    Thanks for reply. I was actually looking at Qwtplotpicker class but problem with that was QwtPlotPicker (int xAxis, int yAxis, QwtPlotCanvas * canvas) has xAxis and yAxis as int but my data (xarray and yarray) are in double and secondly how can I pass label array in this constructor.

    I would really appreciate your help.

    cheers,

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

    Default Re: Tooltip in Qwt

    Quote Originally Posted by hamid ghous View Post
    I was actually looking at Qwtplotpicker class but problem with that was QwtPlotPicker (int xAxis, int yAxis, QwtPlotCanvas * canvas) has xAxis and yAxis as int but my data (xarray and yarray) are in double ...
    xAxis/yAxis specifies the axes ( = coordinate system ) of the picker but not the coordinates. Possible values are f.e yLeft/xBottom.

    Your answer shows that you completely misunderstood, what a picker is about.

    Uwe

  6. #6
    Join Date
    Jun 2009
    Posts
    27
    Thanks
    3
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: Tooltip in Qwt

    Hi Uwe,

    Yeh you are right I didnt understand what's actually Qwtplotpicker class is doing... I through its documentation again and again and now I am trying to implement it. But I am getting an error on my first step.
    Here is it..

    QwtPlotCanvas qc(myPlot);

    int xAxis = myPlot->xBottom;
    int yAxis=myPlot->yLeft;

    QwtPlotPicker *pk = new (xAxis, yAxis, QwtPicker::PointSelection , QwtPlotPicker::RectRubberBand, QwtPicker::AlwaysOn, qc);


    Error is: No matching function for call to QwtPlotPicker::QwtPlotPicker(.....)

    I know I am doing some kind of basic mistake but I have gone through some docs but couldnt find it y its giving me this error.

    Thanks for you help.

    cheers,

Similar Threads

  1. Hot to set the tooltip of button
    By santosh.kumar in forum Qt Programming
    Replies: 3
    Last Post: 1st November 2007, 13:07
  2. QWT introduction
    By nitriles in forum Qwt
    Replies: 4
    Last Post: 28th September 2007, 11:48
  3. Qwt 5.0.2
    By Uwe in forum Qt-based Software
    Replies: 1
    Last Post: 20th September 2007, 19:21
  4. How to upgrade Qwt 5.0.1 to Qwt 5.0.2
    By luffy27 in forum Qwt
    Replies: 1
    Last Post: 15th July 2007, 20:55
  5. use interesting QWT Library with QT3.X
    By raphaelf in forum Qwt
    Replies: 2
    Last Post: 23rd January 2006, 12: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.