据说这是QT5之后的BUG,还没有深入研究,只是找到了一个解决方法,这里做一下记录:
对窗口重载showEven,实现以下代码即可。
void BaseWindow::showEvent(QShowEvent *event)
{
#if QT_VERSION >= 0x050000
this->setAttribute(Qt::WA_Mapped);
#endif
QWidget::showEvent(event);
}
据说这是QT5之后的BUG,还没有深入研究,只是找到了一个解决方法,这里做一下记录:
对窗口重载showEven,实现以下代码即可。
void BaseWindow::showEvent(QShowEvent *event)
{
#if QT_VERSION >= 0x050000
this->setAttribute(Qt::WA_Mapped);
#endif
QWidget::showEvent(event);
}