Hacker News new | ask | show | jobs
by xor_null 2947 days ago
As far as i know ubuntu uses Gnome which means you should use GTK to let your app look nativ. I dont know how it will look if you use Qt.
1 comments

QGtkStyle and the Gnome platform theme mean this isn't really an issue.
In practice, though, I can nearly always tell when a new app I install uses Qt. It always seems a little off, and some little details end up not feeling right. If you use GNOME or Xfce and are starting a GUI project, it's better to just stick with GTK.
Unfortunately, GTK applications in a Qt desktop are a complete disaster. This means if you use Qt, it looks and works well on some desktops and OK on others, while GTK is good on the latter and bad on the former.
I have to disagree. I use plasma as my desktop environnement and I occasionally use some gtk3 apps like evince. The KDE team did a good job porting the breeze theme to gtk, evince is beautiful here. So is gedit and meld is okay too. The gtk header bar also looks good and I actually like it. Chrome also looks good here.

KDE also provide a nice configuration tool for gtk apps.

Worst case, I feel gtk apps look and feel as they do in gnome, which is okay. The gnome crowd paid attention to the look and feel of their software and this is noticeable.

I still do prefer KDE apps most of the time, I always feel they behave the right way. What should be zoomable with the mouse wheel is for instance.

Qt apps also look good on gnome, especially when using the breeze theme. Gnome with this theme is beautiful.

However, many KDE apps are broken or ugly if QT_QPA_PLATFORMTHEME is not set to "kde" (and then you get whatever theme is configured in plasma, not the theme of your current desktop environment). At least outside of gnome.

Bare Qt apps don't have this problem: VLC looks good everywhere.

However, configuring the look and feel of Qt 5 apps is a pain outside of KDE.

Gtk3 apps are also more likely to behave better on a touchscreen (scrolling, for instance). Plasma do behave very well on a touchscreen. KDE apps, not so particularly well. Gtk 2 is a disaster, popup menus are unusable. This makes xfce unusable on touchscreens on which I tested it.

Some details, some behaviors are different between the toolkits. Overflowing toolbars unhide differently for instance (this is visible with LibreOffice vs LyX. I find Qt a bit annoying with this).

With Qt you get the opportunity to have a good opening file dialog. The gtk one is nice looking but quite annoying. It autocompletes in a surprising way (in KDE at least), and reauires typing Ctrl+L to type a path but the recently used files gets in the way (although is occasionally very helpful).

I also have observed that Qt apps play well with the DPI / font scaling setting of the xsdl x server on Android. Gtk apps require to set GDK_DPI_SCALE manually.

For programming, I would not hesitate between Qt and gtk. The Qt API is clean and straightforward and powerful. Gtk looks worse to me. And for the documentation, Qt is top notch. I might have missed something on the side of gtk. I would use gtk only if I have to use C.

Qt apps will also probably look better outside of Linux/BSD than gtk apps.

Gtk will probably look more native than anything on the Ubuntu desktop, since everything in Ubuntu is written in gtk. I would still consider Qt though. With care given to integration, good result should be reachable.

It's only good if you stick to Breeze. If you use anything else (QtCurve, Virtuality) there's no GTK3 port.
I just wish Qt supported headerbars... it’s really the only thing that GTK has that Qt doesn’t, and they complement many app designs very nicely.
They work for a very specific (i.e. consumption focused) type of application, but the implementation in GTK is pretty fragile.

Qt Quick / Kirigami is a good option for that type of application though.