tags:

views:

1928

answers:

8

Hello, I was wondering which one should I consider if I need the software to be used on both platforms, WIN and Linux and why?

+3  A: 

They are both fine toolkits. I'd base my decision on the licensing. Qt requires that you pay for a license if you are using it in a commercial product wheras GTK does not.

Adam Pierce
Of course this is no longer true.
Max Howell
+3  A: 

GTK+ you can use almost in all programming languages, in C++ (using gtkmm) in C (gtk+) in C# (with Gtk#) in Python (PyGtk). Behind GTK you have Mono Framework which is great implementation of .NET Framework for cross platform purposes. If you want to use Gtk# you have great IDE (MonoDevelop) with a very powerful gui designer. You can take a look at www.mono-project.org. But still depends what do you want to build, you are looking just gui toolkit, or the entire framework? And the logic behind signals/slots are the same in Gtk+ and Qt, but if you are using Gtk# they are transformed in the delegates/events paradigm.

milot
If you're developing commercial software, you'd be a fool to use anything other than the base libraries, ie. GTK or Qt. Anything above that has no guarantee of maintenance or reliability. Generally speaking.
Max Howell
@Max PyGTK and GTK# are both supported for Gnome app development, so I would expect them to have a good level of support (equivalent to GTK+ itself).
Michael E
Well then you're bound to be both upset and surprised when you find that isn't the case.
Max Howell
+3  A: 

my $0.02:

I've used Qt off and on for the last 4 years, and it's hands-down my favorite toolkit of anything I've tried (Win32, MFC, Borland, Java, GTK). I used GTK for a few weeks to try it out, and didn't like it. Mostly that was because I think it's awkward to use C instead of C++ for GUI apps on a PC... I do embedded work too, and I'd never use C++ on an 8051, but for a big GUI app I much prefer it. If you're going to try GTK, I'd suggest looking in to GTKmm, although I've never used it myself.

KeyserSoze
+2  A: 

You might also consider wxWidgets. I have never used any of them but when I was looking over the cross-platform toolkits it was the one I had decided to try.

Bryan Anderson
+3  A: 

Both are good toolkits that have their advantages and disadvantages.

The license is a big one. As mentioned by Adam Pierce, GTK+ is licensed under the LGPL, which allows you to use it in commercial applications without a fee. Whereas Qt is available under the GPL, which requires that any code that uses it must also be GPL-compatible. Alternatively you can buy a commercial license for Qt which allows you to use Qt with a proprietary product.

Another difference is implementation language. Qt is in C++, and GTK+ is in C. However GTK+ has bindings for many, many other languages (perl, python, C++, .NET, etc) so it's not a huge issue.

An Advantage of Qt is that it offers a bit broader range of functionality built in (xml, database access, network programming, openGL, etc). GTK+ has basically all of these things within its orbit (e.g. libxml2, librsvg, libsoup, libgda, etc), but they're not as much of a single coherent package as Qt is.

My personal recommendation is to use gtkmm, the C++ bindings for GTK+. It offers a more comfortable object-oriented language to program in, and it provides nearly the same native performance as using GTK+ from C. (Disclaimer: I contribute to gtkmm).

jonner
And of course, now Qt is LGPL too.
Max Howell
+1  A: 

Java (either using Swing or Eclipse RCP)?

eed3si9n
+9  A: 

Packaging GTk and its dependencies on Windows is a full-time project in itself. Qt is much more easily distributed since it has no dependencies that do not come with Windows.

Qt has been cross platform from the start. GTK has not always been cross platform. Such fundamental decisions shape the overall design, and should be made before any code is written in my opinion.

I would comment more, but I'd be drifting into speculation, the above two things I know for certain.

Max Howell
+2  A: 

Three additional points in favor of Qt:

  1. Your project does not have to be GPL; there are many other open-source licenses available in the Qt GPL Exception, including BSD and LGPL.
  2. Qt's default theme on Windows does a much better job of blending in than GTK's Wimp theme.
  3. If you want to support Macs later, you'll have a much easier time with Qt.
pantsgolem
GTK+ is supported on the Mac, or is at least getting there.
Qt is supported on Mac, Windows, Linux and other embeded plattforms in a reduced form
Harald Scheirich
From Gtk.org: "GTK+ is licensed under the GNU LGPL 2.1 allowing development of both free and proprietary software with GTK+ without any license fees or royalties."
Piotr Zurek