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: Unresolved
    • 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. scaling 100%.png
          scaling 100%.png
          3 kB
        2. scaling 125%.png
          scaling 125%.png
          4 kB
        3. scaling 150%.png
          scaling 150%.png
          4 kB

        Activity

          People

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

            Dates

              Created:
              Updated: