I have styled my tooltips like this (not really that colors)
QToolTip {
border: 1px solid blue;
border-radius: 10px;
background-color: red;
}
But the background is not clipped at the corners:
Why is it not clipped?
I have styled my tooltips like this (not really that colors)
QToolTip {
border: 1px solid blue;
border-radius: 10px;
background-color: red;
}
But the background is not clipped at the corners:
Why is it not clipped?
Two years after your question was asked, struggling with the same issue, using experiments and hard googling I came to the following:
setAttribute(Qt::WA_TranslucentBackground);
+ setMask()
work fine, as well as other, simplier ways to implement widget transparencyAt last, if you are really into it, recursively walking over widget's children and installing event filter could be a sufficient solution, smth like:
if (event->type() == QEvent::ToolTip) {
QHelpEvent *helpEvent = static_cast<QHelpEvent *>(event);
// Your code here
return true;
}
Easier it is if you don't wish to have those tooltips everywhere. Sometimes you already have to do something similar to apply complex CSS styles from files to dynamically created widgets, but anyway that's not a "codeless solution". Alas, couldn't find a better way up to now.
© 2022 - 2024 — McMap. All rights reserved.