设置菜单栏菜单样式(鼠标移入移出状态,背景颜色,字体颜色大小,间距,边框)

setStyleSheet(“QMenuBar{”
“background:rgb(255,255,255);”
“color:rgb(0,0,0);”
“font-size:14px;”
“padding:2px;”
“border:1px solid rgb(165,171,184);”
“}”
“QMenuBar::item{”
“background:rgb(255,255,255);”
“width:52px;”
“height:24px;”
“}”
“QMenuBar::item:selected{”
“background:rgb(185,196,221);”
“}”
“QMenu{”
“background:rgb(255,255,255);”
“color:rgb(0,0,0);”
“border:1px solid rgb(165,171,184);”
“}”
“QMenu::item:selected{” //鼠标移入
“background:rgb(69,123,255);”
“color:white;”
“}”
“QMenu::item:disabled{” //不可点击
“background:rgb(224,224,224);”
“color:rgb(153,153,153);”
“}”);

猜你喜欢

转载自blog.csdn.net/DarkSying/article/details/85014556