QT设置无边框窗口和透明窗口

前言

有时候我们想做出比较好看的界面,这时候就要去掉qt原来的窗口标题栏。

1. 去除边框和使窗口透明

//去边框  同时保留窗口原有的属性
setWindowFlags(Qt::FramelessWindowHint | windowFlags() );

//把窗口背景设为透明
setAttribute(Qt::WA_TranslucentBackground);

2. 窗口置顶功能

setWindowFlags(Qt::WindowStaysOnTopHint);

猜你喜欢

转载自blog.csdn.net/gmq_syy/article/details/120233757
今日推荐