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

QListView: setWordWrap and setSpacing bug in a ListMode

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 4.7.0
    • 4.4.1
    • Widgets: Itemviews
    • None
    • 11dea4a8b227801c110f791f350632bf6f0c958d, b53f7d4ce3d5d9af47daf78c9f831acc532e688b

    Description

      Using setSpacing and setWordWrap make the horizontal scollbar appears while they shouldn't.
      It seems that the spacing is not taken in account while computing the item's maximum size.

      #include <QtGui>
      
      static const char *lorem = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.";
      
      int main(int argc, char *argv[])
      {
          QApplication app(argc, argv);
      
          QStringListModel model(QStringList() << lorem << lorem << "foo" << lorem << "bar" << lorem << lorem);
          QListView w;
          w.setModel(&model);
          
          w.setWordWrap(true);
          w.setSpacing(50);
          w.setViewMode(QListView::ListMode);
      
          w.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

              dedietri Gabriel de Dietrich (drgvond)
              goffart Olivier Goffart (closed Nokia identity) (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes