主窗体设置FramelessWindowHint后,窗体接收paint消息异常
解决方法:
重写showEvent函数
主窗体头文件里增加:
protected:
void showEvent(QShowEvent *event);
主窗体cpp文件里增加:
void xxxx::showEvent(QShowEvent* event)
{
this->setAttribute(Qt::WA_Mapped);
QWidget::showEvent(event);
}