在Qt 5.0.0中:
1、setAttribute(Qt::WA_TranslucentBackground)会把PNG图像中的透明部分弄黑;
2、setAttribute(Qt::WA_TranslucentBackground)与setWindowFlags(Qt::FramelessWindowHint)一起使用时,程序运行直接报错:"0x00000000" 指令引用的 "0x00000000" 内存。该内存不能为 "read"。
如下:
setWindowFlags(Qt::FramelessWindowHint);
setAttribute(Qt::WA_TranslucentBackground);
伏惟求解。望高手不吝赐教!多谢!