开发者

Qt style sheet properties for toolbox buttons

开发者 https://www.devze.com 2023-03-13 13:27 出处:网络
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?

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?

Qt style sheet properties for toolbox buttons


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号