自定义QSS

/*QComboBox*/

QComboBox {
border: 1px solid rgb(111, 156, 207);
border-radius: 3px;
padding: 1px 18px 1px 3px;
min-width: 6em;
max-width:6em;
}
QComboBox::drop-down {
subcontrol-origin: padding;
subcontrol-position: top right;
width: 15px;
border-left-width: 1px;
border-left-color: darkgray;
border-left-style: solid;
border-top-right-radius: 3px;
border-bottom-right-radius: 3px;
}
QComboBox QAbstractItemView {
border: 2px solid darkgray;
selection-background-color: lightgray;
}

/*QLineEdit*/

QLineEdit{
min-width:50px;
max-width:50px;
border: 2px solid gray;
border-radius: 10px;
padding: 0 8px;
background: yellow;
selection-background-color: darkgray;
}

/*QPushButton*/

QPushButton{
min-width:75px;
max-width:75px;
min-height:20px;
border:1px solid black;
border-radius:5px;
}
QPushButton:hover{
background-color: #333333;
border-color: #444444;
color:rgb(255,255,255);
}
QPushButton:pressed{
background-color: #111111;
border-color: #333333;
color: yellow;
}

/*QTabWidget*/
QTabWidget::tab-bar {
alignment: left;
}
QTabWidget::pane {
border-top: 2px solid #C2C7CB;
}
QTabBar::tab:selected {
margin-top:0px;
border-color: #9B9B9B;
border-bottom-color: #C2C7CB;
}
QTabBar::tab:!selected {
margin-top: 2px;
}
QTabBar::tab {
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #E1E1E1, stop: 0.4 #DDDDDD,
stop: 0.5 #D8D8D8, stop: 1.0 #D3D3D3);
border: 2px solid #C4C4C3;
border-bottom-color: #C2C7CB;
border-top-left-radius: 4px;
border-top-right-radius: 4px;
min-width: 8ex;
padding: 2px;
}

/*QWidget*/
QWidget{
background-color:#F5F5F5;
}

/*QGroupBox*/
QGroupBox {
border: 2px solid gray;
border-radius: 5px;
margin-top: 1ex;
}
QGroupBox::title {
subcontrol-origin: margin;
subcontrol-position: top center;
padding: 0 3px;
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #FF0ECE, stop: 1 #FFFFFF);
}

/*QCheckBox*/

QCheckBox::indicator{
width: 13px;
height: 13px;
background-color: #00FF00;
border: 1px solid #000000;
border-radius:4px;
}
QCheckBox::indicator::checked{
background-color: qradialgradient(cx:0.5, cy:0.5, fx:0.25, fy:0.15,
radius:0.3, stop:0 #FF0000, stop:1 #FFFFFF);
}

/*QtextEdit*/

QTextEdit{
border: 1px solid gray;
border-radius: 5px;
}
QTextEdit#textEdit{
background-color: rgb(235, 255, 203);
}
QTextEdit#textEdit_2{
background-color: rgb(194, 255, 194);
}
QTextEdit#textEdit_3{
background-color: rgb(170, 255, 127);
}
QScrollBar:vertical{
width:8px;
background:rgba(0,0,0,0%);
margin:0px,0px,0px,0px;
padding-top:9px;
padding-bottom:9px;
}
QScrollBar::handle:vertical{
width:8px;
background:rgba(0,0,0,25%);
border-radius:4px;
min-height:20;
}
QScrollBar::handle:vertical:hover{
width:8px;
background:rgba(0,0,0,50%);
border-radius:4px;
min-height:20;
}

/*MainWindow设置背景图,为了防止不干扰其他控件,需要指定背景图只作用于MawinWindow*/

#MainWindow{background-image: url(:/new/prefix1/log1.jpg);}

 

/*登录界面*/

qss:

#Login{background-image: url(:/new/prefix1/timg1.jpg);}

QCheckBox::indicator{

width: 13px;

height: 13px;

background-color: #00FF00;

border: 1px solid #000000;

border-radius:4px;

}

QCheckBox::indicator::checked{

">radius:0.3, stop:0 #FF0000, stop:1 #FFFFFF);

}

/*QLineEdit {

border:1px solid gray;

border-radius: 1px;

background: yellow;

selection-background-color:blue;

min-width:200px;

min-height:25px;

} */

QLineEdit {

min-width:200px;

min-height:25px;

border: 1px solid rgb(41, 57, 85);

border-radius: 3px;

background: white;

selection-background-color: blue;

font-size: 14px ;

}

 

QLineEdit:hover {

border: 1px solid yellow;

}

QPushButton{

border-radius: 4px;

border: none;

min-width: 75px;

min-height: 35px;

}

QPushButton:enabled {

background: rgb(68, 69, 73);

color: white;

}

QPushButton:!enabled {

background: rgb(100, 100, 100);

color: rgb(200, 200, 200);

}

QPushButton:enabled:hover{

background: rgb(85, 85, 85);

}

QPushButton:enabled:pressed{

background: rgb(80, 80, 80);

}

 

/*QMenu*/

sysMenu->setStyleSheet("QMenu {background-color:rgb(89,87,87); border: 3px solid rgb(235,110,36);}\
QMenu::item{font - size: 10pt;color: rgb(225, 225, 225);border: 3px solid rgb(60, 60, 60);\
background - color:rgb(89, 87, 87);padding:16px 16px;margin:2px 2px;}\
QMenu::item:selected{background - color:rgb(235, 110, 36);}\
QMenu::item:pressed{border: 1px solid rgb(60, 60, 61);background - color: rgb(220, 80, 6); }");

 

转载于:https://www.cnblogs.com/judes/p/8046254.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值