QAxObjectInterface Class
QAxObjectInterface 是一个接口,提供了QAxObject 和QAxWidget 的通用属性。更多内容...
| 头文件: | #include <qaxobjectinterface.h> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS AxContainer) target_link_libraries(mytarget PRIVATE Qt6::AxContainer) |
| qmake: | QT += axcontainer |
| 自: | Qt 6.0 |
| 被继承于: |
公共函数
| virtual | ~QAxObjectInterface() |
| virtual ulong | classContext() const = 0 |
| virtual QString | control() const = 0 |
| virtual void | resetControl() = 0 |
| virtual void | setClassContext(ulong classContext) = 0 |
| virtual bool | setControl(const QString &c) = 0 |
成员函数文档
[virtual noexcept] QAxObjectInterface::~QAxObjectInterface()
[pure virtual] ulong QAxObjectInterface::classContext() const
返回 ActiveX 控件将运行的上下文(默认值为 CLSCTX_SERVER)。
另请参阅 setClassContext(),QAxBaseWidget::classContext 以及QAxBaseObject::classContext 。
[pure virtual] QString QAxObjectInterface::control() const
返回由该QAxBase 对象封装的COM对象的名称。
另请参阅 setControl()、QAxBaseWidget::control 以及QAxBaseObject::control 。
[pure virtual] void QAxObjectInterface::resetControl()
断开与 COM 对象的连接并将其销毁。
另请参阅 QAxBaseWidget::control 和QAxBaseObject::control 。
[pure virtual] void QAxObjectInterface::setClassContext(ulong classContext)
设置 ActiveX 控件的运行上下文classContext
在调用 CoCreateInstance 时,此参数会影响“dwClsContext”参数。对于同时支持“进程内”和“进程外”两种启动方式的控件,可通过此参数控制其启动模式。 此外,当与 CLSCTX_ENABLE_CLOAKING 以及一个模拟令牌配合使用时,它还可以用于修改/降低控件的权限。
请注意,此函数必须在调用setControl()之前调用,才能生效。
另请参阅 QAxBaseWidget::classContext 和QAxBaseObject::classContext 。
[pure virtual] bool QAxObjectInterface::setControl(const QString &c)
返回设置 COM 对象是否成功。
将此QAxBase 对象封装的COM对象的名称设置为c 。
© 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.