views:

53

answers:

2

Is there a c++ framework for building rich desktop applications?

Essentially the important feature I'm looking for similar to Flex4 MXML to separate the visual presentation and application logic into xml. Does Qt4, for example, allow the visual appearance to be specified in xml definition? This is state based, so on events the UI changes and has new visual content like this and this

+2  A: 

Yes.

Using Qt's Designer tool, you can separate the UI design into an XML, and then a UI compiler (uic tool) compiles it into a UI class.

Your code uses that class (either by delegation or by inheritance) to show its own GUI.
And throw in Qt's signal-slot mechanism for event handling and you have a heavenly development framework for C++ GUI apps :)

Edit:

Although Qt has a tool to specify UIs in XML, you don't always have to do so. You can create UIs programmatically, but why would anyone do so, right? The day I learnt to use Qt Designer was the day I stopped creating UIs programmatically.

And I personally feel that Qt's paradigm of separating the UI from the event handling code (unlike netbeans UI designer) is aaawwweeesssooommmeee.

Here Be Wolves
thanks..I want this to be state based, so on events the UI changes and has new visual content..is there a Qt sample code to do so?
iceman
I suppose you could find examples of this by googling.. I just tried googling for "Qt Designer tutorials" and found a few links... I'm sure you will too. Just look for the newer versions of Qt (4.3+).
Here Be Wolves
A: 

Qt does. The XML is compiled into code at build time, so the UI remains static (i.e., you have to re-compile to change it).

Just FWIW, with wxWidgets and XRC you can specify a dynamic UI in XML -- i.e., the XML file remains separate from application and changing the XML file makes matching changes to the UI (within limits, of course).

Jerry Coffin