开发者

Qt Designer and stylesheets

I have derived a CalibrationWindow from QWidget, and I have a vector of CalibrationWindow*. Now, I'm trying to change the background color in the Designer with the following stylesheet:

#calibrationWindow
{
    background : rgb(220, 220, 220);
}

(The Qt object name is calibrationWindow). In the Designer, it look开发者_开发问答s as intended, but when I run the program, zilch. No effect whatsoever. I also tried using CalibrationWindow instead of #calibrationWindow, to no avail. I even put QWidget, but it affects the child widgets and not the parent, as I want.

Could anyone help? Thanks.


Sorry, I was not overriding the paintEvent() function... It's compulsory when subclassing from QWidget.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