I need to show a very complex tooltip for a widget. This tooltip should contain several texts (some of the texts are bold) organized in a form or table and also contain a dynamically generated image (painter to pixmap with QPainter). I know that QToolTip::showText(pos, text) can accept a rich-text/HTML formatted text. But since the subset of HTML which Qt supports is very limited, this is not sufficient in my usecase.
Is there a way to display a completely general QWidget with layouts, child widgets etc. as a tooltip? I do not require this tooltip to enable any user interaction, so not buttons, checkboxes, text edits etc. Just images and formatted text labels in generic layouts (in other words - just read-only widgets).
I know that I can instantiate QWidget with Qt::ToolTip window flag. But this does not solve my problem at all, I would still need to implement timers for show-up or close-down of the tooltip, react to mouse-move events, keeping just a single instance, etc. I checked the source code of QToolTip and the code is really complex... I do not want to duplicate this complex code.
Note that I have created a feature request https://bugreports.qt.io/browse/QTBUG-106785 so that Qt can enable this out of the box.
So is there any simple workaround before (if ever) this gets imlemented?