修改qte启动时默认背景颜色

来源:互联网 发布:mysql多主多从 编辑:程序博客网 时间:2024/04/30 16:28
默认的qt启动时的背景色是绿色的,可以用两种方法进行修改:

1、在自己的程序中添加以下三句,可启动时背景颜色为白色。

     QBrush  brush=QWSServer::instance()->backgroundBrush();
     brush.setColor(Qt::white);
     QWSServer::setBackground(brush);

2、直接修改qt的代码,修改src/gui/embedded/qwindowsystem_qws.cpp

//****************************modify start.
    //if (!bgBrush)
     //   bgBrush = new QBrush(QColor(0x20, 0xb0, 0x50));
    if (!bgBrush)
        bgBrush = new QBrush(QColor(0xff, 0xff, 0xff));
//****************************modify end.

从新编译qte库,大功告成!
原创粉丝点击