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

Using QWidget::setMask with complicated QRegion introduces undesired transparent lines when using scaling 125%

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P1: Critical
    • None
    • 6.2.4
    • GUI: High-DPI
    • None
    • Windows 10
    • Windows

    Description

      Hello!

      I encountered following problem when using 125% scaling together with rounded rectangle set as mask with QWidgets::setMask the mask has invisible rows of pixels which should not be there. See attached screens.

       

      My observations:

      • Mask scale properly for scaling 100%, 150%, 175%, and 200%. The problem is only in 125%.
      • it does not matter whether mask is passed as QRegion or QBitmap

       

      // Add rounded corners using setMask to QDialog    
      QDialog* dialog = new QDialog();
      dialog->resize(600,400);
      QBitmap mask(dialog->size());
      mask.clear();
      QPainter p(&mask);
      p.setRenderHint(QPainter::Antialiasing);
      p.setPen(QColor(Qt::black));
      p.setBrush(QColor(Qt::black));
      p.drawRoundedRect(dialog->rect(), 50, 50);
      dialog->setMask(mask);
      dialog->exec(); 

      Attachments

        1. msorvig-scaling-125-6.2.jpg
          msorvig-scaling-125-6.2.jpg
          30 kB
        2. scaling 100%.png
          scaling 100%.png
          3 kB
        3. scaling 125%.png
          scaling 125%.png
          4 kB
        4. scaling 150%.png
          scaling 150%.png
          4 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            sorvig Morten Sørvig
            jakub-stasta Jakub Stasta
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes