Qt World Summit: Register Today!

Qt Applications don't look natie - Linux Mint 18.1 Cinnamon

  • My programs do not look native. I'm running Linux Mint 18.1 Cinnamon. I'm planning to release my application(to go through the process) so if anyone knows how I would compile it to work for Ubuntu and Linux mint's and look native. I'm new to this, I'd like to make a repo and have users use apt-get to install my application.

    Any help is appreciated, thanks!

  • @ChajusSaib It's because Cinnamon is based off gtk3. If you wanted native looks you would have to run a Qt based window manager for linux like KDE.

    There is a lot of ways to make things look similar but not 100% match between gnome and kde (or in your case cinnamon). I try to set themes that match for my gnome apps (gtk) as well as my kde (qt).

    Anyway, there isn't really anything you can do to make them look like gtk apps because ultimately control of gtk and qt looks on linux is up to the user, their preference in window manager, and their themes.

  • So how do I get it to fit into gnome. That makes sense because the applications look native on KDE. Anyways I'll try build Qt with my compiler and see how that goes. Thanks!

  • @ChajusSaib Qt is easy to build, especially on linux, but that won't help things look native for you.

    Basically Qt and gtk3 are 2 different libraries for displaying "widgets" in X windows. So they just aren't even going to look the same. I find at least these days that the difference aren't so much that it's glaring.

    However, with cinnamon it might be as ubuntu tends to use dark themes and default Qt/kde theme is light. You can adjust your Qt theme to be dark that would help. However this a personal setting and not one you could force on your users.

    So basically it comes down to .. there is no way to get it to match gtk themed window managers. Linux users know this though and when they install Qt apps on a gtk wm they don't really worry about it. Same goes for the opposite.

    For me I use things like gimp, evince, and gnucash but I run KDE/Qt. I just try to pick a gtk3 theme that is similar to my kde/qt one and things look just fine albeit not native.

    Also there are gtk2 apps still floating around that don't look native to gtk3 environments.

    So I would just not worry about that "native" look for your app under a certain linux. Linux users like myself are definitely used to the gtk vs Qt issue. :)

  • @ambershark Thank you! Clears up a lot.

    Below are pictures of how my application looks and how Kate looks. Kate fits in much more than my application(it doesn't use a fallback theme).


    Would builind Qt with -gtkstyle fix this? Thanks.

  • @ChajusSaib That's actually odd. Do your other Qt apps look like that? It should match the Kate application unless you are using like qt4 and kate is using qt5 or something.

    Your Qt app has a very antiquated (almost qt4) style theme I haven't seen in forever. Did you change theme on purpose or anything? Are you sure you're using qt5 and your build isn't picking up some system level qt4?

    Edit: This is for arch linux but the same applies to you, just the install of components is different. https://wiki.archlinux.org/index.php/Uniform_look_for_Qt_and_GTK_applications.

    It looks like you could try to get uniformity using a gtk style plugin for your app. Course then it wouldn't be uniform for people running KDE (which is more than gnome I think).

  • No it was using QT 5. Anyways I've wiped my whole system and setup KDE(was getting bored of Linux Mint anyways...).

    That guide you suggested, I tried it a while ago but no luck.

    Thanks for your help, appreciate it!

Log in to reply