“Qt Signals/Slots editor"的生成代码在哪里? [英] where is the generated code of "Qt Signals/Slots editor"?

查看:28
本文介绍了“Qt Signals/Slots editor"的生成代码在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

QtCreator 2.7.2,我用Qt Creator设计了一个连接,在*.ui文件中可以看到,但是在build后生成的文件ui_*.h中找不到,它在哪里?我很好奇.

QtCreator 2.7.2 ,I use the Qt Creator design a connection and i can see it in the file *.ui ,but I can't find it in the generated file ui_*.h after build, where is it ? I'm curious.

推荐答案

它就在那里,通常在 setupUi 方法的末尾.只是看起来更好.

It's there, usually by the end of setupUi method. Just look better.

例如,.ui 中的这个块

For instance, this chunk in the .ui

 <connections>
  <connection>
   <sender>checkBox</sender>
   <signal>toggled(bool)</signal>
   <receiver>checkBox_2</receiver>
   <slot>setChecked(bool)</slot>
  </connection>
 </connections>

结果

QObject::connect(checkBox, SIGNAL(toggled(bool)), checkBox_2, SLOT(setChecked(bool)));

在生成的标题中.

这篇关于“Qt Signals/Slots editor"的生成代码在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