views:

126

answers:

4

So after years of working with C# I thought it would be a good idea to write something in C++ to get my skills tuned up. It turns out they are much rustier than I could have possibly imagined. I want to create a C++ app with a UI but I do not want to use Windows Forms or WPF or anything similar to what I have been doing for a while now.

Can anybody suggest an alternative and good API or toolset/framework for creating UI's in C++. Last time I was looking into something like this QT looked like it might be useful.

Thanks in advance.

+4  A: 

If portability is a concern, Qt is practically the best choice. Alternatively, for Windows, MFC is a library that might help you, although personaly I hate it. In any case, why use C++ for GIU if there are far better languages for that, like C#?

Armen Tsirunyan
+6  A: 

Qt is pretty good but it has a few oddities and is pretty heavy in the code it requires. I do like Qt though.

Another option (though not one I've ever tried) is wxWidgets. It seems to be pretty similar to Qt but a tad lighter weight.

Your other options, assuming windows, are to use straight Win 32 (This will give you the best understanding but is the most verbose by a long way), MFC (This is far simpler than straight Win32 code but is pretty strange in the way it handles things most of the time) or ATL (which is a nice mix between MFC and straight Win32 but very COM centric).

Goz
QT is incorrect. The correct spelling is Qt :)
Armen Tsirunyan
I've used both. wxWidgets is a bit lighter indeed, but Qt's signal/slot mechanism is often worth its weight. Its other introspection features, meh.
MSalters
I have to say the thing that got me instantly with Qt is the signal/slot mechanism :)
Goz
Thanks for all your comments :)
DrLazer
+2  A: 

For C++ Qt is the only one I know that's C++ native unless you want to drink the Microsoft kool-aid and go for MFC. It's also nicely cross-platform and has that as a base design decision.

GNOME does have a C++ wrapper, and it's not bad. And GNOME is more-or-less cross-platform as well, though as I understand it Qt does a better job in that department.

A long time ago there was Fresco, and before that a different toolkit who's name I can't remember, but they're long ago dead. And it was hitched to CORBA anyway, and that's very bad juju.

Omnifarious
+3  A: 

My only choice would be Qt. There are some UI-Frameworks around like wxWidgets, FLTK etc, but none of them could nearly offer the functionality Qt provides. C++ is not comparable to C# regarding the libraries. You will miss multithreading, UI, xml, unicode, networking, regular expressions and many other libraries you have in .Net. In Qt you will find most of them!!! Qt is not only for UI (e.g. doxygen is probably the best known not-UI tool written in Qt.) it provides a mature framework along with intuitively comprehensible API, excellent documentation, tutorials and entire IDE: http://get.qt.nokia.com/qtsdk/qt-sdk-win-opensource-2010.05.exe

I would discourage from using wxWidgets (in was refered in a previous post). It is not nearly as mature as Qt - e.g.: has bad, redundant, inconsistent API; poor documentation; misleading feature list (e.g. XML is not supported indeed); heavily usage of C-macros and many-many other illnesses inherited from MFC. In my opinion, the often cited advantage of wxWidgets to be light-weight is not up-to date in the age of GHz/GByte computers.

Regards, Valentin Heinitz

Valentin Heinitz
thankyou for this information
DrLazer
Interesting. I've never liked wxWidgets much myself, even though I've only examined it very briefly. Now I know why. IMHO, the world needs a Tk replacement for scripting languages to use. I was hoping wxWidgets would be it, but it doesn't look to be.
Omnifarious
Have you evaluated PyQt or QtDeclarative?
Valentin Heinitz