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

Control widgets borders missing when high-dpi and scaling enabled

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.15.2, 6.0.0, 6.0.1, 6.1
    • None
    • Window 10 Professional 64bit
      Arch Linux KDE Plasma 5.20.4
      Screen Resolution 2560x1440
      OS scaling tested: 100%,125%,150%
    • Linux/X11, Windows

    Description

      Control widgets like QListWidget, QLineEdit, QPlainTextEdit, QComboBox, QSpinBox, QCheckBox and others are missing their frames/borders on some sides if high-dpi is enabled and OS scaling is enabled too.

      The missing borders differ on Windows and Linux and different OS scaling settings. And even different sizes or placement/alignments of the control widgets inside their parent window can cause this issue.

      Some control widget like QSpinBox or QCheckBox only show missing borders if they are clicked or checked. Others like QLineEdit show missing borders if mouse moves over the control widget (for later check QT "Line Edits Example").

      Please run following minimal example application on different OS's with different scaling settings to see the issue:

      #include <QApplication>
      #include <QListWidget>
      #include <QPlainTextEdit>
      #include <QLabel>
      
      int main(int argc, char *argv[])
      {
      //    QCoreApplication::setAttribute(Qt::AA_DisableHighDpiScaling);
          QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
      
          QApplication a(argc, argv);
          QWidget w;
          w.setGeometry(0,0,890,450);
      
          QLabel Label(&w);
          Label.setText("High DPI enabled - Linux KDE Plasma 150% scaling");
          Label.setGeometry(290,10,350,30);
      
          //----------------------------------------------
      
          QLabel LabelL(&w);
          LabelL.setText("QListWidget missing borders:");
          LabelL.setGeometry(350,60,890,30);
      
          QLabel Label1(&w);
          Label1.setText("Ok");
          Label1.setGeometry(12,95,200,30);
      
          QListWidget ListWidget1(&w);
          ListWidget1.setGeometry(10,120,201,101);
      
          //----------------------------------------------
      
          QLabel Label2(&w);
          Label2.setText("Top and right");
          Label2.setGeometry(232,95,200,30);
      
          QListWidget ListWidget2(&w);
          ListWidget2.setGeometry(230,125,200,100);
      
          //----------------------------------------------
      
          QLabel Label3(&w);
          Label3.setText("Bottom and left");
          Label3.setGeometry(457,95,200,30);
      
          QListWidget ListWidget3(&w);
          ListWidget3.setGeometry(455,130,200,100);
      
          //----------------------------------------------
      
          QLabel Label4(&w);
          Label4.setText("All");
          Label4.setGeometry(677,95,200,30);
      
          QListWidget ListWidget4(&w);
          ListWidget4.setGeometry(675,125,201,101);
      
          //----------------------------------------------
      
          QLabel LabelP(&w);
          LabelP.setText("QPlainTextEdit missing borders:");
          LabelP.setGeometry(350,270,300,30);
      
          QLabel LabelP1(&w);
          LabelP1.setText("Ok");
          LabelP1.setGeometry(12,305,200,30);
      
          QPlainTextEdit PlainTextEdit1(&w);
          PlainTextEdit1.setGeometry(10,330,201,101);
      
          //----------------------------------------------
      
          QLabel LabelP2(&w);
          LabelP2.setText("Top and right");
          LabelP2.setGeometry(232,305,200,30);
      
          QPlainTextEdit PlainTextEdit2(&w);
          PlainTextEdit2.setGeometry(230,335,200,100);
      
          //----------------------------------------------
      
          QLabel LabelP3(&w);
          LabelP3.setText("Bottom and left");
          LabelP3.setGeometry(457,305,200,30);
      
          QPlainTextEdit PlainTextEdit3(&w);
          PlainTextEdit3.setGeometry(455,330,200,100);
      
          //----------------------------------------------
      
          QLabel LabelP4(&w);
          LabelP4.setText("All");
          LabelP4.setGeometry(677,305,200,30);
      
          QPlainTextEdit PlainTextEdit4(&w);
          PlainTextEdit4.setGeometry(675,335,201,101);
      
          w.show();
          return a.exec();
      }
      

      Attachments

        Issue Links

          Activity

            People

              qt.team.quick.subscriptions Qt Quick and Widgets Team
              mireiner Chris
              Votes:
              7 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated: