Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.8.0
-
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.