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

QPainter::drawPath crash in debug mode, but it works normally in release mode

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • Not Evaluated
    • None
    • 5.15.4
    • GUI: Painting
    • None
    • VS2022+Qt5.15.4MSVC2019_64
    • Windows

    Description

      When I draw a shape with an arc in a class that inherits from QGraphicsItem, an error will pop up in debug mode.But this pop-up will not appear in release mode.

      The code is roughly like this:

      void MyItem::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) 
      {
          //something else
         painter->save();
         if (this->GetLock())
         {
             painter->setBrush(QColor(51, 153, 255));
           painter->setOpacity(0.2);
         }
         painter->drawPath(path());     //When crashing, the breakpoint stops here
          painter->restore(); 
      }

       

      Attachments

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

        Activity

          People

            vgt Eirik Aavitsland
            jxz 新泽 焦
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes