PDA

View Full Version : VARIANT <-> QVariant



will49
25th September 2009, 21:50
I'm working with some legacy Windows C++ code that gets and sets a Windows VARIANT type.

I can't see a way to convert this directly to and from a QVariant. I could make my own conversion I guess, but it seems like it would be in Qt already as part of ActiveQt (which I'm not using).

Is there a way do this?

dbzhang800
26th September 2009, 06:17
You can refer the files: %QTDIR%/src/activeqt/shared/qaxtypes.cpp and qaxtypes.h

bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &typeName = 0, bool out = false);
QVariant VARIANTToQVariant(const VARIANT &arg, const QByteArray &typeName, uint type = 0);

will49
27th September 2009, 00:39
Excellent. Just what I was looking for.