views:

2122

answers:

11

I am writing a high performance system in portable modern c++. A lot of STL and Boost. I'd like to start building some front ends to this system. Ordinarily I would opt to use a non c++ solution to a UI, however this is meant to be a very high performance UI, meaning low latency to respond to messages, high volume of messages to sort and display, etc. I have written a lot of real-time UIs in .NET, they accomplish the job pretty well. However I really want this to be cross platform with no tricks (such as Mono) and have it just work. What are some of the best options to achieve this?

EDIT:

Let me throw in another one that I just remembered, JUCE. Free for non commercial use, and cross platform. Only problem is that the development is controlled by one person, but the source code is available.

JUCE

+12  A: 

Althought i'm not sure what you mean by "Tricks", i can only give you these links. Whether it's "best" is for you to decide.

  • wxWidgets. Free for commercial use. Old, but compatible API design (no exceptions, no templates, no RTTI, no use of STL). It uses the native widgets.
  • Qt. Modern Framework. Support for SQL, for embedded ECMA script. Includes a embedded Webbrowser. Widgets are CSS themable and can be put on transformable canvas. Amazing toolkit. It's also fast. Not free for commercial use, but free for Open-Source projects.

    • Edit: as of 14. Jan 2009, Nokia announced to put Qt into the LGPL license, making Qt available for commercial usage - free of charge.
  • GtkMM. C++ binding to the famous gtk+ toolkit used as the foundation of GNOME. Free for commercial (but can't link statically). Modern C++ API. GUI Toolkit only. Like Qt, it draws the widgets itself. This yields to somewhat poor look on Windows (Qt draws the widgets quite well). I haven't tested it, so i can't tell you the performance.

There are more. But i only know those reasonable well to tell you about them.

Johannes Schaub - litb
Should be noted that Qt uses native widgets as well (if it can, of course), and supports proprietary styles if desired (in addition to QStylesheets/"CSS").
strager
How well does Qt perform for real-time applications, where frequent repaints are required? Anyone know?
ApplePieIsGood
You can download the free Qt package, and try out the many samples. they include demonstrations about its capabilities. Sure, without an realtime operation system, it won't be able to operate in realtime, but i found it quite fast and responsive.
Johannes Schaub - litb
+1  A: 

One of the best looking open source applications I've seen is Songbird. It's an iTunes-like media player built on top of Modzilla's XULRunner framework.

eed3si9n
I found songbird deathly slow to load and put that down to the overhead of loading xulrunner. Not sure if that's what the cause really was though.
thomasrutter
+1  A: 

I like wxwidgets in general, but I've mostly used it on Linux. I just recently tried installing on Windows XP with g++ and have had a b**** of a time installing it.

Edit: To do a bit more detail, I'm having trouble getting it to build.

BubbaT
+4  A: 

You'll find many cross-platform GUI libraries for C++, but AFAIK Qt is the only real choice.

Nemanja Trifunovic
+2  A: 

I believe Ultimate++ (you can easily do a search on Google based on the name Ultimate++) is very good. It takes advantage of C++ templates heavily, but the problem is it only runs on and produces executables for Windows and Linux and not Mac OS. It has its on IDE and its IDE is written using Ultimate++ itself (chicken and egg problem). The advantage of using U++ over .NET and Mono is the resulting apps have smaller footprint as no framework is required to be installed in order for the apps to run.

Khnle
+5  A: 

Qt is by far the most complete, well supported, cross-platform C++ GUI framework in existence today.

Paul Betts
+4  A: 

I have always really liked wxWidgets.

Regarding the response on installing it on windows, there are a couple great videos on it at... http://blip.tv/file/1068698 and here http://wxwidgets.info/video

leaf dev
+1  A: 

A list of C++ GUI toolkits can be found in an old blog post I wrote. About half of them are cross platform (across the 'big three'). Alas a few of them have largely been abandoned.

Unfortunately none of them come without compromise. IMO there is no obvious choice when it comes to C++ GUI libraries. Investigate thoroughly for your particular requirements.

If you don't have particularly exotic GUI needs any of wxWidgets, Qt, FLTK or Gtkmm will likely do the trick.

MattyT
A: 

Let's not forget XVT it is available as a C++ Object Library and a C API. See www.XVT.com. It lost its way in the middle 90's but is still kept up-to-date and sold. It uses the native widgets where possible rather than emulation. When it was popular it was bought by 19000+ companies to ship software alot of it commerically and has huge depth to its implementation.

and no I don't work for them!

Tony

Tony Lambert
+1  A: 

I have recently studied almost all the toolkits mentioned above. I'd say Qt is by far the most advisable toolkit to use. I say 'advisable' but not 'best' because really no toolkit is perfect, in general there are no 'perfect' solutions to cross-platform problems.

Here are some of the pros and cons of Qt 4.5 (aka Qt 2009.01), available under LGPL starting from jan 2009

advantages:

  1. supports a lot of platforms, the most significant ones (i assume) are Windows, Mac OS X and Linux.
  2. looks native (sometime really using the native stuff under the hood) on Windows, Mac OS X and Linux. It works really nice on windows. Cocoa is supported on Mac OS X, which is a big deal. On Mac OS X, it is possible to make the interface look almost indistinguishable from native Cocoa applications.
  3. it comes with a really really good cross platform build system, which may save loads of time
  4. it is a full suite, like some say, an application framework, not just a GUI framework. e.g. database and network. it even gives you a webkit controls.
  5. great great documentation. one of the best sets of documentation you can find on GUI frameworks. it's even better than MSDN and apple development references.
  6. all the other common cross platform stuff

disadvantages:

  1. it's big. setup is not so trivia. learning take a bit of time. occupies a lot of disk space.
lyxera
Your order in point 1 is wrong. It should be Windows, Linux and Mac :)
Piotr Dobrogost
A: 

You say you would not ordinarily write a UI in C++, but are concerned about performance in this case. I therefore Nth the recommendations of Qt, as it has bindings for other languages, e.g. PyQt. Your widgets will all be fast C++ Qt widgets, you can sort your messages with thinly-wrapped native Qt methods, and hold it all together with a bit of python/perl/whatever.