summaryrefslogtreecommitdiffstats
path: root/src/activeqt/container/qaxscriptwrapper.cpp
blob: f438273b53f63513231d70cbc43323d341e1ea4a (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
26
// 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>

#include <QtCore/private/qcomptr_p.h>

QT_BEGIN_NAMESPACE

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

QT_END_NAMESPACE