It looks like this is the issue:
// don't you want something like:
// iptableView = new QTableView(this); //and don't show() it separate?
//*** don't forget to use layouts ***
iptableView->close();
iptableView->setModel(ipmodel);
iptableView->setColumnHidden(0,true);
iptableView->setColumnHidden(1,true);
iptableView->show(); //here you show some widget that, i think, you want to be a child of your dialog
iptableView = new QTableView;
// don't you want something like:
// iptableView = new QTableView(this); //and don't show() it separate?
//*** don't forget to use layouts ***
iptableView->close();
iptableView->setModel(ipmodel);
iptableView->setColumnHidden(0,true);
iptableView->setColumnHidden(1,true);
iptableView->show(); //here you show some widget that, i think, you want to be a child of your dialog
To copy to clipboard, switch view to plain text mode
Anyway, i don't really understood your design, if you created the dialog in the Designer, why are you adding widgets with code? You could have added that QTableView from the designer.
***i'm not sure that you can add widgets to the designer created dialog with using layouts (i never done that before), if you can't do it, you can add the QTableView in the designer
Also ipmodel = new QSqlTableModel; should have a parent, or else you should manually delete the pointer.
Bookmarks