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

In QTableWidget when horizontal (vertical) header is hidden, first row height (column width) is not correct

    XMLWordPrintable

Details

    Description

      In qtableview.cpp at the end of QTableView::paintEvent() a first horizontal (vertical) grid line is drawn when the horizontal (vertical) header is hidden and the scroll mode is "ScrollPerItem". The problem is that this is drawn over the first row (column).

      The results are (see picture):

      • When the horizontal header is hidden, the first row height is one pixel shorter than the other rows height.
      • When the vertical header is hidden, the first column width is one pixel shorter than the other columns width.

      Small test case:

      #include <QtGui>
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
          QMainWindow w;
          QTableWidget table(200,3);
          table.horizontalHeader()->setVisible(false);
          table.verticalHeader()->setVisible(false);
          w.setCentralWidget(&table);
          w.show();
          return a.exec();
      }
      
      

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            sanonymous Nokia Qt Support (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes