pythonqtpyqttooltip

How to round QToolTip corners with CSS and QT


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 not been done before.

app.setStyleSheet("QToolTip {
font-size:9pt;
color:white; padding:2px;
border-width:2px;
border-style:solid;
border-radius:20px;
background-color: black;
border: 1px solid white;}")

Solution

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