Details
-
Task
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
6.8.1
-
None
Description
The Pyside6 v6.8.1 example code below removes the window flag WindowMaximizeButtonHint to remove the maximize button of a window, but now also removes the close button:
from PySide6.QtWidgets import QApplication, QLabel from PySide6.QtCore import Qt import sys def main(): # Create application app = QApplication(sys.argv) # Create window from QLabel window = QLabel('Example') # Resize window window.resize(300, 150) # Bug: Line below should remove the maximize button only, but also removes the close button on Windows 11: window.setWindowFlags(window.windowFlags() & ~Qt.WindowMaximizeButtonHint) # Removing the close button only works: # To test this, uuncomment line below, comment out line above # window.setWindowFlags(window.windowFlags() & ~Qt.WindowCloseButtonHint) # Show window window.show() # Main loop sys.exit(app.exec()) if __name__ == '__main__': main()
This worked with previous Pyside6 v6.7.