当前位置: 代码迷 >> QT开发 >> QT样式表,生手求教,第一次发帖
  详细解决方案

QT样式表,生手求教,第一次发帖

热度:28   发布时间:2016-04-25 03:19:01.0
QT样式表,新手求教,第一次发帖,
新手在公司刚刚接触QT,项目迫紧,遇到问题,求教,


这些Qbutton现在这一个QFrame中,有没有办法把这些样式合并,给他加个边框,鼠标停留在上面显示半透明效果



audioFrame = QtGui.QFrame(self.__pcontainer)
playButton = QtGui.QPushButton(audioFrame)
         playButton.setObjectName(u"playlist_3" + suffix)
         playButton.setGeometry(0, 1, 40, 38)
         playButton.setCursor(QtCore.Qt.PointingHandCursor)
         playButton.setStyleSheet(u"""QPushButton{
                                        background:#000;
                                        image:url(images/Play2.png);
                                        border:0;border-right:1px solid #1a1a1a;}
                                    QPushButton:hover{
                                    background:#1a1a1a;}
                                    QPushButton:pressed,QPushButton:on{
                                        background:#c00;
                                        border:0;
                                        color:#fff;}""")

这个应该怎么改
------解决方案--------------------
你设置QFrame的hover状态下的边缘不就行了
------解决方案--------------------
QFrame:hover{
background-color:rgba(0,0,0,50);
}
  相关解决方案