开发者

C++ framework for separating UI design from business logic

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


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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