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

QTableWidget horizontal scrollbar not display when only 1 column

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.4.2, 5.8.0
    • None
    • Tested on win7 64bit, Qt 5.8 and win10 64bit, Qt 5.4.3

    Description

      When a QTableWidget only has only 1 column, and header property SectionResizeMode

       set to QHeaderView::ResizeToContents, property HorizontalScrollMode set to QAbstractItemView::ScrollPerItem,

      then insert a row has long text.

      Expect: There should appear a horizontal scrollbar so user can read all content in the column.

      Actual Happened: No horizontal scrollbar appear, although the column width be resize to content, no way to see them...

      a possible solution for this: 

      QTableWidget* tw = ui->tableWidget;
      tw->setHorizontalScrollMode(QAbstractItemView::ScrollPerPixel);
      

      Just set HorizontalScrollMode to QAbstractItemView::ScrollPerPixel.

      The same bug reported for QTableView on Qt 4.8, see QTBUG-27993.

      Test case uploaded as a rar file.

       I understand the reason of this, the mode ScrollPerItem behaviour is undifined when only 1 column exists. Please fix it, maybe update the document or code, thanks a lot.

      Attachments

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

        Activity

          People

            richard Richard Moe Gustavsen
            hitvery hitvery
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes