Qt之QSS(黑色炫酷)

简述

Qt助手中有关于各种部件的QSS详细讲解,资源很丰富,请参考:Qt Style Sheets Examples。

黑色炫酷 - 一款漂亮的QSS风格。

之前博客中分享了很多关于Qt的样式效果,几乎都是基下面此样式。

你可以直接使用,也可以随意转载,但请务必保留版权声明和许可声明,请参考“声明”部分。

声明

  • 被授权人权利

被授权人有权利使用、复制、修改、合并、出版发行、散布、再授权及贩售软件及软件的副本。 
被授权人可根据程序的需要修改授权条款为适当的内容。

  • 被授权人义务

在软件和软件的所有副本中都必须包含版权声明和许可声明。

效果

这里写图片描述

这里写图片描述

QSS

/*
* The MIT License (MIT)
*
* Copyright : http://blog.csdn.net/liang19890820
*
* Author : 一去丶二三里
*
* Date : 2016/07/22
*
* Description : 黑色炫酷
*
*/

/**********子界面背景**********/
QWidget#customWidget {
        background: rgb(68, 69, 73);
}

/**********子界面中央背景**********/
QWidget#centerWidget {
        background: rgb(50, 50, 50);
}

/**********主界面样式**********/
QWidget#mainWindow {
        border: 1px solid rgb(50, 50, 50);
        background: rgb(50, 50, 50);
}

QWidget#messageWidget {
        background: rgba(68, 69, 73, 50%);
}

QWidget#loadingWidget {
        border: none;
        border-radius: 5px;
        background: rgb(50, 50, 50);
}

QWidget#remoteWidget {
        border-top-right-radius: 10px;
        border-bottom-right-radius: 10px;
        border: 1px solid rgb(45, 45, 45);
        background: rgb(50, 50, 50);
}

StyledWidget {
        qproperty-normalColor: white;
        qproperty-disableColor: gray;
        qproperty-highlightColor: rgb(0, 160, 230);
        qproperty-errorColor: red;
}

QProgressIndicator {
        qproperty-color: rgb(175, 175, 175);
}

/**********提示**********/
QToolTip{
        border: 1px solid rgb(45, 45, 45);
        background: white;
        color: black;
}

/**********菜单栏**********/
QMenuBar {
        background: rgb(57, 58, 60);
        border: none;
}
QMenuBar::item {
        padding: 5px 10px 5px 10px;
        background: transparent;
}
QMenuBar::item:enabled {
        color: rgb(227, 234, 242);
}
QMenuBar::item:!enabled {
        color: rgb(155, 155, 155);
}
QMenuBar::item:enabled:selected {
        background: rgba(255, 255, 255, 40);
}

/**********菜单**********/
QMenu {
        border: 1px solid rgb(100, 100, 100);
        background: rgb(68, 69, 73);
}
QMenu::item {
        height: 22px;
        padding: 0px 25px 0px 20px;
}
QMenu::item:enabled {
        color: rgb(225, 225, 225);
}
QMenu::item:!enabled {
        color: rgb(155, 155, 155);
}
QMenu::item:enabled:selected {
        color: rgb(230, 230, 230);
        background: rgba(255, 255, 255, 40);
}
QMenu::separator {
        height: 1px;
        background: rgb(100, 100, 100);
}
QMenu::indicator {
        width: 13px;
        height: 13px;
}
QMenu::icon {
        padding-left: 2px;
        padding-right: 2px;
}

/**********状态栏**********/
QStatusBar {
        background: rgb(57, 58, 60);
}
QStatusBar::item {
        border: none;
        border-right: 1px solid rgb(100, 100, 100);
}

/**********分组框**********/
QGroupBox {
        font-size: 15px;
        border: 1px solid rgb(80, 80, 80);
        border-radius: 4px;
        margin-top: 10px;
}
QGroupBox::title {
        color: rgb(175, 175, 175);
        top: -12px;
        left: 10px;
}

