Ui forms: Add runtime or compile time?

和自甴很熟 提交于 2019-12-11 01:34:39

问题


I want to know which way is efficient if I am having number of UI forms. I don have any idea about memory utilization in both of case I just tried both ways in a simple example.

http://qt-project.org/doc/qt-4.8/designer-using-a-ui-file.html here they described both ways. Now which one method is more efficient?


回答1:


The prefered way to use ui files is to compile them with the uic. QtCreator will automatically take care of this. You can use the QUiLoader if you have special constraints - for example if you want to load a customized ui without the need to recompile your program.

In terms of memory usage you should not notice any difference. Both instanciate the same classes. Of course the time to read/parse/generate code is needed at compile or at runtime. I would say that in a normal application this is rather insignificant since a user interaction is needed to change the form of a application, but I have never benchmarked this.



来源:https://stackoverflow.com/questions/16892944/ui-forms-add-runtime-or-compile-time

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!