Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QFileDialog layout incomplete on Linux Mint (19.1 Cinnamon)



  • Hi all,

    I am working on a project that uses the QFileDialog class, in native mode.
    The project uses Qt 5.9.3 right now.

    All is working fine on Windows, Mac, and Ubuntu.
    But on Linux Mint (19.1 Cinnamon) when using that class, the dialog is shown, but without certain layout graphics, like the WRONG-part in following image:

    0_1555670558202_LinuxMintQFileDialog.png

    The CORRECT-part is a screenshot made of the same dialog but shown via the built-in texteditor of Mint.

    This behaviour is also the case if showing this QFileDialog is the only thing that is done within my program.
    I tested it on 2 different Linux Mint computers.
    The program is running via an AppImage. The generated AppImage contains all the necessary Qt libraries. The AppImage is generated using the linuxdeployqt-tool.

    Does anyone have an idea what might be the cause of this incorrectly displayed dialog?

    20210409:

    Problem is still there, also in Qt 5.15.2.
    And one client has the same behaviour on a Ubuntu 18.04 LTS version.
    Whereas on out own computer with Ubuntu 18.04 LTS it works fine.

    It looks like styling elements are missing.
    We use the native dialog version.
    We also use the native QColorDialog.
    Also in that dialog I can see the button texts, but not the button panes/outlines.

    After playing around with the theme I noticed that it can be solved by selecting a NON-Mint theme for Controls (e.g. Adwaita, Windows 10 theme). With all the Mint-Controls-theme the same error occurs.
    Still the question is, why does this happen from within our Qt application, and not via the TextEditor, which seems to use the same dialog?

    20210413:

    We now installed LInux Mint 20.1, and same problem there.
    We use the Mint-Y theme.
    If I remove/rename the file "/usr/share/themes/Mint-Y/gtk-3.0/gtk.css" the file dialog looks good.
    If I empty that file it doesn't look good, even looks worse.
    If I edit the file, and comment/disable the ".button" style, the Mint filemanager looks bit like our FileDialog.
    I can't get our filedialog look good by disabling parts of that gtk.css file.

    On Ubuntu we use Ambiance-theme, which works fine in our filedialog on Ubuntu.
    If I copy the "gtk-3.0" of that Ubuntu-Ambiance theme to my Mint-Y theme (after removing its original "gtk-3.0" folder), then the filedialog looks good. But the Filemanager of Mint does not look good anymore.
    Nevertheless, the problem seems to be the handling of the "gtk-3.0" version of the theme.
    So, question remains, is this solvable through Qt?
    Or is this a bug of Qt?
    Or is this a buggy theme?

    20210531:

    We have been able to solve this by building our application on Ubuntu 20.04.


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    What do you get if you use a build of your app created with the Mint provided version of Qt ?



  • looks like a style problem to me. Have you tried changing the default desktop style on the target machine?



  • @SGaist Thank for the reply. At this moment we build the app on Ubuntu 16. I cannot right away build it on the Mint computers. Maybe can try that later some time. But it should not matter normally I hope, cause otherwise we need to build it for every single Linux distribution.


  • Lifetime Qt Champion

    Indeed, it should not. The idea is rather to check whether it's a Mint issue or a Qt one.


  • Lifetime Qt Champion

    @WJWJ Does it behave like this if you start your app from QtCreator?



  • And as I wrote before...I've seen this exact problem with style/themes that were buggy in Linux. Try changing the default desktop style/theme to verify behaviour.


Log in to reply