首页 > 其他 > 详细

QSplashScreen无法背景透明的解决办法(强制StyleSheet生效)

时间:2016-06-02 19:57:46      阅读:200      评论:0      收藏:0      [点我收藏+]

setWindowFlags(Qt::WindowStaysOnTopHint | Qt::SplashScreen | Qt::FramelessWindowHint);

setAttribute(Qt::WA_NoBackground, true);
setAttribute(Qt::WA_NoSystemBackground, true);
setAttribute(Qt::WA_TranslucentBackground, true);


解决SplashScreen无法加载Stylesheet
void MySplash::paintEvent(QPaintEvent *e)
{
    //强制StyleSheet生效
    QStyleOption opt;
    opt.init(this);
    QPainter p(this);
    style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);

    return QSplashScreen::paintEvent(e);

};

http://www.qtcn.org/bbs/read-htm-tid-61177.html

QSplashScreen无法背景透明的解决办法(强制StyleSheet生效)

原文:http://www.cnblogs.com/findumars/p/5554070.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!