PDA

View Full Version : the pop up location of dialog



stella1016
14th June 2011, 10:22
I have a mainwindow opened, and one child dialog (QFileDialog::getOpenFileName) is opened from its sub-dialog. Since I have two monitors, each time, after I open the child dialog once in monitor1, then I drag the sub-dialog to monitor2, if I open the child dialog, it pops up in monitor1 still (mainwindow always stays in monitor1).

I am confused, I wrote the code (in sub-dialog class):


void sub-dialog::on_pushButton_load_clicked()
{
QString sFile = QFileDialog::getOpenFileName(this, tr("Open file"), sLoadDir, tr("output (*.txt);;All files (*.*)") );
...
}


The location of pop up should be the same with its parent dialog, which here is the sub-dialog. Anything wrong?

Thanks in advance~

Added after 8 minutes:

Eventhough I move the mainwindow to monitor2, the pop up location is still in monitor1.

stella1016
14th June 2011, 14:10
I think this a bug from qt 4.5.2 (even qt 4.6.0). Example of qt has the same problem.

joyer83
14th June 2011, 19:43
Have you checked that you don't have some external software that repositions dialogs to a certain monitor? At least NVIDIA's Nview can do that.

stella1016
1st July 2011, 15:47
Have you checked that you don't have some external software that repositions dialogs to a certain monitor? At least NVIDIA's Nview can do that.

No, I didn't do any reposition.

This really depends on in which monitor I open the child dialog. It will stick to that monitor, no matter I move the mainwindow to the other monitor or the parent-dialog to the other monitor.