beautiful qss codes

本文详细介绍如何使用Qt样式表(QSS)来定制Qt应用程序的界面风格,包括颜色、字体及各种控件的状态样式。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

/*WINDOW*/
QFrame {
    color: white;
    background: black;
    border-radius: 0px;
    border: 0px solid white;
}

QWidget {
    color: white;
    background: black;
    border-radius: 0px;
    border: 0px solid white;
}

QGraphicsView{
    background: black;
    border-radius: 0px;
    border: 0px solid white;
}

QLabel {
    color: white;
    border: 0;
    background: rgba(0,0,0,0);
    font-weight: bold;
    font-family: "Verdana";
}

QPushButton{
    background: black;
    border-radius: 0px;
    color: white;
    border: 1px solid white;
    width: 90px
}

QLineEdit{
    background: black;
    border-radius: 0px;
    border: 1px solid white;
}

QListView{
    background: black;
    border-radius: 0px;
    border: 1px solid rgb(180, 180, 180 );
}

/*RADIOBUTTON*/
QRadioButton{
    color: white;
    font: bold;
    font-size: 12px;
}

QRadioButton::indicator{
    width: 20px;
    height: 20px;
}

QRadioButton::indicator::checked {
    background: white;
    border-radius: 4px;
    border: 1px solid white;
}

QRadioButton::indicator::unchecked {
    background: black;
    border-radius: 4px;
    border: 1px solid white;
}
/*=======================================*/

/*CHECKBOX*/
QCheckBox{
    color: white;
    font: bold ;
    font-size: 12px;
}

QCheckBox::indicator{
    width: 20px;
    height: 20px;
}
QCheckBox::indicator::checked {
    background: white;
    border-radius: 4px;
    border: 1px solid white;
}

QCheckBox::indicator::unchecked {
    background: black;
    border-radius: 4px;
    border: 1px solid white;
}
/*=======================================*/

QComboBox{
    background: black;
    border-radius: 8px;
    border: 1px solid white;
    font: bold ;
    font-size: 12px;
}

QComboBox:editable {
    background: black;
}

QComboBox:!editable, QComboBox::drop-down:editable {
    background: black;
}

/* QComboBox gets the "on" state when the popup is open */
QComboBox:!editable:on, QComboBox::drop-down:editable:on {
    background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
                             stop: 0 #D3D3D3, stop: 0.4 #D8D8D8,
                             stop: 0.5 #DDDDDD, stop: 1.0 #E1E1E1);
}

QComboBox:on { /* shift the text when the popup opens */
     padding-top: 3px;
     padding-left: 4px;
}

QComboBox::drop-down {
     subcontrol-origin: padding;
     subcontrol-position: top right;
     width: 15px;

     border-left-width: 1px;
     border-left-color: darkgray;
     border-left-style: solid; /* just a single line */
     border-top-right-radius: 3px; /* same radius as the QComboBox */
     border-bottom-right-radius: 3px;
}

QComboBox QAbstractItemView {
    background: black;
    border-radius: 0px;
}


/*SPECYFIC!!!!!!!!!!!!!!!!!!!!!!!!!!*/
/*RouteWindow*/
#toButton,#fromButton,#nearestButton{
    background: black;
    border-radius: 8px;
    border: 1px solid white;
    color: white;
}

#toButton:pressed,#fromButton:pressed,#nearestButton:pressed,#nearestClrButton:pressed{
    background: black;
}
QFullScreenFrame{
    color: white;
    background: black;
    border-radius: 0px;
}

/*SLIDER*/
QSlider::groove:vertical {
    width: 4px;
    margin: 6px;
    background: black;
    border-radius: 2px;
    border: 1px solid white;
}

QSlider::handle:vertical {
    background: black;
    border-radius: 4px;
    border: 1px solid white;
    color:#000;
    height:8px;
    margin: 0 -6px; /* expand outside the groove */
}
/*=============================================================*/

/*TABWIDGET*/
#tabWidget {
    background: black;
}
QTabWidget {
    background: black;
}
QTabWidget::pane {
    background: black;
}
QTabWidget::tab-bar {
    background: black;
    left: 5px;
}
QTabBar::tab {
    background: black;
    min-width: 150px;
    padding: 4px;
    color: white;
    font-weight: bold;
    height: 30px;
}
QTabBar::tab:selected {
    font-size: 24px;
}

QListWidget::item {
    height: 30px;
    color: white;
    font: bold ;
    font-size: 18px;
}

QGroupBox {
    background: rgba(0, 0, 0, 0);
}

QGroupBox::title {
    color: white;
    font-size: 16px;
    font-weight: bold;
    border: 0px;
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值