【问题标题】:PyQt6: AttributeError Qt [duplicate]PyQt6:AttributeError Qt [重复]
【发布时间】:2021-12-13 06:09:41
【问题描述】:

我需要将以下代码从 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'

【问题讨论】:

  • 请输入所有代码
  • 也许多一点代码会有所帮助。

标签: python pyqt pyqt6


【解决方案1】:

该标志现在在这里:

QtCore.Qt.WindowType.FramelessWindowHint

【讨论】:

    猜你喜欢
    • 2023-03-04
    • 2021-04-19
    • 1970-01-01
    • 2016-12-17
    • 2012-03-15
    • 2011-08-07
    • 1970-01-01
    相关资源
    最近更新 更多