I want to give some color to the area开发者_运维技巧 where they are toolbox buttons with icons (light grey on picture). Please help in determining what is a parameter style sheet?
If I understand correctly, you are trying to change the background color of the toolbar area.
Suppose I have a mainwindow with a toolbar called mainToolBar
. Here is what I did :
ui->mainToolBar->setStyleSheet("QWidget { background : red; } QToolButton { background : green; }");
The first part of the stylesheet will change the background color of the toolbar where there is no toolbuttons.
The second part of the stylesheet will change the background color of the toolbuttons.
Note : I tested the code snippet above on Windows, I suppose it should work on a Mac too, but I cannot guarantee.
精彩评论