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

Bad column wrapping on a particular case

    XMLWordPrintable

Details

    Description

      The following text should be wrapped exactly at 72 characters. The 'f' of the last "of" is character 73, yet it is not wrapped there. Reported in QTCREATORBUG-25491.

      If I call setFontFamily({}) it works as expected.

      It reproduces on Linux but not on Windows.

      #include <QApplication>
      #include <QDebug>
      #include <QTextEdit>
      
      int main(int argc, char *argv[])
      {
          QApplication app(argc, argv);
          QTextEdit e;
          e.setVisible(false);
          e.setMinimumWidth(1000);
          e.setFontPointSize(14.0);
          // e.setFontFamily({});
          e.setLineWrapColumnOrWidth(72);
          e.setLineWrapMode(QTextEdit::FixedColumnWidth);
          e.setWordWrapMode(QTextOption::WordWrap);
          e.setPlainText("Since there may be a significant amount of received input frames ahead of the");
          QTextCursor cursor(e.document());
          cursor.select(QTextCursor::LineUnderCursor);
          qDebug() << cursor.selectedText(); // Should *not* include "of"
          e.show();
          return app.exec();
      }
      

      Attachments

        Issue Links

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

          Activity

            People

              esabraha Eskil Abrahamsen Blomfeldt
              orgads Orgad Shaneh
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes