QAxSelect Class

QAxSelect 类为已注册的 COM 组件提供选择对话框。更多

Header: #include <QAxSelect>
CMake: find_package(Qt6 REQUIRED COMPONENTS AxContainer)
target_link_libraries(mytarget PRIVATE Qt6::AxContainer)
qmake: QT += axcontainer
继承: QDialog

公共类型

enum SandboxingLevel { SandboxingNone, SandboxingProcess, SandboxingLowIntegrity, SandboxingAppContainer }

公共函数

QAxSelect(QWidget *parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags())
virtual ~QAxSelect() override
QString clsid() const
QAxSelect::SandboxingLevel sandboxingLevel() const

详细说明

QAxSelect 对话框可用于为用户提供浏览系统中已注册 COM 组件并选择其中一个的方法。它还提供了一个组合框,用于选择所需的沙盒级别。所选组件的 CLSID 可以在应用程序中使用,例如初始化QAxWidget

QAxSelect select;
if (select.exec()) {
    QAxWidget *container = new QAxWidget;
    container->setControl(select.clsid());
    container->show();
}

另请参阅 QAxWidgetActiveQt Framework

成员类型文档

enum QAxSelect::SandboxingLevel

SandboxingLevel 枚举定义了所需的 ActiveX 沙盒级别。

常数描述
QAxSelect::SandboxingNone0不需要特定沙箱
QAxSelect::SandboxingProcess1在单独进程中运行 ActiveX 控件
QAxSelect::SandboxingLowIntegrity2在单独的低完整性进程中运行 ActiveX 控件
QAxSelect::SandboxingAppContainer3[自 6.5 起] 在单独的 AppContainer 隔离进程中运行 ActiveX 控件

沙箱要求将 ActiveX 作为 EXE 或启用了 AppID "DllSurrogate "的 DLL 生成。

成员函数文档

[explicit] QAxSelect::QAxSelect(QWidget *parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags())

构造一个 QAxSelect 对象。可通过parentflags 参数分别指定对话框父窗口部件和窗口标志。

[override virtual noexcept] QAxSelect::~QAxSelect()

销毁QAxSelect 对象。

QString QAxSelect::clsid() const

返回所选 COM 组件的 CLSID。

QAxSelect::SandboxingLevel QAxSelect::sandboxingLevel() const

返回 ActiveX 控件所需的沙盒级别。

© 2025 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.