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

QLabel::setWordWrap(true) will not work if text does not contain word-breaks

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.11.3
    • None
    • windows/linux
    • All

    Description

      // label2, label3 will not wrap correctly

      #include <QApplication>
      #include <QWidget>
      #include <QLabel>
      #include <QVBoxLayout>

      int main(int argc, char** argv)

      { QApplication app(argc, argv); QWidget w; w.setFixedSize(300, 300); QVBoxLayout hlay(&w); QLabel label1("hello world hello world hello world hello world hello world hello world hello world"); label1.setWordWrap(true); QLabel label2("http://www.helloworld1helloworld2helloworld3helloworld4helloworld5helloworld6helloworld7.com/helloworld/test"); label2.setWordWrap(true); QLabel label3("1234567890abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz"); label3.setWordWrap(true); hlay.addWidget(&label1); hlay.addWidget(&label2); hlay.addWidget(&label3); w.show(); return app.exec(); }

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            tmr tom h
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes