Details
-
Bug
-
Resolution: Out of scope
-
P3: Somewhat important
-
4.6.3
-
None
-
kubuntu 10.04
gcc v4.4.3
PostgreSQL v8.4.4
Description
See the attached test case that reproduces the problem (see file main_window.cpp to set the SQL context).
Context :
- a QSqlTableModel object that works on two different tables (one active at a time of course)
- a QTableView on that model
- when "table2" is selected we hide an inner column (not the first or last one) with QTableView::hideColumn()
- when "table1" is selected we show back the previously hidden column with QTableView::showColumn()
Steps :
0. At loading "view1" is showed with columns "id, data" -> OK
1. Select "view2" in the combo box, columns "id, data0" are displayed, but not the "data" column (it was hidden with hideColumn()) -> OK
2. Select back "view1" in the combo box, only column "id" is erroneously displayed, however showColumn() was called for column "data" -> KO
Note that if show/hide column is performed before QSqlTableModel::select() then it surprisingly works.
A possible fix is to call begin/endRemoveColumns() inside the implementation of QSqlTableModel::select().