主页面设置隐藏原来标题栏 this->setWindowFlags(Qt::FramelessWindowHint); UI中拉上控件 使用qss渲染一下子 * { font-family: "微软雅黑" } QWidget{ background: #E7EEF6; } QWidget#title{ background:qlineargradient(x1:0,y1:0,x2:1,y2:1,stop:0 #478fe1, stop:1 #0080cb); } 结果