解决qt5窗口不刷新(测试窗口类型,测试窗口属性)

时间:2021-06-27 23:13:30

QApplication::notify


#if QT_VERSION >= 0x050000
        if (QEvent::Show == pEvent->type())
        {
            if (pObject->isWidgetType())
            {
                QWidget* pWidget = qobject_cast<QWidget*>(pObject);
                if ((NULL != pWidget) && !pWidget->testAttribute(Qt::WA_Mapped))
                {
                    pWidget->setAttribute(Qt::WA_Mapped);
                }
            }
        }
#endif

 

http://www.qtcn.org/bbs/apps.php?q=diary&a=detail&did=2240&uid=140408