Make QFileDialog parent not clickable on Gnome
- 
Hello everyone!
I am using QFileDialog with DontUseNativeDialog = false on Gnome and I'm trying to get this type of behavior:

Here parent form is not clickable when dialog window is open. I get this result using QDialog:Widget::Widget(QWidget* parent) : QWidget(parent), ui(new Ui::Widget) { ui->setupUi(this); connect(ui->pushButton, &QPushButton::clicked, [=]() { QDialog* dl = new QDialog(this, Qt::WindowStaysOnTopHint); dl->exec(); }); }But if I try to do same with QFileDialog, I can't make file dialog stay on top:

Here I'm using this code which works with KDE and xfce, but not with Gnome:Widget::Widget(QWidget* parent) : QWidget(parent), ui(new Ui::Widget) { ui->setupUi(this); connect(ui->pushButton, &QPushButton::clicked, [=]() { QFileDialog* dl = new QFileDialog(this, Qt::WindowStaysOnTopHint); dl->setOption(QFileDialog::DontUseNativeDialog, false); dl->setModal(true); dl->exec(); }); }I also tried to use QFileDialog::DontUseNativeDialog = false, in this case parent window does become not clickable, but I need to use native dialog. How do I handle this on Gnome?
 - 
Hi,
Which version of Gnome is it ?
Which version of Qt are you using ? - 
Hello everyone!
I am using QFileDialog with DontUseNativeDialog = false on Gnome and I'm trying to get this type of behavior:

Here parent form is not clickable when dialog window is open. I get this result using QDialog:Widget::Widget(QWidget* parent) : QWidget(parent), ui(new Ui::Widget) { ui->setupUi(this); connect(ui->pushButton, &QPushButton::clicked, [=]() { QDialog* dl = new QDialog(this, Qt::WindowStaysOnTopHint); dl->exec(); }); }But if I try to do same with QFileDialog, I can't make file dialog stay on top:

Here I'm using this code which works with KDE and xfce, but not with Gnome:Widget::Widget(QWidget* parent) : QWidget(parent), ui(new Ui::Widget) { ui->setupUi(this); connect(ui->pushButton, &QPushButton::clicked, [=]() { QFileDialog* dl = new QFileDialog(this, Qt::WindowStaysOnTopHint); dl->setOption(QFileDialog::DontUseNativeDialog, false); dl->setModal(true); dl->exec(); }); }I also tried to use QFileDialog::DontUseNativeDialog = false, in this case parent window does become not clickable, but I need to use native dialog. How do I handle this on Gnome?
 - 
I would try with a more recent version of Qt.
By the way, is it the Qt version coming from your distribution ? - 
I would try with a more recent version of Qt.
By the way, is it the Qt version coming from your distribution ? - 
@keesaev said in Make QFileDialog parent not clickable on Gnome:
here 5.11.3 is the latest version of Qt
You can use Qt Online Installer to install a recent Qt version.
 - 
@keesaev said in Make QFileDialog parent not clickable on Gnome:
here 5.11.3 is the latest version of Qt
You can use Qt Online Installer to install a recent Qt version.
 - 
@keesaev said in Make QFileDialog parent not clickable on Gnome:
dl->setModal(true);
I don't even call
dl->setModal(true);
in my program and for me, it creates a modal file open dialog box.
I use KDE.Either you have a limitation with GNOME or you have to setup something in your OS.
Are other programs able to make modal file dialog boxes?
You can try one of my programs and see. Search for TextFind2 on sourceforge.
When you open the program, at the top right, click on the Open button. - 
@keesaev said in Make QFileDialog parent not clickable on Gnome:
dl->setModal(true);
I don't even call
dl->setModal(true);
in my program and for me, it creates a modal file open dialog box.
I use KDE.Either you have a limitation with GNOME or you have to setup something in your OS.
Are other programs able to make modal file dialog boxes?
You can try one of my programs and see. Search for TextFind2 on sourceforge.
When you open the program, at the top right, click on the Open button.@stretchthebits
Yeah, I know, on KDE and xfce you just need to initiate dialog with a parent widget to make it modal. As for other programs - I tried Telegram, which uses Qt as well, and it doesn't have this problem. Tried looking into their code, but couldn't find anything specific, I guess the answer here is to use later versions of Qt 
