http://qt-project.org/doc/qt-4.8/activeqt.html
The ActiveQt modules are part of the Qt Commercial Edition and the Open Source Versions of Qt.
http://qt-project.org/doc/qt-4.8/qaxobject.html#details
http://qt-project.org/doc/qt-4.8/qaxbase.html#details
Here is a quote from the documentation for QAXBase
:
To call the methods of a COM interface described by the following IDL
dispinterface IControl
{
properties:
[id(1)] BSTR text;
[id(2)] IFontDisp *font;
methods:
[id(6)] void showColumn([in] int i);
[id(3)] bool addColumn([in] BSTR t);
[id(4)] int fillList([in, out] SAFEARRAY(VARIANT) *list);
[id(5)] IDispatch *item([in] int i);
};
use the QAxBase
API like this:
QAxObject object("<CLSID>");
QString text = object.property("text").toString();
object.setProperty("font", QFont("Times New Roman", 12));
connect(this, SIGNAL(clicked(int)), &object, SLOT(showColumn(int)));
bool ok = object.dynamicCall("addColumn(const QString&)", "Column 1").toBool();
QList<QVariant> varlist;
QList<QVariant> parameters;
parameters << QVariant(varlist);
int n = object.dynamicCall("fillList(QList<QVariant>&)", parameters).toInt();
QAxObject *item = object.querySubItem("item(int)", 5);
Note that the QList
the object should fill has to be provided as an element in the parameter list of QVariants
.
So basically you need to make sure that you are nesting a QList, in order to make your SAFEARRAY
work.
Hope that helps.