tags:

views:

11194

answers:

19

I'm looking for good windows GUI library for C++. The Ideal in my opinion shoud be:

  • Modern. MFC, wxWidgets, Qt were started a long time ago and they don't use modern C++ features and standard library.
  • Have a rich set of controls with decent features. The ability to drop HTML almost everywhere is a happiness for which I love wxWidgets when I don't hate it.
  • Open source. It's the must. If sources are available after purchase then it's considered ok.
  • Have a form designer in some way. Yeah, it would be great. After years of Delphi I cry every time when I have to specify control sizes by hand...
  • Free for commercial use. But if some library is REALLY good I will consider buying it.
  • Cross platform. Just a wish:) I can live without that.

Please suggest your candidates. One library per answer please.

P.S. I'm sorry for inevitable grammar errors. English is not my native language.

+22  A: 

WTL is a modern GUI framework created by Nenad Stefanovic from the ATL team. It is light-weight but still supports all the modern features of the OS.

Windows Template Library

Windows Template Library (WTL) is a C++ library for developing Windows applications and UI components. It extends ATL (Active Template Library) and provides a set of classes for controls, dialogs, frame windows, GDI objects, and more.

The unofficial documentation lives at the Code Project.

Frank Krueger
Just a slight remark - it was created by Nenad Stefanovic from ATL team, not MFC team. But I second your answer - WTL is an excellent library; one slight problem is that it depends on ATL which is not freely available.
Nemanja Trifunovic
I've heard ATL is depended on MFC in VS 2008 :( I hate MFC with all my heart.
Sergey Skoblikov
ATL is definitely not dependent on MFC in VS 2008. They have some shared code (CString, for instance), but you don't need to include the whole MFC library if you use just ATL.
Nemanja Trifunovic
One of WTL's strengths is that it is NOT dependent on MFC or .NET. In fact, is a good choice for access to Windows native UI especially in non-app executables (e.g., plugins).
jwfearn
This is not cross platform.
A: 

Not my question, but I'd like a cross-platform version of the same. Something that works on (minimally) Windows, OS X, and Linux. Tweaks would naturally have to be applied to each platform, but being able to design the main components in one place would be nice.

Stephen Deken
+5  A: 

I would take a second look at Qt -- it's not free for commercial use, but they have a good entry-level license if you are just starting out. I think their interface is fairly modern, although I didn't like that they seem to rely on language extensions that they preprocess.

What specifically are you looking for in the Modern category?

Lou Franco
That preprocessor kills me. I will try to dive deep in Qt. It's a real choice but I'm looking for alternatives. Maybe there is a promising one?
Sergey Skoblikov
IMO the preprocessing is fairly unobtrusive, IF you use a decent build manager like qmake. If you use visual studio without the integration it can be a pain in the ass.
Thomi
I was trying to use it with XCode -- it was a little annoying -- it was a while ago though -- might be better now.
Lou Franco
+14  A: 

wxWidgets - free, allowed for commercial application with many designers available ( http://wxdsgn.sourceforge.net/, http://www.dialogblocks.com/, http://wxformbuilder.org/, http://wxglade.sourceforge.net/ ... ).

I personally write many of my widgets from scratch but this is not an option always.

Iulian Şerbănoiu
He asked for something other than MFC, wxWidgets or Qt
Imran
also wx can't really be regarded as modern c++. It's nice but it has a lot of MFC era macros
Martin Beckett
+1  A: 

What about Smartwin++?

Their wiki seems to be down right now. Sample Hello World! code from Smartwin++ docs

Imran
Have you use it? If so, please describe your feelings:) It would be interesting.
Sergey Skoblikov
I only used Qt among C++ GUI toolkits. But judging from the "Hello World" example, it looked much less scary to me compared to MFC or any native C++ GUI library from Microsoft.
Imran
+36  A: 

I think you're writing Qt off too quickly; it doesn't use the standard library much, but that has less to do with being obsolete than with having different priorities. The QT containers use iterators, template algorithms, etc, but have a different iterator model; Qt iterators point between elements instead of at them. This makes forward and reverse traversal symmetric, and cleans up some edge cases for inserting and removing elements while traversing, though it's a little less efficient. And they do provide STL-style iterators too. It's a valid choice for a GUI library IMO; performance of the containers is unlikely to be the critical factor.

As for the preprocessor (moc), think of it more as an IDL compiler that knows how to read C++ headers instead of needing its own language. It doesn't preprocess your code, which is compiled directly. It just generates an additional cpp file containing the marshaling for signal/slot callbacks, which can get rather messy when they cross thread boundaries and need synchronization.

Qt is free if you can release your sources (even for commercial use; how many in-house tools really need to be proprietary), and not unreasonably priced if you can't (no per-unit royalties or anything particularly annoying)

puetzk
I agree that Trolltech's Qt is awesome, but the questioner mentions that it must be free for commercial use. While QT is open-source and free for other open source products, you do have to pay for the commercial version. Perhaps you can add something about that in your answer. It's worth the price.
Dusty Campbell
After all research I've chosen Qt. It's turning LGPL now. After that all the competitors are fading away.
Sergey Skoblikov
Qt has the best tools and docs of any free library I've come across: http://stackoverflow.com/questions/610/gui-programming-apis/54392#54392
Nick
+1  A: 

Have you looked at the Fox toolkit?

AShelly
+13  A: 

You should take a look at gtkmm. It is written in modern c++, uses stl, follows its conventions, includes support for utf-8. What's more, it's open source, cross-platform, and licensed under lgpl. From their site:

