一套简约的qt 蓝色qss方案

打印 上一主题 下一主题

主题 988|帖子 988|积分 2964

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

x
一套简约的qt 蓝色qss方案

直接使用qss代码

  1. QMenu
  2. {
  3.     background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
  4.     stop:0 rgba(255, 255, 255, 240),
  5.     stop:0.2 rgba(255, 255, 255, 200),
  6.     stop:0.6 rgba(255, 255, 255, 160),
  7.     stop:1 rgba(255, 255, 255, 120));
  8.     qproperty-effect: blur(30px);
  9.     border-radius: 10px;
  10.     padding:4px 2px;
  11.     margin:4px 2px;
  12. }
  13. QMenu::item
  14. {
  15.     background-color: transparent;
  16.     padding:2px 15px;
  17.     margin:2px 2px;
  18.     height: 30px; /* 设置item的高度 */
  19.     border-radius: 4px;
  20. }
  21. QMenu::item:selected
  22. {
  23.     background-color: rgb(55,144,250);
  24. }
  25. /* 普通状态 */
  26. QPushButton {
  27.     background-color: rgb(220,220,220);/* 设置背景颜色 */
  28.     border: 1px solid rgb(200,200,200); /* 设置边框 */
  29.     border-radius: 10px;
  30.     min-height: 25px;
  31.     color: #000000; /* 设置文字颜色 */
  32.     padding:4px 20px;
  33.     margin:4px 4px;
  34. }
  35. /* 鼠标悬停状态 */
  36. QPushButton:hover {
  37.     background-color: rgb(55,144,250); /* 设置悬停时的背景颜色 */
  38.     color: #ffffff; /* 设置悬停时的文字颜色 */
  39. }
  40. /* 按下状态 */
  41. QPushButton:pressed {
  42.     background-color: rgb(44,133,240); /* 设置按下时的背景颜色 */
  43.     color: #ffffff; /* 设置按下时的文字颜色 */
  44. }
  45. /* 复选框选中状态 */
  46. QPushButton:checked {
  47.     background-color: rgb(55,144,250);  /* 设置选中时的背景颜色 */
  48.     color: #ffffff; /* 设置选中时的文字颜色 */
  49. }
  50. /* 按钮被选中状态 */
  51. QPushButton:pressed:checked {
  52.     background-color: rgb(44,133,240); /* 设置按钮被选中时的背景颜色 */
  53.     color: #ffffff; /* 设置按钮被选中时的文字颜色 */
  54. }
  55. QSlider::groove:horizontal {
  56.     border: 1px solid #bbb; /* 设置滑块轨道的边框 */
  57.     background: white; /* 设置滑块轨道的背景颜色 */
  58.     height: 8px; /* 设置滑块轨道的高度 */
  59.     margin: 2px 0; /* 设置滑块轨道与滑块的间距 */
  60.     border-radius: 4px; /* 设置滑块轨道的圆角 */
  61. }
  62. QSlider::handle:horizontal {
  63.     background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #eee, stop:1 #ccc); /* 设置滑块的背景渐变色 */
  64.     border: 1px solid #777; /* 设置滑块的边框 */
  65.     width: 14px; /* 设置滑块的宽度 */
  66.     margin: -2px 0; /* 设置滑块的边距 */
  67.     border-radius: 7px; /* 设置滑块的圆角 */
  68. }
  69. QSlider::handle:horizontal:hover {
  70.     background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #fff, stop:1 #ddd); /* 设置鼠标悬停时滑块的背景渐变色 */
  71.     border: 1px solid #888; /* 设置鼠标悬停时滑块的边框 */
  72. }
  73. QSlider::sub-page:horizontal {
  74.     background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #b9d6ff, stop:1 #add6ff); /* 设置已选择的部分的背景渐变色 */
  75.     border: 1px solid #999; /* 设置已选择的部分的边框 */
  76.     height: 8px; /* 设置已选择的部分的高度 */
  77.     border-radius: 4px; /* 设置已选择的部分的圆角 */
  78. }
  79. QSlider::add-page:horizontal {
  80.     background: #f0f0f0; /* 设置未选择的部分的背景颜色 */
  81.     border: 1px solid #999; /* 设置未选择的部分的边框 */
  82.     height: 8px; /* 设置未选择的部分的高度 */
  83.     border-radius: 4px; /* 设置未选择的部分的圆角 */
  84. }
  85. QComboBox {
  86.     border-radius: 5px; /* 设置圆角 */
  87.     border: 1px solid #c0c0c0; /* 设置边框 */
  88.     padding: 5px; /* 设置内边距 */
  89.     background-color: #f0f0f0; /* 设置背景颜色 */
  90. }
  91. QComboBox::drop-down {
  92.     border-top-right-radius: 5px; /* 设置下拉箭头右上角的圆角 */
  93.     border-bottom-right-radius: 5px; /* 设置下拉箭头右下角的圆角 */
  94.     border-left: 1px solid #c0c0c0; /* 设置下拉箭头左边的边框 */
  95.     background-color: #f0f0f0; /* 设置下拉箭头背景色 */
  96. }
  97. QComboBox::down-arrow:on {
  98.     top: 1px; /* 设置下拉箭头悬停时的位置 */
  99.     left: 1px; /* 设置下拉箭头悬停时的位置 */
  100. }
  101. QComboBox::down-arrow:on {
  102.     top: 1px;
  103.     left: 1px;
  104. }
  105. QComboBox::item:selected {
  106.     background-color: rgb(55,144,250); /* 设置选中项的背景色为蓝色 */
  107.     color: white; /* 设置选中项的文本颜色为白色 */
  108.     padding-left:0px; /* 设置选项的左边距 */
  109.     text-align: center; /* 将选项居中显示 */
  110.     border-radius: 5px; /* 设置圆角 */
  111. }
  112. QComboBox QAbstractItemView {
  113.     border-bottom-right-radius: 5px;
  114.     border-bottom-left-radius: 5px;
  115. }
  116. QLineEdit {
  117.     border: 1px solid #c0c0c0; /* 设置边框 */
  118.     border-radius: 5px; /* 设置边框的圆角半径 */
  119.     padding: 3px; /* 设置内边距 */
  120.     background-color: #f0f0f0; /* 设置背景颜色 */
  121.     selection-color: white; /* 设置选中文本的颜色 */
  122.     selection-background-color: blue; /* 设置选中文本的背景色 */
  123. }
  124. QLineEdit:focus {
  125.     border: 2px solid #0078d7; /* 设置获取焦点时的边框颜色 */
  126. }
  127. QCheckBox::indicator {
  128.     width: 15px; /* 设置复选框的宽度 */
  129.     height: 15px; /* 设置复选框的高度 */
  130. }
  131. QCheckBox {
  132.     spacing: 5px; /* 设置复选框和文本之间的间距 */
  133. }
  134. QCheckBox::indicator::unchecked {
  135.     border: 2px solid #c0c0c0; /* 设置未选中时的边框样式 */
  136.     border-radius: 5px; /* 设置未选中时的边框圆角 */
  137. }
  138. QCheckBox::indicator::checked {
  139.     border: 2px solid #0078d7; /* 设置选中时的边框样式 */
  140.     background-color: #0078d7; /* 设置选中时的背景颜色 */
  141.     border-radius: 5px; /* 设置未选中时的边框圆角 */
  142. }
复制代码
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
回复

使用道具 举报

0 个回复

倒序浏览

快速回复

您需要登录后才可以回帖 登录 or 立即注册

本版积分规则

瑞星

金牌会员
这个人很懒什么都没写!
快速回复 返回顶部 返回列表