[Interest] QTableView does not scroll to fully display selected row

K. Frank kfrank29.c at gmail.com
Mon Jun 18 05:09:08 CEST 2012


Hello List!

I am having a minor cosmetic problem with QTableView.

I have a QTableView in QMainWindow laid out with Designer.  It is
connected to a QSqlTableModel.  I add a new row at the end of the
QSqlTableModel using QSqlTableModel::insertRecord.  The new
row shows up in the QTableView (as its new last row).

I then programmatically select the new row.  The QTableView scrolls
as if it is trying to display the new row, but only displays the top edge
of the new row, rather than the whole row.  That is, the QTableView
scrolls down almost, but not quite far enough.  This behavior is hardly
important, but is rather annoying.

Is this a known issue?  Am I doing something wrong?  Of course,
the user can scroll manually to make the new row visible, or the
application can scroll programmatically, but either of these would
seem redundant, given that the QTableView is already scrolling
automatically -- just not quite correctly.

I am using 4.8.0-rc1 on 64-bit windows 7, compiled with
mingw-w64 4.7.0.

Thanks for any suggestions.


K. Frank



More information about the Interest mailing list