views:

407

answers:

4

I want to write a gui to an application that is now CLI that needs to "look good" in both KDE and Gnome DE's, taking optimal advantage of a users settings for appearance.

If I select Qt or GTK+ will I be able to do this?

Do they integrate well with both DE's? Or does a KDE user need gnome libs and vice versa to run them?

My development language of choice will be C++

+6  A: 

Your best bet may be to port it to a cross-platform widget library such as wxWidgets, which would give you portability to any platform wxWidgets supports.

It's also important to make the distinction between Gnome libraries and GTK, and likewise KDE libraries and Qt. If you write the code to use GTK or Qt, it should work fine for users of any desktop environment, including less popular ones like XFCE. If you use other Gnome or KDE-specific libraries to do non-widget-related tasks, your app would be less portable between desktop environments.

This same information avilable on

http://stackoverflow.com/questions/35762/linux-gui-development

joe
As if Qt or GTK are not cross-platform?
hasen j
`wxPython` has a native feeling in all of its supported platforms. `Qt` and `GTK` always feel a little alien, as they don't use the standard widgets from the platform.
voyager
+1  A: 

Krish is right !

If your aim is to make a cross-platform application, use a library like wxWidgets.

If you decide to use Qt for example, users running on Gnome will download some libs and it'll work fine. This is transparent when the distribution have a package manager but more difficult if it doesn't.

Timothée Martin
+1  A: 

You can compile and link to Qt statically (I've seen this on Windows, don't know how it works on Linux). Qt applications can look native on GNOME desktop environment through the use of qgtkstyle.

wxWidgets uses GTK+, if you want to have it look nice on KDE you need to have a GTK theme which uses Qt for rendering like qgtkstyle is for GNOME. qgtkstyle is incorporated into Qt while the other option is from a 3rd party.

Cristian Adam
+3  A: 

I've found that Gtk+ apps come closer to looking right in KDE than Qt apps do in Gnome, but not by enough to matter. Both options look and feel like they belong, provided the libraries are available on the system (more common that you might think) or they are statically linked (not sure that this is allowed with Qt) as mentioned above.

Secondly, wxWidgets will still use Gtk+ in KDE, requiring the same libraries to be loaded as if you wrote the application strictly using Gtk+ in addition to wxWidgets. It really is a fantastic choice though as it's easy to use and works well in many environments. This should give you an idea of how applications will look between desktop environments:

http://www.wxwidgets.org/about/screensh.htm

I think what is more important is which will fit your coding style and application better. Qt and Gtk+ can be quite different in many regards.

neorab