Features:

  • Use inheritance to derive custom widgets.
  • Type-safe signal handlers, in standard C++.
  • Polymorphism.
  • Use of Standard C++ Library, including strings, containers, and iterators.
  • Full internationalisation with UTF8.
  • Complete C++ memory management
    • Object composition
    • Automatic deallocation of dynamically allocated widgets.
  • Full use of C++ namespaces.
  • No macros.
  • Cross-platform: Linux (gcc), FreeBSD (gcc), NetBSD (gcc), Solaris (gcc, Forte), Win32 (gcc, MSVC++.Net 2003), MacOS X (gcc), others
  • Free software and free of cost for both Open Source and proprietary development.
  • Discussed, designed and implemented in public.
maxbog
The library itself looks impressive, but the look of GTK+ components on anything but Gnome is less than perfect.
Nemanja Trifunovic
I disagree - KDE has some nice Gnome integration.
coppro
+3  A: 

Both wx and QT can use the standard library. They contain their own collection classes (as does MFC) from the days, not many years ago when compiler support for STL was patchy. Some additions like copy-on-write strings aren't in the STL yet.

They could both use templates for some of the dispatch mechanisms that are done by macros(wx) or the precompiler(QT) but that wouldn't gain anything except less readable code.

Martin Beckett
Copy on Write is not *in* the STL. It's explicitly allowed, but not mandated. Profiled performance data has proven COW performs poorly in multi-threaded environments. Therefore, it's rare nowadays.
MSalters
Collections in Qt4 are similar to STL (which are still supported), but a lot more optimised, both in codesize and performance (thanks in part to using templates only when reasonable)
Javier
+7  A: 

Take a look at eGUI++ its got a nice modern object model. You can see an MDN Article Bring The Simplicity of Windows Forms to Native Apps And you can down load the code from John Torjo's website

Aaron Fischer
looks promising! I'll study that. Thank you!
Sergey Skoblikov
Wow, thanks for the pointer
Frank Krueger
+5  A: 

I would highly recommend JUCE, it's nice clean modern c++ which is very well documented with doxy comments. It has a wide array of gui classes and its very simple to extend the existing ones. The library covers more than just gui as well, there is lots of code for sound manipulation and generation, for threading, read/writing modern image formats, basic networking and much more. It looks nice too (has a OS X sort of feel by default) and is cross platform.

The down side: Although it is free (in both senses) for non-commercial use, commercial use requires the commercial licence which is quite costly.

All in all, definitely worth a look, I've used it for several hobby projects, one of which I intend to release at some point. It actually makes gui coding in c++ fun, and that's saying something!

Foo42
+17  A: 
jk
how can that be any good, it doesn't use XML. :-)
gbjbaanb
It's very interesting.
Sergey Skoblikov
Ben Collins
There is a distribution of the Begin application for either mac or windows from the sourceforge.net home page: http://sf.net/projects/adobe-source - you can also get on their mailing list and ask questions there- the original developers are still on it (including myself.)
fbrereto
+3  A: 

I have to throw my hat in with Qt. We are commercial license holder of Qt and while expensive it is worth every dollar. The Qt code base is very solid. The GUI designer is one of the better tools of that kind out there. A while ago we evaluated a group of the GUI toolkits available for windows against each other and Qt came out ahead in every aspect so I have seen some of these other toolkits.

If you want bullets here are mine ...

  • Object oriented, Qt has a very nice OO architecture that is very consistent throughout the class hierarchy

  • Signals and Slots give you a good way to handle the callback problem always present when developing UIs

  • While a little bit overly complicated it steers you towards a MVC architecture of showing data, which is not a bad thing

  • In addition to the large set of UI classes there are almost larger set of other classes supporting DB Operations, Threading, Networking and other tasks.

Yes Qt internally uses non STL containers and non STL strings. But don't let that be your criterium for disqualifying QT. The QT containers all have STL like iterators, and the String class has a lot of features. Last but not least, it has good multiplatform support.

Harald Scheirich
A: 

Since you named Delphi: You do know Borland C++ Builder also does VCL like Delphi does? You can distribute it for free and you get the source code.

Lars Truijens
Yes, I know. But I've grown to dislike VCL and I don't want to be tied to any particular compiler.
Sergey Skoblikov
A: 

What about winx?

+4  A: 

At one time, I had some interest for Ultimate++. Nice license (BSD), an IDE, supports various compilers, used in a number of real world complex applications (quite important!), etc.
I never had time to invest there, but I still see it as an interesting alternative.

PhiLho
A: 

I stumbled across this. http://www.atai.org/guitool/

BubbaT
The list on this site is interesting. But hardly any library in this list can be considered modern.
Sergey Skoblikov
+1  A: 

I vote for WTL. Lightweight and native. You can't beat those two criteria from my perspective. I write my model layer in stl c++ and use the native libraries per operating system. This guarantees your apps don't look like ass and allows you to make use of the widest range of features on each os.

For a WTL GUI designer I recommend the excellent but for some reason totally unknown to most WTLBuilder: www.wtlbuilder.com.

Anthony Lambert
The domain wtlbuilder.com has expired and I'm unable to find an alternative source...
milan1612
A: 

Better late than never, but you might find this interesting. Your only requirements that it satisfies are "Open Source", and "Free". It does do something you didn't ask for

  • reduce your source code by an order of magnitude

  • give you total control over layout, data binding, variable arrays of controls, etc.

When you see how it works, you can easily add your own controls.

BTW - it has one more downside - it's addictive.

Mike Dunlavey