testcon - 一个 ActiveX 测试容器 (ActiveQt)

本应用程序实现了一个用于 ActiveX 控件的通用测试容器。您可以将系统中已安装的 ActiveX 控件插入其中,并执行方法以及修改属性。该容器会将事件和属性变化的信息以及调试输出记录到日志窗口中。

部分代码使用了 Qt 元对象和 ActiveQt 框架的内部机制,不建议在应用程序代码中直接使用。

您可以使用该应用程序查看通过QAxWidget 类在实例化特定ActiveX控件时可用的槽、信号和属性,并测试您在Qt应用程序中实现或计划使用的ActiveX控件。

该应用程序可以加载并执行 JavaScript、VBScript、Perl 和 Python(如果已安装)格式的脚本文件,以实现所加载控件的自动化操作。scripts 子目录中提供了使用 QAxWidget2 类的示例脚本文件。

请注意,本示例的 qmake 项目包含一个名为testcon.rc 的资源文件,其中包含版本资源。某些 ActiveX 控件(例如 Shockwave ActiveX 控件)需要此资源;若缺少此类版本信息,这些控件可能会崩溃或出现异常行为。

要构建该工具,您必须先构建QAxContainer 和QAxServer 这两个库。然后在tools/testcon 目录中运行您的 make 工具,并运行生成的testcon.exe 程序。

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.