Bug report #17825
File browser broken with gtk backend
|Affected QGIS version:||master||Regression?:||No|
|Operating System:||OpenBSD||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:||up/downstream|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||25720|
It worked fine in 2.x, and seems broken in 3.x, dunno if that's more a qt4 vs qt5 issue, but when i open the file browser to select a data, the file browser window opens but stays empty, and the console fills with error messages:
@Warning: QFileInfo::absolutePath: Constructed with empty filename
src/core/qgsmessagelog.cpp: 27: (logMessage) [8783ms] 2018-01-09T15:13:57 Qt1 QFileInfo::absolutePath: Constructed with empty filename
(qgis:25562): Gtk-CRITICAL **: Error building template class 'GtkDialog' for an instance of type 'GtkDialog': .:10:1 Invalid object type 'GtkHeaderBar'
(qgis:25562): Gtk-CRITICAL **: _gtk_container_get_border_width_set: assertion 'GTK_IS_CONTAINER (container)' failed
(qgis:25562): Gtk-CRITICAL **: gtk_container_set_border_width: assertion 'GTK_IS_CONTAINER (container)' failed
This is with master as of yesterday on OpenBSD, built against qt5.9.3. Not being able to open a file from qgis is a bit of an issue, of course :)
#6 Updated by landry Landry Breuil almost 3 years ago
Hmm.. i'm looking at what could be specific to BSDs (Asked loic bartoletti from FreeBSD if he was also seeing that bug) and stumbled upon some areas within #if defined(Q_OS_MAC) || defined(Q_OS_LINUX) and one of them is in a file-dialog related.. so maybe some untested/less-tested codepath is taken on BSDs. I'll dig a bit further in this direction.
#7 Updated by landry Landry Breuil almost 3 years ago
I think i'm on something here : https://github.com/qgis/QGIS/blob/master/src/gui/qgsguiutils.cpp#L130
The #else codepath is taken on BSDs, and this one untested - build was broken with qt5 until loic bartoletti fixed it in 71b9c77b907ab3912cea15abc2fde1e11c36689d
Is there an actual reason to not use native dialogs on BSDs too, as we're also using qt5 ?
I'm doing a build with BSDs added to this #ifdef and will report back.
#10 Updated by landry Landry Breuil almost 3 years ago
The first gtk error message is coming from https://github.com/GNOME/gtk/blob/master/gtk/gtkwidget.c#L13085 - so something with Gtk libs not properly initialized ?
#11 Updated by Loïc BARTOLETTI almost 3 years ago
Here my tests.
With FreeBSD and Debian (ssh -Y into a VM...) I've only these warnings:
Warning: libpng warning: iCCP: known incorrect sRGB profile Warning: libpng warning: iCCP: known incorrect sRGB profile Warning: QFileInfo::absolutePath: Constructed with empty filename
Also, I added *BSD in https://github.com/qgis/QGIS/blob/master/src/gui/qgsguiutils.cpp#L130