I have QPushButtons in QTreeView strings and they appear with these black borders around them that I cannot change. Currently I can gray buttons with this code:
for (int i = 0; i < QPalette::NColorRoles; i++){ QPalette::ColorRole thisRole = static_cast<QPalette::ColorRole>(i); QColor newColor = commitPalette.color(QPalette::Disabled,thisRole); int grayColor = qGray(newColor.rgb()); newColor.setRgb(grayColor,grayColor,grayColor,50); commitPalette.setColor(QPalette::Disabled, thisRole, newColor); }
But he does nothing for the border. I would prefer not to use stylesheets as I like the automatic color generation provided by the QPalette constructor

source share