Results 1 to 5 of 5

Thread: Plot Graph in tooltip

  1. #1
    Join Date
    Feb 2010
    Posts
    31
    Thanks
    1
    Qt products
    Qt3 Qt4 Qt/Embedded Qt Jambi
    Platforms
    Windows

    Question Plot Graph in tooltip

    Hi

    I want to plot a graph of values read from a file in a tooltip of the cells which contains the index name for which data is to be plotted.
    I am using QTableWidget. By using the following:

    Qt Code:
    1. table->item(rowIndex, i)->setToolTip("Variable Name: " + table->item(rowIndex, i)->data(0)->toString());
    To copy to clipboard, switch view to plain text mode 

    am able to get the variable name in the tootltip. But how can I insert a plot in the tooltip.
    Is there any alternative way of doing so?
    I have to use tablewidget.

    Thanks for any help in advance.-

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Plot Graph in tooltip

    You will need to install event filter for your table widget and catch tooltip event and show your custom widget.

  3. #3
    Join Date
    Feb 2010
    Posts
    31
    Thanks
    1
    Qt products
    Qt3 Qt4 Qt/Embedded Qt Jambi
    Platforms
    Windows

    Default Re: Plot Graph in tooltip

    Hi Aamer4yu

    Thanks.
    But How to do that?

  4. #4
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Plot Graph in tooltip

    Read about QObject::installEventFilter. or QWidget::event.
    Then check the event type. It must be QEvent::Tooltip. When that condition is met, show your custom widget and return true to indicate that the event was processed.

  5. #5
    Join Date
    Feb 2010
    Posts
    31
    Thanks
    1
    Qt products
    Qt3 Qt4 Qt/Embedded Qt Jambi
    Platforms
    Windows

    Default Re: Plot Graph in tooltip

    Quote Originally Posted by aamer4yu View Post
    Read about QObject::installEventFilter. or QWidget::event.
    Then check the event type. It must be QEvent::Tooltip. When that condition is met, show your custom widget and return true to indicate that the event was processed.
    Hi Aamer4yu

    Can you help me with a sample code pls.
    I have tried to get it but am unable to do so.

    Thanks in advance.

Similar Threads

  1. how to plot scatter graph?
    By rambo83 in forum Qwt
    Replies: 0
    Last Post: 25th February 2010, 12:24
  2. Replies: 15
    Last Post: 27th May 2008, 01:46
  3. Replies: 1
    Last Post: 22nd May 2008, 15:10
  4. Displaying tooltip for points in the graph
    By Ankitha Varsha in forum Qt Programming
    Replies: 4
    Last Post: 29th January 2008, 11:08
  5. How to plot a graph in Qt ?
    By vinod in forum Qt Programming
    Replies: 2
    Last Post: 27th April 2006, 13:44

Tags for this Thread

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.