1. 程式人生 > >Qaxobject類學習筆記

Qaxobject類學習筆記

因為程式設計時需要利用com/ocx元件等開發,經常用到qaxwidget、qaxbase、qaxobject,經常用qt的自帶dumpcpp生成的cpp和h檔案部分函式無法使用,所以要直接用qaxobject去操作元件,我把常用的函式和功能梳理出來,以供後面忘了查備。(QT版本:qt5.9.1 msvc2015)

使用上述的類,必須在.pro檔案裡面加上

QT +=axcontainer

首先,看qaxobject的類資訊

  • 19 public functions inherited from QAxBase

QAxBase(IUnknown *iface = Q_NULLPTR)

QVariant

virtual void

clear()

QString

QVariant

dynamicCall(const char *function, const QVariant &var1 = QVariant(), const QVariant &var2 = QVariant(), const QVariant &var3 = QVariant(), const QVariant &var4 = QVariant(), const QVariant &var5 = QVariant(), const QVariant &var6

= QVariant(), const QVariant &var7 = QVariant(), const QVariant &var8 = QVariant())

QVariant

dynamicCall(const char *function, QList<QVariant> &vars)

bool

PropertyBag

virtual bool

long

queryInterface(const QUuid &uuid, void **iface) const

QAxObject *

querySubObject(const char *name, const QVariant &var1 = QVariant(), const QVariant &var2 = QVariant(), const QVariant &var3 = QVariant(), const QVariant &var4 = QVariant(), const QVariant &var5 = QVariant(), const QVariant &var6 = QVariant(), const QVariant &var7 = QVariant(), const QVariant &var8 = QVariant())

QAxObject *

querySubObject(const char *name, QList<QVariant> &vars)

bool

setControl(const QString &)

void

setPropertyBag(const PropertyBag &bag)

virtual void

QStringList

verbs() const