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?

www.app4tablet.com/marek/toolbar_color.png

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top