首页
Java
登录
6mi
u
盘
搜
搜 索
Java
04 QT设置背景色
04 QT设置背景色
xiaoxiao
2021-02-28
77
#include <QPalette>
#include <QColor>
void
MyForm::set_form_color(){
this
->setAutoFillBackground(
true
); QPalette pale =
this
->palette(); QColor BKG_COL(
0
,
0
,
0
); pale.setColor(
this
->backgroundRole(),BKG_COL);
//正确写法1
//pale.setColor(this->backgroundRole(),Qt::blue);//正确写法1
//pale.setColor(QPalette::Window,Qt::darkRed);//这种写法没有效果
this
->setPalette(pale); }
转载请注明原文地址: https://www.6miu.com/read-76557.html
技术
最新回复
(
0
)