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

QMessageBox show/exec crashes when QStyle::drawControl(QStyle::CE_ProgressBar, ...) is used in an item delegate

    XMLWordPrintable

Details

    • qtbase/stable: c90626f189d5a3942d1e240d30121a2bdafde454

    Description

      I have an item delegate on a QTreeView, which uses QStyle::drawControl to draw a progress bar.

      void ItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
      {
      // [...] create progressBarOption...
      QApplication::style()->drawControl(QStyle::CE_ProgressBarContents, &progressBarOption, painter);
      }

      QStyle::CE_ProgressBar and CE_ProgressBarContents lead to a crash. All other values work fine. QStyle::drawComplexControl seems to work fine although I did not test all possible values.

      When I now open a QMessageBox by show(), exec(), its static methods and possibly other ways, the application crashes in QCoreApplication::notifyInternal.

      You can see the crash in action in the following github repository: https://github.com/Kampfgnom/QMessageBoxCrash

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            kampfgnom Niklas Wulf
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes