views:

781

answers:

7

I am writing a fairly large and complex data analysis program and I have reached the point where I think it is about time to build a GUI for the program. So my question is:

Which GUI toolkit should I use?

I am completely new to coding and building GUIs and would appreciate any guidance that can be offered. It doesn't have to be the simplest tool kit in the world, I learn rather fast. However, it does need to be able to do the following things (some if not all of these are probably incredibly basic for any given toolkit but I thought that it would be good to throw all this out there just in case).

It has to allow me to draw directly to the screen so that I can put graphs (spectra really), plots and things like them up for the user to see. I need to be able to collect position information on where they clicked on aforementioned spectra. I need to be able to display text and take text input from the user. It needs to be able to generate menus (you know File, Edit, etc). If it were to have some built in widget for generating tables that would be handy (though I can surmount a lack of that if I can draw directly to the screen). It needs to be able to pop up warnings, dialogue boxes, save and open boxes, etc. That is pretty much it, most of these seem pretty basic when I write them out but I don't want to get the GUI partly coded and then realize that I I need to rewrite it with a different toolkit.

It should be noted that I have written this program in C++ and that I don't want to have to write the GUI part in C or something else so the toolkit needs to support C++.

Additionally a cross platform toolkit would be preferable over a single platform toolkit. However if it must be a single platform toolkit then I would prefer it be for Linux.

Finally, I would DRAMATICALLY prefer an open source toolkit to a closed source toolkit.

Beyond that I cannot think of anything to add. Thank you in advance for your time and answers.

Hmmm based on the answers I shall look at both Qt and wxWidgets and see which appeals to me more. I with I could accept multiple answers as accepted but I can't, and since I am looking at two things it would be unfair to only accept one of the answers, perhaps in a week or two then I have looked at the toolkits and figured out which I want to use.

+18  A: 

For C++, in my opinion, Qt is the least frustrating and most fully featured toolkit. Its also fully cross platform. Note that Qt will be LGPL licensed some time in March 2009, when version 4.5 becomes available. Currently, its only offered in a GPL and commercial license version.

Qt's GUI designer is good. It has lots of utility functions (scene graph library, translation support, built-in Javascript engine, built-in WebKit library). Via the MOC (a special pre-compiler) it also brings a few run-time binding capabilities and introspection to C++.

For your technical application, you might find that Qwt (http://qwt.sourceforge.net/) provides what you need. It is built upon Qt.

Qt can even be used "headless" if you want its utility support (such as networking, etc) without a GUI.

The other cross platform C++ option is wxWidgets, which is usable but not really comparable to Qt. Its a much lower level toolkit, and isn't as easy to use or fully rounded. Gtkmm is another option, in the spirit of GTK+.

Yann Ramin
There's another C++ option: FLTK. Admittedly, it's geared toward OpenGL applications, but it's a fully-featured C++ GUI API, and is under a modified LGPL (with a static linking exception).
greyfade
Gtkmm works on windows, too.
drby
I second the Qt suggestion. In my experience, Qt is the highest quality, cross-platform GUI toolkit available.
Matt Olenik
+2  A: 

Qt. Also you can use KDE which is built on top of Qt.

David Zaslavsky
+14  A: 

Try WxWidgets. Cross platform (compile on Linux, Mac OS X, and Windows) and widely accepted.

http://www.wxwidgets.org/

Open Source too!

Zoasterboy
+3  A: 

I'd say it depends on whether or not you want the native Look and Feel of the OSes you're targeting for your application. Qt, like said earlier, is probably the easiest of the cross platform toolkits to use, however it is its own widget set. You don't get a native app look & feel unless you happen to be running on KDE.

I use wxWidgets at work. It can be frustrating at times and in some places not very polished, but it does give the native look and feel for the platforms you're targeting. It actually wraps the native UI controls to give them a common API on all platforms that wxWidgets is ported to.

Grant Limberg
Qt's look and feel on platforms has been markedly improved in terms of blending in with your desktop. On Windows, it really does look like a Windows app. Same with OS X, application menu bar and all.
Yann Ramin
While true, you still end up using different sets of classes for Windows targets and Mac targets. From QMacStyle for OS X and from QWindowsXPStyle for Windows, whereas wxWidgets has a single API for all platforms
Grant Limberg
I think you misunderstand how styles work in Qt. The actual API is identical, the styling engine is a separate component, which often doesn't even have to be touched. The only case for handing special behavior is styling your own custom drawn widgets, which is something wx doesn't handle either.
Yann Ramin
+3  A: 

I'd also recommend wxWidgets together with DialogBlocks, which is a really nice visual GUI builder.

I will say that wxWidgets has a few rough edges, but the development community is very active and extremely responsive to bug reports / questions / contributions.

Gian Paolo
+3  A: 

I see nobody commented on GTKmm. It is the C++ incarnation of GTK+, and it is a real pleasure to use. I have also used Qt, but I don't like the messy signal/connect code, the moc_XXX generated files, etc. GTKmm ha signals and such, but not that preprocessing step, as well as almost all of the Qt toolkit can offer in the graphics arena.

Diego Sevilla
+3  A: 

Hi,

I had the same question and searched for good GUI toolkits.

At the end I found out, that a GUI toolkit isn't enough - I need a complete platform independent solution providing me the build environment, IDE integration and lower level functions like network sockets and file I/O.

My result? Since nearly 9 years I use Qt (but the first years only for GUI stuff) - now I have highly complex networking apps with load balancing, massive multithreading and image processing.

You can use Qt as commercial user with professional support (like me) or just start your own projects under GPL and with 4.5 with LGPL (which allows commercial use).

The other alternatives like wxWidgets and GTK++ are very good choices for GUI programming.

But if you want a well documented and complete solution, then Qt is your choice.

Best Regards, 3DH

3DH