| 12345678910111213141516171819202122232425262728 | #include "dropshadowmgr.h"#include "idropshadowable.h"#include <QEvent>DropShadowMgr::DropShadowMgrGarbo DropShadowMgr::garbo;DropShadowMgr* DropShadowMgr::sm_pInstance = new DropShadowMgr(nullptr);     //初始化静态单例(饿汉):QList<BoxShadow> DropShadowMgr::sm_cacheShadows;/** * @brief 绘制注册到这里的阴影效果 * @param watched * @param event * @return */bool DropShadowMgr::eventFilter(QObject *watched, QEvent *event){    IDropShadowable *pDropShadowableObj = dynamic_cast<IDropShadowable*>(watched);    if(pDropShadowableObj == nullptr)    {        return QObject::eventFilter(watched, event);    }    if(event->type() == QEvent::Paint)    {        pDropShadowableObj->PaintShadows();    }    return QObject::eventFilter(watched, event);}
 |