Search code examples
pythonenumspyqtattributeerrorpyqt6

PyQt6: Qt module enums raise AttributeError


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'

Solution

  • That flag now lives here:

    QtCore.Qt.WindowType.FramelessWindowHint