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

Playing back QPicture ignores QPainter::setPen(Qt::black)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 6.1.0 Alpha
    • 5.9.1, 5.13.2
    • GUI: Painting
    • None
    • Environment 1:
      Windows 10
      Qt 5.13.2 for VS2017 from Qt Online installer
      VS2019

      Environment 2:
      Windows 10
      Qt 5.9.1 for VS2013 from Qt Online installer
      VS2013
    • Windows
    • f8a175afba12325dcff4aee21b1b11dfde3d57e4 (qt/qtbase/dev)

    Description

      When painting on a QPicture and calling QPainter::setPen(Qt::black) before setting any other pen color this will later be ignored when playing back the picture inside another QPainter. Basically:

      QPicture pic;
      QPainter picPainter;
      picPainter.begin(&pic);
      picPainter.setPen(Qt::black); // ignored
      ...
      picPainter.end();
      QPainter painter(this);
      picPainter.play(&painter);

      There is a small example attached to reproduce the problem.

      Reproduce the bug:

      • Launch attached QPictureBug.zip
      • EXPECTED: one magenta line (top), one black line (bottom)
      • ACTUAL: two magenta lines

      If found two different workarounds which can be used by providing command line parameters "-w1" or "-w2".

      Attachments

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

        Activity

          People

            vgt Eirik Aavitsland
            simonschroeder Simon Schröder
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes