本来子类widget使用Qt:FramelessWindowHint隐藏标题栏,发现背景会变透明,解决方法:
setWindowFlags(Qt::FramelessWindowHint | Qt::Dialog);