/**********页签项**********/
QTabWidget::pane {
        border: none;
        border-top: 3px solid rgb(0, 160, 230);
        background: rgb(57, 58, 60);
}
QTabWidget::tab-bar {
        border: none;
}
QTabBar::tab {
        border: none;
        border-top-left-radius: 4px;
        border-top-right-radius: 4px;
        color: rgb(175, 175, 175);
        background: rgb(255, 255, 255, 30);
        height: 28px;
        min-width: 85px;
        margin-right: 5px;
        padding-left: 5px;
        padding-right: 5px;
}
QTabBar::tab:hover {
        background: rgb(255, 255, 255, 40);
}
QTabBar::tab:selected {
        color: white;
        background: rgb(0, 160, 230);
}

QTabWidget#tabWidget::pane {
        border: 1px solid rgb(45, 45, 45);
        background: rgb(57, 58, 60);
        margin-top: -1px;
}

QTabBar#tabBar::tab {
        border: 1px solid rgb(45, 45, 45);
        border-bottom: none;
        background: transparent;
}
QTabBar#tabBar::tab:hover {
        color: white;
}
QTabBar#tabBar::tab:selected {
        color: white;
        background: rgb(57, 58, 60);
}

/**********表头**********/
QHeaderView{
        border: none;
        border-bottom: 3px solid rgb(0, 160, 230);
        background: rgb(57, 58, 60);
        min-height: 30px;
}
QHeaderView::section:horizontal {
        border: none;
        color: white;
        background: transparent;
        padding-left: 5px;
}
QHeaderView::section:horizontal:hover {
        background: rgb(0, 160, 230);
}
QHeaderView::section:horizontal:pressed {
        background: rgb(0, 180, 255);
}
QHeaderView::up-arrow {
        width: 13px;
        height: 11px;
        padding-right: 5px;
        image: url(:/Black/topArrow);
        subcontrol-position: center right;
}
QHeaderView::up-arrow:hover, QHeaderView::up-arrow:pressed {
        image: url(:/Black/topArrowHover);
}
QHeaderView::down-arrow {
        width: 13px;
        height: 11px;
        padding-right: 5px;
        image: url(:/Black/bottomArrow);
        subcontrol-position: center right;
}
QHeaderView::down-arrow:hover, QHeaderView::down-arrow:pressed {
        image: url(:/Black/bottomArrowHover);
}

/**********表格**********/
QTableView {
        border: 1px solid rgb(45, 45, 45);
        background: rgb(57, 58, 60);
        gridline-color: rgb(60, 60, 60);
}
QTableView::item {
        padding-left: 5px;
        padding-right: 5px;
        border: none;
        background: rgb(72, 72, 74);
        border-right: 1px solid rgb(45, 45, 45);
        border-bottom: 1px solid rgb(45, 45, 45);
}
QTableView::item:selected {
        background: rgba(255, 255, 255, 40);
}
QTableView::item:selected:!active {
        color: white;
}
QTableView::indicator {
        width: 20px;
        height: 20px;
}
QTableView::indicator:enabled:unchecked {
        image: url(:/Black/checkBox);
}
QTableView::indicator:enabled:unchecked:hover {
        image: url(:/Black/checkBoxHover);
}
QTableView::indicator:enabled:unchecked:pressed {
        image: url(:/Black/checkBoxPressed);
}
QTableView::indicator:enabled:checked {
        image: url(:/Black/checkBoxChecked);
}
QTableView::indicator:enabled:checked:hover {
        image: url(:/Black/checkBoxCheckedHover);
}
QTableView::indicator:enabled:checked:pressed {
        image: url(:/Black/checkBoxCheckedPressed);
}
QTableView::indicator:enabled:indeterminate {
        image: url(:/Black/checkBoxIndeterminate);
}
QTableView::indicator:enabled:indeterminate:hover {
        image: url(:/Black/checkBoxIndeterminateHover);
}
QTableView::indicator:enabled:indeterminate:pressed {
        image: url(:/Black/checkBoxIndeterminatePressed);
}

/**********滚动条-水平**********/
QScrollBar:horizontal {
        height: 20px;
        background: transparent;
        margin-top: 3px;
        margin-bottom: 3px;
}
QScrollBar::handle:horizontal {
        height: 20px;
        min-width: 30px;
        background: rgb(68, 69, 73);
        margin-left: 15px;
        margin-right: 15px;
}
QScrollBar::handle:horizontal:hover {
        background: rgb(80, 80, 80);
}
QScrollBar::sub-line:horizontal {
        width: 15px;
        background: transparent;
        image: url(:/Black/arrowLeft);
        subcontrol-position: left;
}
QScrollBar::add-line:horizontal {
        width: 15px;
        background: transparent;
        image: url(:/Black/arrowRight);
        subcontrol-position: right;
}
QScrollBar::sub-line:horizontal:hover {
        background: rgb(68, 69, 73);
}
QScrollBar::add-line:horizontal:hover {
        background: rgb(68, 69, 73);
}
QScrollBar::add-page:horizontal,QScrollBar::sub-page:horizontal {
        background: transparent;
}

/**********滚动条-垂直**********/
QScrollBar:vertical {
        width: 20px;
        background: transparent;
        margin-left: 3px;
        margin-right: 3px;
}
QScrollBar::handle:vertical {
        width: 20px;
        min-height: 30px;
        background: rgb(68, 69, 73);
        margin-top: 15px;
        margin-bottom: 15px;
}
QScrollBar::handle:vertical:hover {
        background: rgb(80, 80, 80);
}
QScrollBar::sub-line:vertical {
        height: 15px;
        background: transparent;
        image: url(:/Black/arrowTop);
        subcontrol-position: top;
}
QScrollBar::add-line:vertical {
        height: 15px;
        background: transparent;
        image: url(:/Black/arrowBottom);
        subcontrol-position: bottom;
}
QScrollBar::sub-line:vertical:hover {
        background: rgb(68, 69, 73);
}
QScrollBar::add-line:vertical:hover {
        background: rgb(68, 69, 73);
}
QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical {
        background: transparent;
}

QScrollBar#verticalScrollBar:vertical {
        margin-top: 30px;
}

/**********下拉列表**********/
QComboBox {
        height: 25px;
        border-radius: 4px;
        border: 1px solid rgb(100, 100, 100);
        background: rgb(72, 72, 73);
}
QComboBox:enabled {
        color: rgb(175, 175, 175);
}
QComboBox:!enabled {
        color: rgb(155, 155, 155);
}
QComboBox:enabled:hover, QComboBox:enabled:focus {
        color: rgb(230, 230, 230);
        background: rgb(68, 69, 73);
}
QComboBox::drop-down {
        width: 20px;
        border: none;
        background: transparent;
}
QComboBox::drop-down:hover {
        background: rgba(255, 255, 255, 30);
}
QComboBox::down-arrow {
        image: url(:/Black/arrowBottom);
}
QComboBox::down-arrow:on {
        /**top: 1px;**/
}
QComboBox QAbstractItemView {
        border: 1px solid rgb(100, 100, 100);
        background: rgb(68, 69, 73);
        outline: none;
}
QComboBox QAbstractItemView::item {
        height: 25px;
        color: rgb(175, 175, 175);
}
QComboBox QAbstractItemView::item:selected {
        background: rgba(255, 255, 255, 40);
        color: rgb(230, 230, 230);
}

/**********进度条**********/
QProgressBar{
        border: none;
        text-align: center;
        color: white;
        background: rgb(48, 50, 51);
}
QProgressBar::chunk {
        background: rgb(0, 160, 230);
}

QProgressBar#progressBar {
        border: none;
        text-align: center;
        color: white;
        background-color: transparent;
        background-image: url(":/Black/progressBar");
        background-repeat: repeat-x;
}
QProgressBar#progressBar::chunk {
        border: none;
        background-color: transparent;
        background-image: url(":/Black/progressBarChunk");
        background-repeat: repeat-x;
}

