I've already requested before, however I've more questions.

So, I've QTableView and QSQLTableModel.

pTableModel->setTable("table_name");
pTableView->setModel(pTableModel);

In QTableView I have to show only column with specified names, I personally use setColumnHidden() with this.

Now I have to change DB and show specified posts on the table with similar title. What's better method to inform table view and table model that DB continues to be transformed. Table within the new DB can differs by column count, row count but has all of the necessary posts.

Now I call

pTableModel->setTable("table_name");

once more with similar table title to update table model. And call

pTableView->horizontalHeader()->doItemsLayout();

to see table view about possible change of posts count.

It appears to become ugly and I don't know that the required data happen to be up-to-date. Are you aware an easy method?

For me you need to instantiate new QSQLTableModel for brand new database connection and assign it to pTableView. I thinks it's safer.