Qss 支持这个吗,我使用之后按钮后只有黑色的圆角边线框。而chrome下这个css3用的很好?
Qss确定支持css3所有属性吗,除了那个层级嵌套继承关系?
写的不对,该怎么写呢?
#layoutWidget QPushButton:checked {
width: 68px;
height: 76px;
overflow: hidden;
background-image: -webkit-gradient(linear,0% 0%, 0% 100%, from(#8FBA95), to(#8FB694), color-stop(0.4,#406D43));
border-radius: 5px;
opacity: 0.6;
box-shadow: 0px 1px 0px 0px #5E7E60;
border: 1px solid #0D420E;
}
或者这个都不对:
#layoutWidget QPushButton:checked {
background: -webkit-gradient(linear, center top, center bottom,
from(#777777), color-stop(50%,#dddddd), to(#777777) );
border-radius: 5px;
opacity: 0.6;
box-shadow: 0px 1px 0px 0px #5E7E60;
border: 1px solid #0D420E;
}
------解决方案--------------------
QPushButton:pressed {
width: 68px; height: 76px;background: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 1, stop: 0 #E1E1E1,
stop: 0.4 #DDDDDD, stop: 0.5 #ffffff, stop: 1.0 #D3D3D3); border-radius: 5px; opacity: 0.6; border: 1px solid #0D420E; }
这样可以,QSS和CSS不完全相同