summaryrefslogtreecommitdiffstats
path: root/src/activeqt/container/qaxscriptwrapper.cpp
blob: 912ac2705a30f9d1fd2026ffecee06aec996f13b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Copyright (C) 2015 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause

#include "qaxobject.h"

#include <QtAxServer/qaxfactory.h>

#include <qt_windows.h>

QT_BEGIN_NAMESPACE

QAxBase *qax_create_object_wrapper(QObject *object)
{
    IDispatch *dispatch = nullptr;
    QAxObject *wrapper = nullptr;
    qAxFactory()->createObjectWrapper(object, &dispatch);
    if (dispatch) {
        wrapper = new QAxObject(dispatch, object);
        wrapper->setObjectName(object->objectName());
        dispatch->Release();
    }
    return wrapper;
}

QT_END_NAMESPACE