QT 012 [深入] Qt setupUi函数的原理和实现
2017-07-20 15:36
120 查看
1 度娘:
setupUi(this)是由.ui文件生成的类的构造函数,这个函数的作用是对界面进行初始化,它按照我们在Qt设计器里设计的样子把窗体画出来,把我们在Qt设计器里面定义的信号和槽建立起来。也可以说,setupUi 是我们画界面和写程序之间的桥梁。2 stackoverflow
setupUi() creates the actual instances of widgets for you. A form that you create in QtDesigner is stored just as XML file. So to be able to build the actual "window" with all the elements that you put on it in QtDesigner and display it in your application,setupUi() is created for you automatically by UIC (UI compiler - a Qt tool) so you don't have to do that manually. All the properties that you set in QtDesigner and all elements you put there will be "translated" in C++ code like this:
QLabel *label1 = new QLabel(tr("Start"), this);
QTableView *view1 = new QTableView(this);
...
3 实际应用:
REF:
1 Qt中Ui名字空间以及setupUi函数的原理和实现http://blog.csdn.net/songjinshi/article/details/7333119
相关文章推荐
- 【QT】深入qt信号与槽实现原理
- 【Java深入】HashMap的实现原理与源码剖析(一)
- 【深入理解java集合系列】ArrayList实现原理
- 深入FFM原理与实践(转载美团点评的文章,准备自己实现一遍FFM)
- 深入Java集合学习系列:LinkedHashSet的实现原理
- 深入Java集合学习系列:ConcurrentSkipListMap实现原理
- 深入Java集合学习系列:ArrayList的实现原理
- 聊聊并发(一)——深入分析Volatile的实现原理
- Oracle数据块实现原理深入解读
- 转:Spring技术内幕——深入解析Spring架构与设计原理(一)IOC实现原理
- 深入php内核,从底层c语言剖析php实现原理
- Mybatis实现原理深入解析 (转载)
- 深入Java集合学习系列:HashSet的实现原理
- java 中HashMap实现原理深入理解
- struts2--(4)---深入解析struts.xml配置的实现原理
- 111 深入分析 synchronized 的实现原理
- 深入Java集合学习系列:HashSet的实现原理
- 深入分析java线程池的实现原理
- Spring技术内幕——深入解析Spring架构与设计原理(三)数据库的操作实现
- 深入Java集合学习系列:ArrayList的实现原理