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.
加载中,请稍侯......
精彩评论