"GTK" warning for Native QFileDialog under Linux
-
Hi,
From a quick look, it doesn't seem there's anything that can be done currently see here.
@SGaist
Thank you for that. I note that the call seems to be:gtk_file_chooser_dialog_new("", 0, ...)
That
0
is forparent
, which I understand to be the cause of the warning. Seems strange that the "parent" we pass toQFileDialog
function does not get passed down to native dialog call? -
@SGaist
Thank you for that. I note that the call seems to be:gtk_file_chooser_dialog_new("", 0, ...)
That
0
is forparent
, which I understand to be the cause of the warning. Seems strange that the "parent" we pass toQFileDialog
function does not get passed down to native dialog call?@JNBarchan said in "GTK" warning for Native QFileDialog under Linux:
Seems strange that the "parent" we pass to QFileDialog function does not get passed down to native dialog call?
Because it can't. GTK does not know anything about any Qt classes - so it cannot use Qt classes as parents.
-
@JNBarchan said in "GTK" warning for Native QFileDialog under Linux:
Seems strange that the "parent" we pass to QFileDialog function does not get passed down to native dialog call?
Because it can't. GTK does not know anything about any Qt classes - so it cannot use Qt classes as parents.
-
@jsulm
Sorry, yes, I meant, when we pass a Qt parent widget as parent to QFileDialog it would pass the corresponding native window onto GTK level as parent. But I don't know anything about GTK!@JNBarchan But since it is a Qt application there is no native GTK window. Qt does not use GTK on Linux - as far as I know it draws by itself.
-
@JNBarchan But since it is a Qt application there is no native GTK window. Qt does not use GTK on Linux - as far as I know it draws by itself.
-
@mrjj Yes, the native dialog is GTK, but there is no other GTK window to use as parent, right?
-
@mrjj Yes, the native dialog is GTK, but there is no other GTK window to use as parent, right?
@jsulm , @mrjj
Ah, now it is beginning to become clearer! I think you're saying:- The native file dialog is a special kind of window: a "GTK" window. (This applies to Linux/X11? Ubuntu? Unity desktop only?)
- It would like another GTK window as its parent.
- But the Qt window which is its parent in
QFileDialog
is not a GTK window. - So the code passes
0
/NULL
for the parent, and that causes the warning.
Right?
-
@jsulm , @mrjj
Ah, now it is beginning to become clearer! I think you're saying:- The native file dialog is a special kind of window: a "GTK" window. (This applies to Linux/X11? Ubuntu? Unity desktop only?)
- It would like another GTK window as its parent.
- But the Qt window which is its parent in
QFileDialog
is not a GTK window. - So the code passes
0
/NULL
for the parent, and that causes the warning.
Right?
@JonB Yes, if you use native dialogs on Linux then Qt simply uses GTK dialogs (GTK is isn't related to Unity, see https://www.gtk.org/). Yes, as GTK does not know anything about Qt it is not possible to pass a parent to GTK dialogs from a Qt app.
-
@JonB Yes, if you use native dialogs on Linux then Qt simply uses GTK dialogs (GTK is isn't related to Unity, see https://www.gtk.org/). Yes, as GTK does not know anything about Qt it is not possible to pass a parent to GTK dialogs from a Qt app.