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

Bug in QLabel with word-wrap.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P4: Low
    • Resolution: Unresolved
    • Affects Version/s: 5.9.3, 5.10.0
    • Fix Version/s: None
    • Component/s: QPA: Windows
    • Labels:
      None
    • Environment:
      Windows 10 x64, Intel Core i5, 1.60GHz, 8GB RAM.

      Qt 5.9.3 and Qt 5.10.0

      Description

      Hello Guys. Thank you for your hard work.

      I have found a next bug:

      I set scale factor (200%) for my monitor in system settings.

      When I create QDialog with fixed size and put a QLabel into it with WordWrap property, the dialog starts changing it's size while I drag it. 

      This is the whole text of my program:

      #include <QLabel>
      #include <QDebug>
      #include <QDialog>
      #include <QHBoxLayout>
      #include <QApplication>
      
      class MyDialog : public QDialog {
      public:
          MyDialog() {
              setFixedSize(400, 300);
      
              auto label = new QLabel(this);
              label->setText("Very long long long text. Very long long long text. Very long long long text. Very long long long text.");
              label->setWordWrap(true);
      
              auto mainLayout = new QHBoxLayout(this);
              mainLayout->addWidget(label);
          }
      };
      
      int main(int argc, char *argv[]) {
          QApplication::setAttribute(Qt::AA_DisableHighDpiScaling, true);
      
          QApplication a(argc, argv);
      
          MyDialog w;
          w.show();
      
          return a.exec();
      }
      

      I also attached a giff to show my issue.

      I can not reproduce this issue if my screen has no scaling.

      Thanks,

      Artem.

       

        Attachments

          Issue Links

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

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              denisovartem Artem Denisov
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:

                  Gerrit Reviews

                  There are no open Gerrit changes