检查所有 Qt 信号/插槽连接

发布于 2024-10-07 02:05:52 字数 171 浏览 0 评论 0原文

我们进行了大量的命名空间重构。现在我们面临的一个大问题是,我们只能在运行时检查是否有错误的信号/槽连接。

是否有外部工具、代码分析器或方法可以立即检查所有信号/插槽连接?

我们考虑了 froglogic 挤压,但我们不太确定挤压是否可以帮助我们进行详细的测试。

提前致谢, 拉尔斯

we done a lot of namespace refactoring. One big problems for us is now, that we only can check at runtime, if we have wrong signal/slot connections.

Is there a external tool, code analyser or a method, which we can check all signal/slot connection at once?

We think about froglogic squish, but we are not quite sure, if squish can help us in this detailed testing.

Thanks in advance,
Lars

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

打小就很酷 2024-10-14 02:05:52

有一个东西可能对您有用:Conan 1.0.0:。它仅适用于 qt 4.6 和 4.7。
请参阅主题@qtCentre

我还可以向您推荐 Visual Assist X 用于 MSVStudio 200x 和 2010 的插件工具,来自 http: //www.wholetomato.com/,其中有许多重构解决方案。例如:重命名工具:


alt text


如果您设置复选框“注释和字符串”,它也会在代码中的任何位置重命名该符号,在整个解决方案中。因此,如果您有正确的连接并且只是重构命名空间和类,那么这个工具可以帮助您。我希望如此。

There is a thing, that might be useful for you: Conan 1.0.0:. It works only on qt 4.6 and 4.7.
See topic @qtCentre

Also I can recommend you Visual Assist X addIn tool for MSVStudio 200x and 2010 from http://www.wholetomato.com/, which has MANY solutions for refactoring. E.g.: renaming tool:


alt text


If you set checkbox "Comments and Strings" it will also rename this symbol everywhere in your code, in whole solution. So if you had correct connections and just refactoring namespaces and classes, this tool can help you. I hope so.

滥情稳全场 2024-10-14 02:05:52

Conan (sourceforge.net/projects/conanforqt/) 不会帮助您解决问题,因为它只能在运行时检查和监视现有连接。

据我所知,没有任何工具可以在编译时检查所有连接定义是否有效。请注意,这可能甚至不可行,因为连接可以从局部变量、输入参数等动态构造。

我看到的唯一选择是找到建立连接的所有位置。对于每个连接,检查是否有任何明显的问题:const 正确、参数类型不是名称等。放置断点并开始调试。任何不正确的连接都将被 Qt 记录到控制台输出 / std:err 中。

祝你好运

p.s.:你提到过

模型对话也有问题

这适用于柯南吗?如果是的话,你能给我提供详细信息,以便我更新柯南吗?

Conan (sourceforge.net/projects/conanforqt/) will not help you with your problem as it can only examine and monitor existing connections at run-time.

As far as I know there is no tool that can check during compile time if all connection definitions are valid. Note that this is probably not even feasible, as connections can be dynamically constructed from local variables, input arguments, etc.

The only option I see is to find all places where connections are made. For each connection, check for any obvious problems: const correct, argument types not names, etc. Place a breakpoint and start debugging. Any incorrect connection will be logged to the console output / std:err by Qt.

Good luck

p.s.: you mentioned

Also have problems with model dialogues

Does this apply to Conan? If so can you provide me with details so I can update Conan?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文