[Qt-interest] ActiveQt QVariant and VC VARIANT

1+1=2 dbzhang800 at gmail.com
Mon Sep 21 15:43:38 CEST 2009


Hello everyone,

I want to call an activeX component through activeQt, but I don't know
how to deal with VARIANT.

In VC++ 6;

void DoGo(short nNumberOfAxes, const VARIANT& nAxisArray);


example code:
	
const int nSize(3);
 short nAxesArray[nSize] = { 0, 1, 2};
 COleSafeArray arrAxes;
 arrAxes.CreateOneDim(VT_I2,nSize,nAxesArray);
 MintController1.DoGo (3, arrAxes);



In Qt, What I get is:

void DoGo (int nNumberOfAxes, QVariant nAxisArray) [slot]

call the function directly:

	QVariantList params = ...
	object->dynamicCall("DoGo(int, QVariant)", params);


So, anyone can give me an example code. I don't know how to write params


Please help.

Thanks.



More information about the Qt-interest-old mailing list