Reputation: 1042
I have a global stylesheet selector (the '*' block) which changes font properties for all Qt widgets in the application. However, that also affects QToolTip - not desired. How do you exclude QToolTip from being affected by the global selector? I couldn't find a stylesheet operator for exclusion.
I can of course not use the global selector and copy the shared styles for every possible widget type. Obviously this is cumbersome, not scalable, clutters the QSS and may not provide full coverage. I'm looking for a better solution.
Upvotes: 0
Views: 863
Reputation: 18514
QToolTip
uses font from widget. You apply another font to widget so this font applies also to tooltip. To avoid this try to use html
tooltip:
ui->lineEdit->setToolTip("<font face =\"aharoni\">test</font>");
ui->lineEdit->setText("test");
Result with aharoni
font (for better visual comparison):
with *{font-family:consolas}
stylesheet.
Upvotes: 1