[Python] QMessageBox has clipped children widgets

Discussão em 'Python' iniciado por Stack, Abril 17, 2025.

  1. Stack

    Stack Membro Participativo

    I have a QMessageBox.question object that I use to confirm that the user wants to close the program. I also have a custom one that I use for showing errors. For whatever reason, since using PyQt6 they are appearing clipped? Where the text, buttons, and I con are all cut off, like this:

    [​IMG]

    Here’s some minimal code to create this:

    app = QtWidgets.QApplication(sys.argv)

    response = QtWidgets.QMessageBox.question(None, 'Question', 'Do you want to continue?',
    QtWidgets.QMessageBox.StandardButton.Yes | QtWidgets.QMessageBox.StandardButton.No)

    print("Response:", response)

    sys.exit()


    I know it’s not an issue of my computer specifically (I am using a Ubuntu 22.04 VirtualBox VM) because my coworker on an actual Linux machine sees the same thing. Versions are as follows:

    • Python: 3.10.12
    • PyQt6: 6.9.0
    • PyQt6-Qt6: 6.9.0
    • PyQt6_sip: 13.10.0

    Is there something I can do to fix this? It makes the program look very unpolished.

    Continue reading...

Compartilhe esta Página