/**********复选框**********/
QCheckBox{
        spacing: 5px;
}
QCheckBox:enabled{
        color: rgb(175, 175, 175);
}
QCheckBox:enabled:hover{
        color: rgb(200, 200, 200);
}
QCheckBox:!enabled{
        color: rgb(155, 155, 155);
}
QCheckBox::indicator {
        width: 20px;
        height: 20px;
}
QCheckBox::indicator:unchecked {
        image: url(:/Black/checkBox);
}
QCheckBox::indicator:unchecked:hover {
        image: url(:/Black/checkBoxHover);
}
QCheckBox::indicator:unchecked:pressed {
        image: url(:/Black/checkBoxPressed);
}
QCheckBox::indicator:checked {
        image: url(:/Black/checkBoxChecked);
}
QCheckBox::indicator:checked:hover {
        image: url(:/Black/checkBoxCheckedHover);
}
QCheckBox::indicator:checked:pressed {
        image: url(:/Black/checkBoxCheckedPressed);
}
QCheckBox::indicator:indeterminate {
        image: url(:/Black/checkBoxIndeterminate);
}
QCheckBox::indicator:indeterminate:hover {
        image: url(:/Black/checkBoxIndeterminateHover);
}
QCheckBox::indicator:indeterminate:pressed {
        image: url(:/Black/checkBoxIndeterminatePressed);
}

/**********单选框**********/
QRadioButton{
        spacing: 5px;
}
QRadioButton:enabled{
        color: rgb(175, 175, 175);
}
QRadioButton:enabled:hover{
        color: rgb(200, 200, 200);
}
QRadioButton:!enabled{
        color: rgb(155, 155, 155);
}
QRadioButton::indicator {
        width: 20px;
        height: 20px;
}
QRadioButton::indicator:unchecked {
        image: url(:/Black/radioButton);
}
QRadioButton::indicator:unchecked:hover {
        image: url(:/Black/radioButtonHover);
}
QRadioButton::indicator:unchecked:pressed {
        image: url(:/Black/radioButtonPressed);
}
QRadioButton::indicator:checked {
        image: url(:/Black/radioButtonChecked);
}
QRadioButton::indicator:checked:hover {
        image: url(:/Black/radioButtonCheckedHover);
}
QRadioButton::indicator:checked:pressed {
        image: url(:/Black/radioButtonCheckedPressed);
}

/**********输入框**********/
QLineEdit {
        border-radius: 4px;
        height: 25px;
        border: 1px solid rgb(100, 100, 100);
        background: rgb(72, 72, 73);
}
QLineEdit:enabled {
        color: rgb(175, 175, 175);
}
QLineEdit:enabled:hover, QLineEdit:enabled:focus {
        color: rgb(230, 230, 230);
}
QLineEdit:!enabled {
        color: rgb(155, 155, 155);
}

/**********文本编辑框**********/
QTextEdit {
        border: 1px solid rgb(45, 45, 45);
        color: rgb(175, 175, 175);
        background: rgb(57, 58, 60);
}

/**********滚动区域**********/
QScrollArea {
        border: 1px solid rgb(45, 45, 45);
        background: rgb(57, 58, 60);
}

/**********滚动区域**********/
QWidget#transparentWidget {
        background: transparent;
}

/**********微调器**********/
QSpinBox {
        border-radius: 4px;
        height: 24px;
        min-width: 40px;
        border: 1px solid rgb(100, 100, 100);
        background: rgb(68, 69, 73);
}
QSpinBox:enabled {
        color: rgb(220, 220, 220);
}
QSpinBox:enabled:hover, QLineEdit:enabled:focus {
        color: rgb(230, 230, 230);
}
QSpinBox:!enabled {
        color: rgb(65, 65, 65);
        background: transparent;
}
QSpinBox::up-button {
        width: 18px;
        height: 12px;
        border-top-right-radius: 4px;
        border-left: 1px solid rgb(100, 100, 100);
        image: url(:/Black/upButton);
        background: rgb(50, 50, 50);
}
QSpinBox::up-button:!enabled {
        border-left: 1px solid gray;
        background: transparent;
}
QSpinBox::up-button:enabled:hover {
        background: rgb(255, 255, 255, 30);
}
QSpinBox::down-button {
        width: 18px;
        height: 12px;
        border-bottom-right-radius: 4px;
        border-left: 1px solid rgb(100, 100, 100);
        image: url(:/Black/downButton);
        background: rgb(50, 50, 50);
}
QSpinBox::down-button:!enabled {
        border-left: 1px solid gray;
        background: transparent;
}
QSpinBox::down-button:enabled:hover {
        background: rgb(255, 255, 255, 30);
}

/**********标签**********/
QLabel#grayLabel {
        color: rgb(175, 175, 175);
}

QLabel#highlightLabel {
        color: rgb(175, 175, 175);
}

QLabel#redLabel {
        color: red;
}

QLabel#grayYaHeiLabel {
        color: rgb(175, 175, 175);
        font-size: 16px;
}

QLabel#blueLabel {
        color: rgb(0, 160, 230);
}

QLabel#listLabel {
        color: rgb(0, 160, 230);
}

QLabel#lineBlueLabel {
        background: rgb(0, 160, 230);
}

QLabel#graySeperateLabel {
        background: rgb(45, 45, 45);
}

QLabel#seperateLabel {
        background: rgb(80, 80, 80);
}

QLabel#radiusBlueLabel {
        border-radius: 15px;
        color: white;
        font-size: 16px;
        background: rgb(0, 160, 230);
}

QLabel#skinLabel[colorProperty="normal"] {
        color: rgb(175, 175, 175);
}
QLabel#skinLabel[colorProperty="highlight"] {
        color: rgb(0, 160, 230);
}

QLabel#informationLabel {
        qproperty-pixmap: url(:/Black/information);
}

QLabel#errorLabel {
        qproperty-pixmap: url(:/Black/error);
}

QLabel#successLabel {
        qproperty-pixmap: url(:/Black/success);
}

QLabel#questionLabel {
        qproperty-pixmap: url(:/Black/question);
}

QLabel#warningLabel {
        qproperty-pixmap: url(:/Black/warning);
}

QLabel#groupLabel {
        color: rgb(0, 160, 230);
        border: 1px solid rgb(0, 160, 230);
        font-size: 15px;
        border-top-color: transparent;
        border-right-color: transparent;
        border-left-color: transparent;
}

/**********按钮**********/
QToolButton#nsccButton{
        border: none;
        color: rgb(175, 175, 175);
        background: transparent;
        padding: 10px;
        qproperty-icon: url(:/Black/nscc);
        qproperty-iconSize: 32px 32px;
        qproperty-toolButtonStyle: ToolButtonTextUnderIcon;
}
QToolButton#nsccButton:hover{
        color: rgb(217, 218, 218);
        background: rgb(255, 255, 255, 20);
}

QToolButton#transferButton{
        border: none;
        color: rgb(175, 175, 175);
        background: transparent;
        padding: 10px;
        qproperty-icon: url(:/Black/transfer);
        qproperty-iconSize: 32px 32px;
        qproperty-toolButtonStyle: ToolButtonTextUnderIcon;
}
QToolButton#transferButton:hover{
        color: rgb(217, 218, 218);
        background: rgb(255, 255, 255, 20);
}

/**********按钮**********/
QPushButton{
        border-radius: 4px;
        border: none;
        width: 75px;
        height: 25px;
}
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);
}

QPushButton#blueButton {
        color: white;
}
QPushButton#blueButton:enabled {
        background: rgb(0, 165, 235);
        color: white;
}
QPushButton#blueButton:!enabled {
        background: gray;
        color: rgb(200, 200, 200);
}
QPushButton#blueButton:enabled:hover {
        background: rgb(0, 180, 255);
}
QPushButton#blueButton:enabled:pressed {
        background: rgb(0, 140, 215);
}

