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

QSqlTableView does not respect ItemDelegate when used with QSqlTableModel

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • 5.0.0
    • 4.7.0, 4.7.1, 4.7.2, 4.7.3
    • SQL Support
    • None

    Description

      1. Have a QSqlTableView with some delegate that provides a sizeHint().
      2. Add a QStandardItemModel
      3. Edit items and resize colums/rows. Items will retain their size

      4. change model to QSqlTableModel
      5. edit items
      6. after each edit, items will be resized to a size other than what user specified and other than what the itemDelegate specifies. More specifically, the row height will be reset to some default value, not the value required by the itemDelegate::sizeHint()

      What should happen?

      1. item delegate should provide the minimum size of a cell (height), at very least.
      2. ideally, cell sizes should be retained even after items are changed.

      #2 is not as simple to achieve as the QSqlTableModel seems to reload ALL records when item changes and sorting seems to be done in the DB. But #1 is the minimum that I would expect.

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            adamm Adam Majer
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes