解决方法

由于自定义该窗口的时候,调用了设置窗口标志的函数,此时需要添加一个标志this->windowFlags()。

1
setWindowFlags(this->windowFlags());