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

QFileSystemModel alignment in QTableView

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • 5.8.0
    • None

      When attach QFileSystemModel to QTableView we see that column with file size is aligned to top of the cell. Other cells aligned to vertical center. See screenshot for details.

      In source code qfilesystemmodel.cpp we see:

      QVariant QFileSystemModel::data(const QModelIndex &index, int role) const
      {
       ....
          case Qt::TextAlignmentRole:
              if (index.column() == 1)
                  return Qt::AlignRight;
              break;
      

      Need to correct it to

          return Qt::AlignRight | Qt::Qt::AlignVCenter;
      

      Now it is possible to fix with custom delegate for column, but is not good. Please fix it.

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

            mmutz Marc Mutz
            keshav Konstantin Semenov
            Votes:
            3 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes