目录(?)[+]

 

关于样式,前面介绍了很多内容,下面分享一个深色样式表,很值得借鉴!

 

 

效果

Qt之QSS(QDarkStyleSheet)

QSS

/*
 * The MIT License (MIT)
 *
 * Copyright (c) <2013-2014> <Colin Duquesnoy>
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:

 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.

 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
QToolTip
{
    border: 1px solid #76797C;
    background-color: rgb(90, 102, 117);;
    color: white;
    padding: 5px;
    opacity: 200;
}

QWidget
{
    color: #eff0f1;
    background-color: #31363b;
    selection-background-color:#3daee9;
    selection-color: #eff0f1;
    background-clip: border;
    border-image: none;
    outline: 0;
}

QWidget:item:hover
{
    background-color: #3daee9;
    color: #eff0f1;
}

QWidget:item:selected
{
    background-color: #3daee9;
}

QCheckBox
{
    spacing: 5px;
    outline: none;
    color: #eff0f1;
    margin-bottom: 2px;
}

QCheckBox:disabled
{
    color: #76797C;
}

QCheckBox::indicator,
QGroupBox::indicator
{
    width: 18px;
    height: 18px;
}
QGroupBox::indicator
{
    margin-left: 2px;
}

QCheckBox::indicator:unchecked
{
    image: url(:/qss_icons/rc/checkbox_unchecked.png);
}

QCheckBox::indicator:unchecked:hover,
QCheckBox::indicator:unchecked:focus,
QCheckBox::indicator:unchecked:pressed,
QGroupBox::indicator:unchecked:hover,
QGroupBox::indicator:unchecked:focus,
QGroupBox::indicator:unchecked:pressed
{
  border: none;
    image: url(:/qss_icons/rc/checkbox_unchecked_focus.png);
}

QCheckBox::indicator:checked
{
    image: url(:/qss_icons/rc/checkbox_checked.png);
}

QCheckBox::indicator:checked:hover,
QCheckBox::indicator:checked:focus,
QCheckBox::indicator:checked:pressed,
QGroupBox::indicator:checked:hover,
QGroupBox::indicator:checked:focus,
QGroupBox::indicator:checked:pressed
{
  border: none;
    image: url(:/qss_icons/rc/checkbox_checked_focus.png);
}


QCheckBox::indicator:indeterminate
{
    image: url(:/qss_icons/rc/checkbox_indeterminate.png);
}

QCheckBox::indicator:indeterminate:focus,
QCheckBox::indicator:indeterminate:hover,
QCheckBox::indicator:indeterminate:pressed
{
    image: url(:/qss_icons/rc/checkbox_indeterminate_focus.png);
}

QCheckBox::indicator:checked:disabled,

相关文章:

  • 2021-06-22
  • 2022-02-05
  • 2022-01-08
  • 2021-11-08
  • 2021-09-06
  • 2021-07-12
猜你喜欢
  • 2021-08-14
  • 2022-12-23
  • 2021-08-04
  • 2022-12-23
  • 2021-07-30
  • 2021-08-24
相关资源
相似解决方案