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.

Questions on Stack Overflow are expected to relate to programming within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.
If this question can be reworded to fit the rules in the help center, please edit the question.

8 Answers
8

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++.

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+.

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 has signals and such, but not that preprocessing step, as well as almost all of the Qt toolkit can offer in the graphics arena.

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.

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 RaminFeb 25 '09 at 5:09

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 LimbergFeb 25 '09 at 5:15

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 RaminFeb 25 '09 at 5:22

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.

Maybe this is a silly question but isn't KDE pretty much linux only?
–
James MattaJul 3 '12 at 19:46

Not a silly question at all ;-) KDE is mostly used on Linux, but you can write an application using KDE libraries and in principle there's nothing to stop it from running on Windows.
–
David ZJul 3 '12 at 19:59