问题描述
我有QtDesigner生成的C ++ widget代码(Qt开源v 4.7.3,使用QtDesigner中的Form-> View Code菜单)。
I have C++ widget code that was generated by QtDesigner (Qt open source v 4.7.3, using the Form->View Code menu in QtDesigner).
我已经以完全符合Qt的方式修改了该代码 - 只是根据生成的代码的模式手工编码了更多的信号,插槽和wigdets - 代码运行完美的代码:: Blocks构建。
I have modified that code in a manner that is entirely Qt compliant - just hand coded a few more signals, slots and wigdets based on the patterns of the generated code - code runs perfectly when built with Code::Blocks.
现在我想将修改后的C ++源代码转换回QtDesigner使用的ui XML格式。我正在寻找一个快速的方法(Win7-32平台)。
Now I'd like to convert my modified C++ source back into the ui XML format that QtDesigner uses. I'm looking for a quick way of doing that (Win7-32 platform).
有任何建议吗?
TIA
推荐答案
c ++是一种非常复杂的语言,所以这是非常难/长/昂贵的开发这样的工具我猜。
The c++ is a really complex language to parse, so it would be really hard / long / expensive to develop such a tool I guess.
一般的规则是永远不会修改生成的代码(在你的情况下,代码是
The general rule is to never modify generated code ( in your case the code is generated by Qt designer)
您可以
- 将生成的类
- 如果您认为Qt设计师缺少功能,您可以请求或提交补丁到Qt。但我不认为Qt打算扩展,因为QML已经成为新的接口方式。
最好的选择因为你可能是第一个。
The best option for you is probably the first.
这篇关于将Qt兼容C ++转换为ui XML(QtDesigner)格式:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!