How to round QToolTip corners with CSS and QT

后端 未结 1 910
梦谈多话
梦谈多话 2021-01-07 01:48

Please post some working example. The one below makes two borders: the rectangular background frame in black and a white outline with rounded edge. I can\'t believe it has n

相关标签:
1条回答
  • 2021-01-07 02:14

    The solution is to set a custom mask on tooltip widget. I can think of two ways of doing that:

    • Implement an own QStyle with a mask returned for QStyle::SH_ToolTip_Mask style hint. That is a generic way as default QToolTip would use this mask (example).

    • Create a custom QToolTip based class with a proper mask and then use QHelpEvent (QEvent::ToolTip) event of your widget to show it. It's not a generic solution as it requires to filter events on all widgets which need custom tooltip.

    0 讨论(0)
提交回复
热议问题