Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-114193

QMessageBox not cross-platform

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Not Evaluated
    • None
    • 6.5.1
    • None
    • macOS, Windows

    Description

      Qt is cross-platform, i.e. largely platform independent. This is also stated on the website and it should be true for the normal widgets (e.g. QWidgets).

      I'm using QMessageBox to inform my users about certain things. However, QMessageBox does not behave cross-platform. It behaves completely different on MacOS as opposed to Windows (and Linux). See here two samples of QMessageBox behaviour on Windows and MacOS:

      Windows MacOS

      This is not what I'd expect as 'cross-platform'. Worse, I've got QMessageBox'es with even more text and on MacOS the width stays the same and it starts displaying a scroll bar, and also the formatting that I had used is completely removed.

      So I had to create a 'zcMsgBox' class that replaces QMessageBox, which, I think, should not have been necessary. See below the output on Windows and MacOS of my zcMsgBox class:

      Windows MacOS

      This is what I expected in the first place.

      I think this is a bug. One cannot trust Qt to be cross-platform when using QMessageBox, while it should behave the same on all platforms.

      I see a related bug: https://bugreports.qt.io/browse/QTBUG-111803.

      Of course one would want some native dialogs, like "File Open Dialogs", etc. But I don't think this one is OK. I'd rather would want to enable native QMessageBox dialogs with a separate switch, than disabling al native dialogs together with a switch.

       

       

      Attachments

        1. image-2023-06-02-21-28-22-732.png
          33 kB
          Hans Dijkema
        2. image-2023-06-02-21-30-06-179.png
          52 kB
          Hans Dijkema
        3. QMessageBox-MacOSX.png
          67 kB
          Hans Dijkema
        4. image-2023-06-02-21-30-31-194.png
          67 kB
          Hans Dijkema
        5. image-2023-06-02-21-33-17-084.png
          52 kB
          Hans Dijkema
        6. zcMsgBox-MacOSX.png
          44 kB
          Hans Dijkema
        7. image-2023-06-02-21-33-47-473.png
          44 kB
          Hans Dijkema
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            richard Richard Moe Gustavsen
            hansdijkema Hans Dijkema
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes