QWidget实现透明的方式

1     this->setWindowFlags(Qt::FramelessWindowHint);
2     this->setAttribute(Qt::WA_TranslucentBackground, true);

特别注意:

不能把QWidget设置为最大化,也就是不能调用showMinimized()这个函数,它调用后窗口永远设置不了透明。

相关文章: