QT_menu_设置背景透明和去阴影边框

        r_menu->setWindowFlags(r_menu->windowFlags() | Qt::FramelessWindowHint);
        r_menu->setAttribute(Qt::WA_TranslucentBackground);

        HWND hwnd = reinterpret_cast<HWND>(r_menu->winId());
        DWORD class_style = ::GetClassLong(hwnd, GCL_STYLE);
        class_style &= ~CS_DROPSHADOW;
        ::SetClassLong(hwnd, GCL_STYLE, class_style);

 

posted @ 2017-05-23 15:30  细雨细语  阅读(1585)  评论(1编辑  收藏  举报