• 5458阅读
  • 6回复

QSplashScreen无法背景透明的解决办法 [复制链接]

上一主题 下一主题
离线cangyuegui
 

只看楼主 正序阅读 楼主  发表于: 2016-06-02
— 本帖被 XChinux 执行加亮操作(2016-06-13) —
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);

};

离线明ming

只看该作者 6楼 发表于: 2018-01-17
QPixmap start(":/picture/startlogo/startlogo/start.png");
    QSplashScreen SplashScreen(start);
    SplashScreen.setMask(start.mask());
    SplashScreen.show();

希望能给你帮助
离线cangyuegui

只看该作者 5楼 发表于: 2018-01-16
应该是5.3.0
时间过去比较久了
离线stlcours

只看该作者 4楼 发表于: 2018-01-15
回 cangyuegui 的帖子
cangyuegui:Qt自己的bug (2018-01-12 12:38) 

是哪个版本的bug?我用qt5.6.2没有这个问题
离线cangyuegui

只看该作者 3楼 发表于: 2018-01-12
回 stlcours 的帖子
stlcours:能不能讲讲原来的QSplashScreen为什么无法透明呢?它也是继承自QWidget呀~ (2016-11-04 22:46) 

Qt自己的bug
离线stlcours

只看该作者 2楼 发表于: 2016-11-04
能不能讲讲原来的QSplashScreen为什么无法透明呢?它也是继承自QWidget呀~
离线米饭拌面

只看该作者 1楼 发表于: 2016-11-04
QQ:32336134
快速回复
限100 字节
 
上一个 下一个