

Qt isn't so consistent when it comes to stylesheets but problems can be avoided by (1) and (3).

(3) By letting the current style engine do its job. (2) By setting bg and fg colors in such a way that a high contrast is always guaranteed and not setting margins/borders. (1) By using complete stylesheets or hard-coded styles, like the one used by Qt Creator for its menu-bar and side-pane Such problems may happen with Breeze and QtCurves too (I have several examples) but they show up mostly with Kvantum because Kvantum makes use of all available parameters while the other style engines set them to some fixed "Fusion values".Īll such problems can be avoided in 3 ways: This is an example of the QStyle-stylesheet problem. option->backgroundBrush should always have enough contrast with the text color but in this case it doesn't, perhaps, because highlightedText().color() is among the colors used by the stylesheet for painting the bg gradient. So Kvantum thinks there's a custom color for some reason (like in KSysGuard or Konsole preferences) and uses option->backgroundBrush for painting the interior of the active item (because backgroundBrush has a style in this case). Kvantum tries to guess custom bg colors before using its own SVG elements for drawing view-items but QStyle cannot read stylesheet gradients. In this example, drawPrimitive(PE_PanelItemViewItem,option,painter,widget) is called in Kvantum. The problem is that stylesheet values can't be accessed by QStyle. Yes, I meant that stylesheet but I can't be sure that it's the only cause - Wireshark is a large app with a large code.