QPushButton#selectButton {
        border: none;
        border-radius: none;
        border-left: 1px solid rgb(100, 100, 100);
        image: url(:/Black/scan);
        background: transparent;
        color: white;
}
QPushButton#selectButton:enabled:hover{
        background: rgb(85, 85, 85);
}
QPushButton#selectButton:enabled:pressed{
        background: rgb(80, 80, 80);
}

QPushButton#linkButton {
        background: transparent;
        color: rgb(0, 160, 230);
        text-align:left;
}
QPushButton#linkButton:hover {
        color: rgb(20, 185, 255);
        text-decoration: underline;
}
QPushButton#linkButton:pressed {
        color: rgb(0, 160, 230);
}

QPushButton#transparentButton {
        background: transparent;
}

/*****************标题栏按钮*******************/
QPushButton#minimizeButton {
        border-radius: none;
        border-bottom-left-radius: 4px;
        border-bottom-right-radius: 4px;
        background: rgb(50, 50, 50);
        image: url(:/Black/minimize);
}
QPushButton#minimizeButton:hover {
        background: rgb(60, 60, 60);
        image: url(:/Black/minimizeHover);
}
QPushButton#minimizeButton:pressed {
        background: rgb(55, 55, 55);
        image: url(:/Black/minimizePressed);
}

QPushButton#maximizeButton[maximizeProperty="maximize"] {
        border-radius: none;
        border-bottom-left-radius: 4px;
        border-bottom-right-radius: 4px;
        background: rgb(50, 50, 50);
        image: url(:/Black/maximize);
}
QPushButton#maximizeButton[maximizeProperty="maximize"]:hover {
        background: rgb(60, 60, 60);
        image: url(:/Black/maximizeHover);
}
QPushButton#maximizeButton[maximizeProperty="maximize"]:pressed {
        background: rgb(55, 55, 55);
        image: url(:/Black/maximizePressed);
}

QPushButton#maximizeButton[maximizeProperty="restore"] {
        border-radius: none;
        border-bottom-left-radius: 4px;
        border-bottom-right-radius: 4px;
        background: rgb(50, 50, 50);
        image: url(:/Black/restore);
}
QPushButton#maximizeButton[maximizeProperty="restore"]:hover {
        background: rgb(60, 60, 60);
        image: url(:/Black/restoreHover);
}
QPushButton#maximizeButton[maximizeProperty="restore"]:pressed {
        background: rgb(55, 55, 55);
        image: url(:/Black/restorePressed);
}

QPushButton#closeButton {
        border-radius: none;
        border-bottom-left-radius: 4px;
        border-bottom-right-radius: 4px;
        background: rgb(50, 50, 50);
        image: url(:/Black/close);
}
QPushButton#closeButton:hover {
        background: rgb(60, 60, 60);
        image: url(:/Black/closeHover);
}
QPushButton#closeButton:pressed {
        background: rgb(55, 55, 55);
        image: url(:/Black/closePressed);
}

QPushButton#skinButton {
        border-radius: none;
        border-bottom-left-radius: 4px;
        border-bottom-right-radius: 4px;
        background: rgb(50, 50, 50);
        image: url(:/Black/skin);
}
QPushButton#skinButton:hover {
        background: rgb(60, 60, 60);
        image: url(:/Black/skinHover);
}
QPushButton#skinButton:pressed {
        background: rgb(55, 55, 55);
        image: url(:/Black/skinPressed);
}

QPushButton#feedbackButton {
        border-radius: none;
        border-bottom-left-radius: 4px;
        border-bottom-right-radius: 4px;
        background: rgb(50, 50, 50);
        image: url(:/Black/feedback);
}
QPushButton#feedbackButton:hover {
        background: rgb(60, 60, 60);
        image: url(:/Black/feedbackHover);
}
QPushButton#feedbackButton:pressed {
        background: rgb(55, 55, 55);
        image: url(:/Black/feedbackPressed);
}

