PDA

View Full Version : Plot Graph in tooltip



abghosh
27th February 2010, 13:56
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:


table->item(rowIndex, i)->setToolTip("Variable Name: " + table->item(rowIndex, i)->data(0)->toString());

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.-

aamer4yu
27th February 2010, 19:04
You will need to install event filter for your table widget and catch tooltip event and show your custom widget.

abghosh
27th February 2010, 19:12
Hi Aamer4yu

Thanks.
But How to do that?

aamer4yu
27th February 2010, 19:22
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.

abghosh
1st March 2010, 05:10
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.