定义一个类WIn,继承于QMainWindow,而QMainWindow是继承于QWidget的;
class Win : public QMainWindow{}
QWidget里面有个设置窗口背景的方法setBackgroundColor();
而我在Win里面却无法使用它,为什么呢?如下
Win::Win( void )
{
setBackgroundColor("lightBlue");
}
出错提示:error: 'setBackgroundColor' was not declared in this scope