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

QStatusBar::showMessage makes prepared QPainter unusable and causes crash

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.8.0
    • GUI: Painting
    • None
    • Qt 5.8.0, openSUSE Leap 42.2, KDE

    Description

      A call of QStatusBar::showMessage makes a previously prepared QPainter unusable, the application aborts in one of the Q_ASSERTs of qpaintengine_raster.cpp:

          QRasterPaintEngineState *s = state();
          Q_ASSERT(s);
      

      To reproduce the bug, extract the attached "qtbug.zip" and qmake/make the contained application "app". In mainwnd.cpp (MainWnd::eventFilter) you find two braches. If you activate the first (#if 1), the bug occurs. If you activate the second (#if 0), the application works.

      Note, that the #if 0-case is only seemingly a practicable workaround, because QStatusBar::showMessage might be called anytime from everywhere, e.g. from a central QtMessageHandler.

      Additionally consider to replace the Q_ASSERTs (which came in with Qt 5.6.1) by a more graceful error handling.

      Attachments

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

        Activity

          People

            sletta Gunnar Sletta
            wschenke Winfried Schenke
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes