QT setting flags, possible difference between Qt4 and Qt5

Hi Matthias-

The line below works w/o issues on Klayout 0.25.4 & QT 5.6.2
However, on Klayout 0.24.10 & QT 4.8.2 I get "Invalid number of arguments (got 1, expected 0) in Qt_QFlags_WindowType.new"
What is the reason for that? What is the right way to put it so it'll work on both versions?

Best regards,

self.setWindowFlags(pya.Qt_QFlags_WindowType(12))

Comments

  • Hi mikamar,

    please use 0.25.x which has this issue fixed. It's not related to Qt5 or 4, it's a problem in 0.24.x.

    And once you start using 0.25.x (0.25.4 is fine, but 0.25.5 is better), you should use the symbolic constants like you would do in C++:

    w = pya.QMainWindow()
    w.setWindowFlags(pya.Qt.Window)
    # or
    w.setWindowFlags(pya.Qt.Window | pya.Qt.WindowCloseButtonHint)
    # or 
    w.setWindowFlags(w.windowFlags | pya.Qt.WindowCloseButtonHint)
    # or this (windowFlags is treated as property):
    w.windowFlags = pya.Qt.Window | pya.Qt.WindowCloseButtonHint
    

    Regards,

    Matthias

  • Thank you!

Sign In or Register to comment.