Qt 主窗体设置Qt::FramelessWindowHint 标志,界面有时候不再接收paint消息

当窗体设置framelesswindowhint后, this->setWindowFlags(Qt::FramelessWindowHint);

窗体就变得不会刷新了...比如点击按钮改变按钮的文字, 其他子窗体嵌在主窗体中实时刷新的功能.

解决方法

重写showEvent

void showEvent(QShowEvent *event) {
this->setAttribute(Qt::WA_Mapped);
QWidget::showEvent(event);

}


参考引用 点击打开链接

猜你喜欢

转载自blog.csdn.net/jiaojinlin/article/details/80078375
QT