Unsolved QTableView model
-
when I do a re-select of model of database, then the last visible column extends the entire width of the window
model->setTable("table1");
model->select();
ui->tableView->setModel(model); -
Hi and welcome to devnet,
Do you mean setStretchLastSection ?
-
@SGaist Yes, When I do the first select, the table is all right.
In the second Select is as follows:
In the middle column extends over the entire width of the window.
I'm trying to make the switch between the tables in the database. -
Did you change the table in between ?
-
@SGaist No
-
Ok, can you show the code that triggers that behavior ?
-
-
I can't reproduce the error. Can you give a step by step set of instruction to trigger the problem ?
-
@SGaist, Run the application.
Double click by database "decanat".
Double click by table"ball".
Double click by table"dis".
Again double click by table"ball".
Result:
-
Sorry, can't reproduce it here. Which version of Qt + Windows are you using ?
-
@SGaist said in QTableView model:
Sorry, can't reproduce it here. Which version of Qt + Windows are you using ?
Qt 5.5.1 mingw x86
Windows 8.1 x64 -
Ok, I'm on more recent version.
What about MySQL ?
-
@SGaist MySQL Server 5.5
-
@PowerMosts
Have you tried this? It may be more to your liking.ui->tableView->resizeColumnsToContents();
Mike
-
@mjsurette said in QTableView model:
Have you tried this? It may be more to your liking.
ui->tableView->resizeColumnsToContents();Mike
it did not help me