pyqt5-8.qss样式美化1

pyqt中对样式的编辑是借鉴了css,qt的样式美化规则是叫qss,其语法与css一样,所以在我什么都不了解的时候,要去看一下css语法是怎样,
https://www.runoob.com/css/css-tutorial.html
菜鸟教程的css篇,看起来很多,静下来看3-4个小时就看完了,然后再看下qss,qss就是把css的里面类的名字换成了qt里面的控件,其他的几乎没什么变化,当然,qss是没有css强大的,所以有些功能可能无法使用,但是美化界面应该足够用了。
下面贴一个qss的文件,供参考:

QLineEdit#e1_serch{
    border:1px solid gray;
    width:300px;
    border-radius:10px;
    padding:2px 4px;
    background-image: url(:/icon/images/icon/fangdajing.png);
    background-repeat: no-repeat;
    background-position: left;
    padding: 2 2 2 30;
}

QPushButton#new_Button{
    font-family: "Microsoft YaHei";
    font-weight: bold;
    border:1px solid gray;
    border-radius: 14px;
    color: black;
    background-color: transparent;
}

QPushButton#new_Button:hover{
    font-family: "Microsoft YaHei";
    font-weight: bold;
    border-radius: 14px;
    color: black;
    background-color: #21aefa;
}

QPushButton#upload_Button{
    font-family: "Microsoft YaHei";
    font-weight: bold;
    border:1px solid gray;
    border-radius: 14px;
    color: black;
    background-color:transparent;
}

QPushButton#upload_Button:hover{
    font-family: "Microsoft YaHei";
    font-weight: bold;
    border-radius: 14px;
    color: black;
    background-color: #21aefa;
}

QPushButton#e1_message{
    border: none;
}

QPushButton#user_info_Button{
    border: none;
}
QPushButton#copy_Button{
    border: none;
}
QPushButton#edit_Button{
    border: none;
}
QPushButton#pushButton_2{
    border: none;
}
QPushButton#pushButton_4{
    border: none;
}

QTabWidget:pane
{
       border-top: 1px solid #E5E5E5;
       border-left:1px solid #E5E5E5;
       position: absolute;
       font-size: 14px;
}
QTabWidget:tab-bar {
        border-bottom: 2px solid #E5E5E5;
        border-left:1px solid #E5E5E5;
        alignment: left;
        font-size: 14px;
}
QTabBar:tab {
    border: none;
    border-bottom-color: #C2C7CB; /* same as the pane color */
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
    min-width: 60px;
    width:60px;
    padding: 2px;
       font-size: 14px;
}
QTabBar:tab:hover {
       color:#2080F7;
}
QTabBar:tab:selected {
       color:#2080F7;
       border-bottom: 2px solid #2080F7;
       font-weight:bold;
}

/* QPushButton{border:none;color:black;} */


QLabel{background:white;}
QLabel{color:rgb(100,100,100,25%);font-size:15px;font-weight:bold;font-family:Roman times;}
QLabel:hover{color:rgb(100,100,100,12%);}")



QScrollBar::handle{background:rgba(0,0,0,50%); border:2px solid transparent; border-radius:5px; }
QScrollBar::handle:hover{background:rgba(0,0,0,50%);border:0px rgba(0,0,0,25%); }

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

WenCoo

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值