在 Qt 中创建没有关闭按钮的 Window

Creating Window That Has No Close Button in Qt

有没有办法像下图那样创建 window,在 qt 设计器中没有关闭按钮?

要获得这样的外观,您需要使用 setWindowsFlags 函数,并传入 Qt::CustomizeWindowHint Qt::FramelessWindowHint,在 C++ 中,这看起来像 someUi->setWindowsFlags(Qt::CustomizeWindowHint | Qt::FramelessWindowHint)但我不确定 PyQt。