1 Attachment(s)
Tooltip of widget not visible in QGraphicsProxyWidget
Hi,
I've embedded a QCustomPlot item into a container widget; and embedded this container widget into a QGraphicsProxyWidget. And i've inserted this proxywidget into QGraphicsScene. QCustomPlot 's events have some problems with QGraphicsProxyWidget. Jscurlee' s solution fixes most of the problem. But i also needed to show a tooltip for plots and used Ross 's solution.
As a result; i can see a tooltip box when i hover on the graph line; but texts of the tooltip are invisible as below:
Attachment 11697
Now i am stuck here, any idea?
Thanks,
Yigit
Re: Tooltip of widget not visible in QGraphicsProxyWidget
Maybe you can draw directly in a custom item instead of embedding a widget?
Then you wouldn't have to proxy between widgets and graphicsscene and have full control over what you do.
Cheers,
_
Re: Tooltip of widget not visible in QGraphicsProxyWidget
Hi Anda,
Do you mean i should port QCustomPlot item into a QGraphicsPlotItem?
Re: Tooltip of widget not visible in QGraphicsProxyWidget
That might be better for the long run if that is possible.
Embedding widgets into a graphics scene can get ugly, as things like events need to be mapped back and forth between two very different worlds.
A custom graphics item is usually more upfront work but you also better control on drawing and user interaction.
Usually embedding widgets makes only sense if it is one of the standard widgets, e.g. QComboBox, which are quite complicated to replicated visually and behavioralwise.
Cheers,
_
Re: Tooltip of widget not visible in QGraphicsProxyWidget
Life would be much easier if that tooltip had worked; but anyway... :-)
Edit: I think proxy causes a palette related issue. Calling setPalette after tooltip's showText function solved the problem for now.
Code:
QToolTip::showText(helpEvent
->globalPos
(), ttip
);