tableView and disappearing items
-
Hello.
I'm using tableView to display database data and I can fix this annoying bug.I've created a button to refresh data:
void Przychodnia::on_buttonOdswiez_clicked() { QSqlTableModel *model = new QSqlTableModel(); model->setTable("Pacjent"); model->setEditStrategy(QSqlTableModel::OnManualSubmit); model->select(); ui->tableView->setModel(model); }
This is my tableView before fetching data:
http://imgur.com/h6zq8dWThis is my tableView after fetching data:
http://imgur.com/XxU3qS7This is my tableview after hovering on items:
http://imgur.com/Xn7pK1HHowever if I edit data in listView (that also is not showing my items) the results are displayed in table view and they are not disappearing:
http://imgur.com/dYnqwdtI'm working with SAP 16 database on Virtual Machine win7- 64bit with Qt Creator 3.6 based on Qt 5.5.1.
Best regards!
-
Hi and welcome to devnet,
Are you saying the you have your indexes disappearing while hovering them ?
On a side note you have a "memory leak" here, each time your call
on_buttonOdswiez_clicked
, you replace the current model with another new one and don't delete the original. -
Are you both using the same OS and Qt version ?
-
Did you install the VirtualBox guest tools ?
-
What version of VirtualBox is it ?
-
What is the host OS ?
-
What do you mean by "more then 1 rows in column" ?
-
@SGaist
Its fine to have one row in tableview but when i add more than one the bug appears.Single row:
http://imgur.com/sDniGmWMultirow:
http://imgur.com/uIxyxdD -
Do you have any QSqlRelationalDelegate on it ?
-
Your two images show two different tables. Are you sure that both tables contains data ?