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

Two QPainters on same QWindow causes crash

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.5.1
    • GUI: Painting
    • None
    • Windows 7 x64

    Description

      By mistake I have created two QPainters on the same QWindow, causing a crash.

      The crash occurs when using the second QPainter to call QPainter::setBrush which calls QRasterPaintEngine::brushChanged, where in the following line :

      QRasterPaintEngineState *s = state();

      the pointer s is returned as zero (0), resulting in a crash when it is used.

      I have corrected my mistake and now use only one QPainter and my program works correctly.

      I have not found it mentioned in the documentation that two QPainters are not allowed, so I'm wondering if this is a bug, or a feature that needs to be documented. In the later case, a more graceful error might also be useful.

      Attachments

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

        Activity

          People

            sletta Gunnar Sletta
            harry_m Harry
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes