PyQt6:Qt 属性错误

PyQt6: AttributeError Qt

我需要将以下代码从 PyQt5(它在那里工作)翻译成 PyQt6:

self.setWindowFlags(Qt.FramelessWindowHint)

这是错误:

AttributeError: type object 'Qt' has no attribute 'FramelessWindowHint'

我已经试过了:

self.setWindowFlags(Qt.WindowFlags.FramelessWindowHint)

它说:

AttributeError: type object 'Qt' has no attribute 'WindowFlags'

该标志现在位于此处:

QtCore.Qt.WindowType.FramelessWindowHint