生活会辜负努力的人,但不会辜负一直努力的人

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

实现的效果

  • 正常状态下:黑底(背景色),白字(前景色),圆角,向外凸起;
  • 鼠标停留:背景和前景都反色;
  • 鼠标按下:背景色变为淡蓝色,向内凹陷;

    

class MyStyleSheet:

    @staticmethod
    def button_style():
        # 正常状态下:黑底(背景色),白字(前景色),圆角,向外凸起
        # 鼠标停留:背景和前景都反色
        # 鼠标按下:背景色变为淡蓝色,向内凹陷
        button_style = ("QPushButton{background-color:black; color:white; border-radius:10px; border:2px groove gray; border-style:outset;}"
                        "QPushButton:hover{background-color:white; color:black;}"
                        "QPushButton:pressed{background-color:rgb(85, 170, 255); border-style:inset; }")
       

        return button_style

 

posted on 2018-06-16 22:20  何许亻也  阅读(1073)  评论(0编辑  收藏  举报