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

Cannot make a QMessageBox resizable

    XMLWordPrintable

Details

    Description

      I was trying to put a lot of text into a QMessageBox detailedText property. However the dialog size was too small to easily read all the text, so I wanted to make the message box resizable. I could not get this to work and had to implement my own 'report dialog' instead.

      I expected calling setSizeGripEnabled(true) on a QMessageBox to not just display a size grip but actually make the dialog resizable. It did not.
      I also tried various calls to setMaximumSize/setSizePolicy and even resize() but nothing would make the
      message box resizable - this was using setDetailedText() so that the message box was to some extent managing its own size when the details were hidden/shown.

      Instead I had a non-resizable message box that was too small to read the detailedText correctly.

      My suggestion is to either make the QMessageBox resizable OR remove the setSizeGripEnabled() and make it clear in the documentation that the message box is not resizable as I wasted many hours trying to make it work before giving up and writing my own dialog in far less time.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            monsen Marius Bugge Monsen
            janichol Andy Nichols
            Votes:
            3 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes