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 (*.*)") );
...
}
void sub-dialog::on_pushButton_load_clicked()
{
QString sFile = QFileDialog::getOpenFileName(this, tr("Open file"), sLoadDir, tr("output (*.txt);;All files (*.*)") );
...
}
To copy to clipboard, switch view to plain text mode
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.
Bookmarks