QT自定义工具条渐变背景颜色一例

使用样式定义:

cpp 复制代码
    QWidget* toolbar = new QWidget(this);
    toolbar->setObjectName("main_tool");
    toolbar->setStyleSheet("#main_tool{background: qlineargradient(x1:0 , y1:0 , x2:1 , y2:0,"
                           "stop:0    rgba(0,255,0, 0.2),"
                           "stop:0.2  rgba(0,255,0, 0.4),"
                           "stop:0.5  rgba(0,255,0, 0.5),"
                           "stop:0.8  rgba(0,255,0, 0.4),"
                           "stop:1    rgba(0,255,0, 0.2));}");
相关推荐
NiceCloud喜云7 小时前
Opus 4.8 的 Effort Control 怎么选:Low 到 Max 五档策略
android·java·大数据·前端·c++·python·spring
cjhbachelor7 小时前
c++继承
c++
wordbaby8 小时前
React Native + RNOH:跨页面数据回传的最佳实践与避坑指南
前端·react native
丷丩8 小时前
MapLibre GL JS第22课:查看本地GeoJSON
前端·javascript·map·mapbox·maplibre gl js
AI玫瑰助手8 小时前
Python函数:默认参数的定义与注意事项
开发语言·python·信息可视化
油炸自行车8 小时前
Claude Code 错误:API Error: 400 Failed to deserialize the JSON body into the
开发语言·javascript·json·trae·claude code·api error 400
肩上风骋8 小时前
C++14特性
开发语言·c++·c++14特性
读书札记20228 小时前
Qt界面卡死问题探讨及解决方法
qt
Front思9 小时前
AI前端工程师需要具备能力+
前端·人工智能·ai
JAVA社区9 小时前
Java高级全套教程(十)—— SpringCloudAlibaba超详细实战详解
java·开发语言·spring cloud·面试·职场和发展