I need to translate the following code from PyQt5 (It works there) to PyQt6:
self.setWindowFlags(Qt.FramelessWindowHint)
This is the error:
AttributeError: type object 'Qt' has no attribute 'FramelessWindowHint'
I've already tried this:
self.setWindowFlags(Qt.WindowFlags.FramelessWindowHint)
It says:
AttributeError: type object 'Qt' has no attribute 'WindowFlags'
Qt.FramelessWindowHint
) and as attributes of the enum itself (e.g.Qt.WindowType.FramelessWindowHint
); but in PyQt6, only the latter is supported. It should also be noted that PyQt6 always uses the name of the enum type rather than the flags type (see e.g. Qt::WindowFlags). – Conscionable