QPushButton#closeTipButton {
        border-radius: none;
        border-image: url(:/Black/close);
        background: transparent;
}
QPushButton#closeTipButton:hover {
        border-image: url(:/Black/closeHover);
}
QPushButton#closeTipButton:pressed {
        border-image: url(:/Black/closePressed);
}

QPushButton#changeSkinButton{
        border-radius: 4px;
        border: 2px solid rgb(41, 41, 41);
        background: rgb(51, 51, 51);
}
QPushButton#changeSkinButton:hover{
        border-color: rgb(45, 45, 45);
}
QPushButton#changeSkinButton:pressed, QPushButton#changeSkinButton:checked{
        border-color: rgb(0, 160, 230);
}

QPushButton#transferButton {
        padding-left: 5px;
        padding-right: 5px;
        color: white;
        background: rgb(0, 165, 235);
}
QPushButton#transferButton:hover {
        background: rgb(0, 180, 255);
}
QPushButton#transferButton:pressed {
        background: rgb(0, 140, 215);
}
QPushButton#transferButton[iconProperty="left"] {
        qproperty-icon: url(:/Black/left);
}
QPushButton#transferButton[iconProperty="right"] {
        qproperty-icon: url(:/Black/right);
}

QPushButton#openButton {
        border-radius: none;
        image: url(:/Black/open);
        background: transparent;
}
QPushButton#openButton:hover {
        image: url(:/Black/openHover);
}
QPushButton#openButton:pressed {
        image: url(:/Black/openPressed);
}

QPushButton#deleteButton {
        border-radius: none;
        image: url(:/Black/delete);
        background: transparent;
}
QPushButton#deleteButton:hover {
        image: url(:/Black/deleteHover);
}
QPushButton#deleteButton:pressed {
        image: url(:/Black/deletePressed);
}

QPushButton#menuButton {
        text-align: left center;
        padding-left: 3px;
        color: rgb(175, 175, 175);
        border: 1px solid rgb(100, 100, 100);
        background: rgb(72, 72, 73);
}
QPushButton#menuButton::menu-indicator{
        subcontrol-position: right center;
        subcontrol-origin: padding;
        image: url(:/Black/arrowBottom);
        padding-right: 3px;
}
  • 6
    点赞
  • 55
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
回答: Qt Style Sheets (QSS) 是一种用于美化Qt界面的编程语言,其语法和CSS基本一样。你可以使用QSS来实现炫酷的界面效果。通过自定义QSS样式,你可以改变控件的外观,包括边框、背景、字体等。你可以使用QSS来实现自定义的系统标题栏,以避免在不同操作系统下出现不一致的外观。你还可以实现拖动、最大化、最小化等功能,并支持多种主题和皮肤切换。如果你希望子窗口能像Visual Studio一样随意拖动和布局,也可以通过QSS来实现。下面是一个使用QSS的例子,可以让QLineEdit控件在不同状态下显示不同的样式: QLineEdit { border: 0px; margin: 10px; margin-left: 50px; margin-right: 50px; border-bottom: 2px solid #B3B3B3; font-family: 'Microsoft YaHei'; font-size: 20px; font-weight: bold; } QLineEdit:hover { border-bottom: 3px solid #66A3FF; } QLineEdit:focus { border-bottom: 3px solid #E680BD; } 通过修改这些样式,你可以实现自己想要的炫酷界面效果。希望对你有帮助!\[2\]\[3\] #### 引用[.reference_title] - *1* *3* [[PYQT5]如何做出精美界面,让你的软件高n个档次,QSS实例教程--不定时更新--part1[QLineEdit]](https://blog.csdn.net/mahuatengmmp/article/details/105757396)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [发布十几套Qt精美皮肤(Qt使用QSS进行界面美化)](https://blog.csdn.net/weixin_41749063/article/details/108789096)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值