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

Using the QSqlTableModel::OnFieldChange as edit strategy will cause the QTableView to change the scrollbar position by reseting

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Done
    • P2: Important
    • 5.0.0
    • 4.3.0
    • SQL Support
    • None

    Description

      Using the QSqlTableModel::OnFieldChange as edit strategy will cause the QTableView to change the scrollbar position by reseting on top.

      Answer from Trolltech:
      The reason for this behaviour is that after the field change has been written to the database the model will reselect the data, which causes the view to be repopulated. This can't be changed in Qt 4. A possible workaround is to remember where in the list you are before the update is done and then scroll to this possition after the view is repopulated, but as data may have been inserted or deleted in the meantime this isn't reliable.

      Attachments

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

        Activity

          People

            zhongle honglei zhang
            admin Administrator
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes