今天查了一些文档,准备自己一步一步地使用Qss来模仿一下windows的Metro风格, 我不会CSS也不会Qss全是查文档而来的,所以有点粗糙,今天是QPushbutton的Qss代码:
03 | color : rgb ( 255 , 255 , 255 ); |
04 | background-color : rgb ( 167 , 205 , 255 ); |
07 | font-family : "Verdana" ; |
11 | QPushButton:hover, QPushButton:pressed , QPushButton:checked |
13 | background-color : rgb ( 85 , 170 , 255 ); |
20 | background-image : url (:/ icon /icons/dark/appbar.navigate.next.png); |
21 | background-repeat : no-repeat ; |
22 | background-position : center left ; |
24 | QPushButton:pressed, QPushButton:checked |
26 | background-image : url (:/ icon /icons/light/appbar.navigate.next.png); |
27 | background-repeat : no-repeat ; |
28 | background-position : center left ; |
其中用到了两张资源图片(http://modernuiicons.com/ 下载的Metro图标)作为美化,在hovering到按钮上面的时候和按下的时候用不同的颜色。
下面是效果图。