PDA

View Full Version : Show in center



lisa
21st November 2009, 09:16
How to open dialog in center relative a widget in a parent dialog ? I have a tabwidget in a Dialog. Every time me open other dialog, the other dialog will show on center tabwidget. Not center on parent dialog. I have use this code. But not work


OtherDlg *d=new OtherDlg(ui->tabWidget);
d->exec();

Btw, sorry with my english..

faldzip
21st November 2009, 10:41
If you want to show dialog in a center of some widget then pass a pointer to that widget as a parent. I assume this should work:


OtherDlg *d=new OtherDlg(this);
d->exec()

lisa
21st November 2009, 13:19
Yes. But dialog will show in a center parent dialog. Not center in widget (tabWidget) on parent dialog.

miwarre
22nd November 2009, 12:42
Yes. But dialog will show in a center parent dialog. Not center in widget (tabWidget) on parent dialog.
Then I would try:

OtherDlg *d=new OtherDlg(ui->tabWidget);
d->exec()
I didn't try, so I'm not sure, but it is simple to test, isn't it?

M.