hi,
as tbscope said u can try this,
testQuery->setQuery("SELECT * from candidates");
test->setModel(testQuery);
test->setWindowTitle("Candidates");
d->show();
QSqlQueryModel *testQuery = new QSqlQueryModel;
testQuery->setQuery("SELECT * from candidates");
QDialog *d=new QDialog(this);
QTableView *test = new QTableView(d);
test->setModel(testQuery);
test->setWindowTitle("Candidates");
d->show();
To copy to clipboard, switch view to plain text mode
but again , if mainwindow is minimized ur tableview wont be minimized.
when the mainwindow is minimized ,if u want to minimize the tableview use mdi
example for mdi
QMdiArea *mdi=new QMdiArea;
testQuery->setQuery("SELECT * from candidates");
test->setModel(testQuery);
test->setWindowTitle("Candidates");
mdi->addSubWindow(d);
d->show();
setCentralWidget(mdi);
QMdiArea *mdi=new QMdiArea;
QSqlQueryModel *testQuery = new QSqlQueryModel;
testQuery->setQuery("SELECT * from candidates");
QDialog *d=new QDialog;
QTableView *test = new QTableView(d);
test->setModel(testQuery);
test->setWindowTitle("Candidates");
mdi->addSubWindow(d);
d->show();
setCentralWidget(mdi);
To copy to clipboard, switch view to plain text mode
hope it helps
Bala
Bookmarks