46 #ifndef QT_NO_WIN_ACTIVEQT 55 # include <private/qsystemlibrary_p.h> 66 CLSID
CLSID_QRect = { 0x34030f30, 0xe359, 0x4fe6, {0xab, 0x82, 0x39, 0x76, 0x6f, 0x5d, 0x91, 0xee } };
67 CLSID
CLSID_QSize = { 0xcb5f84b3, 0x29e5, 0x491d, {0xba, 0x18, 0x54, 0x72, 0x48, 0x8e, 0xef, 0xba } };
68 CLSID
CLSID_QPoint = { 0x3be838a3, 0x3fac, 0xbfc4, {0x4c, 0x6c, 0x37, 0xc4, 0x4d, 0x03, 0x02, 0x52 } };
70 GUID IID_IAxServerBase = { 0xbd2ec165, 0xdfc9, 0x4319, { 0x8b, 0x9b, 0x60, 0xa5, 0x74, 0x78, 0xe9, 0xe3} };
77 #if defined(Q_OS_WINCE) 82 memset(&fdesc, 0,
sizeof(fdesc));
83 fdesc.cbSizeofstruct =
sizeof(FONTDESC);
84 fdesc.cySize.Lo = font.
pointSize() * 10000;
85 fdesc.fItalic = font.
italic();
89 fdesc.sWeight = font.
weight() * 10;
92 HRESULT res = OleCreateFontIndirect(&fdesc, IID_IFontDisp, (
void**)&f);
96 #if defined(QT_CHECK_STATE) 97 qWarning(
"QFontToIFont: Failed to create IFont");
116 f->get_Charset(&charset);
117 f->get_Italic(&italic);
119 f->get_Strikethrough(&strike);
120 f->get_Underline(&underline);
121 f->get_Weight(&weight);
133 #if defined(Q_OS_WINCE) 137 IPictureDisp *pic = 0;
140 desc.cbSizeofstruct =
sizeof(PICTDESC);
141 desc.picType = PICTYPE_BITMAP;
143 desc.bmp.hbitmap = 0;
151 HRESULT res = OleCreatePictureIndirect(&desc, IID_IPictureDisp,
true, (
void**)&pic);
153 if (pic) pic->Release();
155 #if defined(QT_CHECK_STATE) 156 qWarning(
"QPixmapToIPicture: Failed to create IPicture");
166 ipic->get_Type(&type);
167 if (type != PICTYPE_BITMAP)
171 ipic->get_Handle((OLE_HANDLE*)&hbm);
181 if (ole >= 949998 || VariantTimeToSystemTime(ole, &stime) ==
false)
184 QDate date(stime.wYear, stime.wMonth, stime.wDay);
185 QTime time(stime.wHour, stime.wMinute, stime.wSecond, stime.wMilliseconds);
195 memset(&stime, 0,
sizeof(stime));
199 stime.wDay = date.
day();
200 stime.wMonth = date.
month();
201 stime.wYear = date.
year();
204 stime.wMilliseconds = time.
msec();
205 stime.wSecond = time.
second();
206 stime.wMinute = time.
minute();
207 stime.wHour = time.
hour();
211 SystemTimeToVariantTime(&stime, &vtime);
218 #if defined(Q_OS_WINCE) 219 return QColor(GetBValue(col),GetGValue(col),GetRValue(col));
223 return QColor(GetRValue(cref),GetGValue(cref),GetBValue(cref));
252 if (typeName ==
"short" || typeName ==
"char")
254 else if (typeName ==
"float")
264 if (out && arg.vt == (VT_VARIANT|VT_BYREF) && arg.pvarVal) {
269 VARIANT *pVariant =
new VARIANT;
271 arg.vt = VT_VARIANT|VT_BYREF;
272 arg.pvarVal = pVariant;
276 switch ((
int)qvar.
type()) {
278 if (out && arg.vt == (VT_BSTR|VT_BYREF)) {
280 SysFreeString(*arg.pbstrVal);
282 arg.vt = VT_BSTR|VT_BYREF;
287 arg.pbstrVal =
new BSTR(arg.bstrVal);
294 if (out && arg.vt == (VT_I4|VT_BYREF)) {
295 *arg.plVal = qvar.
toInt();
298 arg.lVal = qvar.
toInt();
300 if (typeName ==
"short") {
302 arg.piVal =
new short(arg.lVal);
303 }
else if (typeName ==
"char") {
305 arg.pcVal=
new char(arg.lVal);
307 arg.plVal =
new long(arg.lVal);
315 if (out && (arg.vt == (VT_UINT|VT_BYREF) || arg.vt == (VT_I4|VT_BYREF))) {
316 *arg.puintVal = qvar.
toUInt();
319 arg.uintVal = qvar.
toUInt();
321 arg.puintVal =
new uint(arg.uintVal);
328 if (out && arg.vt == (VT_CY|VT_BYREF)) {
330 #if !defined(Q_OS_WINCE) && defined(_MSC_VER) && _MSC_VER >= 1400 331 }
else if (out && arg.vt == (VT_I8|VT_BYREF)) {
337 arg.pllVal =
new LONGLONG(arg.llVal);
346 arg.pcyVal =
new CY(arg.cyVal);
354 if (out && arg.vt == (VT_CY|VT_BYREF)) {
356 #if !defined(Q_OS_WINCE) && defined(_MSC_VER) && _MSC_VER >= 1400 357 }
else if (out && arg.vt == (VT_UI8|VT_BYREF)) {
363 arg.pullVal =
new ULONGLONG(arg.ullVal);
370 arg.cyVal.int64 = qvar.toULongLong();
372 arg.pcyVal =
new CY(arg.cyVal);
382 if (out && arg.vt == (VT_BOOL|VT_BYREF)) {
383 *arg.pboolVal = qvar.toBool() ? VARIANT_TRUE : VARIANT_FALSE;
386 arg.boolVal = qvar.toBool() ? VARIANT_TRUE : VARIANT_FALSE;
388 arg.pboolVal =
new short(arg.boolVal);
394 if (out && arg.vt == (VT_R8|VT_BYREF)) {
395 *arg.pdblVal = qvar.toDouble();
398 arg.dblVal = qvar.toDouble();
402 arg.pfltVal =
new float(arg.dblVal);
404 arg.pdblVal =
new double(arg.dblVal);
411 if (out && arg.vt == (VT_COLOR|VT_BYREF)) {
418 arg.plVal =
new long(arg.lVal);
427 if (out && arg.vt == (VT_DATE|VT_BYREF)) {
433 arg.pdate =
new DATE(arg.date);
439 if (out && arg.vt == (VT_DISPATCH|VT_BYREF)) {
442 *arg.ppdispVal =
QFontToIFont(qvariant_cast<QFont>(qvar));
444 arg.vt = VT_DISPATCH;
445 arg.pdispVal =
QFontToIFont(qvariant_cast<QFont>(qvar));
447 arg.ppdispVal =
new IDispatch*(arg.pdispVal);
454 if (out && arg.vt == (VT_DISPATCH|VT_BYREF)) {
459 arg.vt = VT_DISPATCH;
462 arg.ppdispVal =
new IDispatch*(arg.pdispVal);
472 if (out && (arg.vt & VT_BYREF)) {
473 switch(arg.vt & ~VT_BYREF) {
487 *arg.pintVal = shape;
490 *arg.puintVal = shape;
497 arg.plVal =
new long(arg.lVal);
508 const int count = list.
count();
509 VARTYPE vt = VT_VARIANT;
521 pElement = &variant.lVal;
525 pElement = &variant.dblVal;
529 pElement = &variant.date;
533 pElement = &variant.boolVal;
536 #if !defined(Q_OS_WINCE) && defined(_MSC_VER) && _MSC_VER >= 1400 538 pElement = &variant.llVal;
541 pElement = &variant.cyVal;
547 SAFEARRAY *array = 0;
553 int maxColumns = col.
count();
556 SAFEARRAYBOUND rgsabound[2] = { {0} };
557 rgsabound[0].cElements = count;
558 rgsabound[1].cElements = maxColumns;
559 array = SafeArrayCreate(VT_VARIANT, 2, rgsabound);
561 for (LONG i = 0; i < count; ++i) {
564 int columnCount =
qMin(maxColumns, columns.
count());
565 for (LONG j = 0; j < columnCount; ++j) {
567 VariantInit(&variant);
570 SafeArrayPutElement(array, rgIndices, pElement);
578 array = SafeArrayCreateVector(vt, 0, count);
583 VariantInit(&variant);
585 SafeArrayPutElement(array, &
index, pElement);
589 if (out && arg.vt == (VT_ARRAY|vt|VT_BYREF)) {
591 SafeArrayDestroy(*arg.pparray);
592 *arg.pparray = array;
594 arg.vt = VT_ARRAY|vt;
597 arg.pparray =
new SAFEARRAY*(arg.parray);
607 const int count = list.
count();
608 SAFEARRAY *array = SafeArrayCreateVector(VT_BSTR, 0, count);
612 SafeArrayPutElement(array, &
index, bstr);
616 if (out && arg.vt == (VT_ARRAY|VT_BSTR|VT_BYREF)) {
618 SafeArrayDestroy(*arg.pparray);
619 *arg.pparray = array;
621 arg.vt = VT_ARRAY|VT_BSTR;
624 arg.pparray =
new SAFEARRAY*(arg.parray);
635 SAFEARRAY *array = SafeArrayCreateVector(VT_UI1, 0, count);
639 SafeArrayAccessData(array, (
void **)&dest);
640 memcpy(dest, data, count);
641 SafeArrayUnaccessData(array);
644 if (out && arg.vt == (VT_ARRAY|VT_UI1|VT_BYREF)) {
646 SafeArrayDestroy(*arg.pparray);
647 *arg.pparray = array;
649 arg.vt = VT_ARRAY|VT_UI1;
652 arg.pparray =
new SAFEARRAY*(arg.parray);
664 typedef HRESULT(WINAPI* PGetRecordInfoFromTypeInfo)(ITypeInfo *, IRecordInfo **);
665 static PGetRecordInfoFromTypeInfo pGetRecordInfoFromTypeInfo = 0;
666 static bool resolved =
false;
669 pGetRecordInfoFromTypeInfo = (PGetRecordInfoFromTypeInfo)oleaut32.
resolve(
"GetRecordInfoFromTypeInfo");
672 if (!pGetRecordInfoFromTypeInfo)
675 ITypeInfo *typeInfo = 0;
676 IRecordInfo *recordInfo = 0;
683 pGetRecordInfoFromTypeInfo(typeInfo, &recordInfo);
689 switch (qvar.type()) {
692 QRect qrect(qvar.toRect());
693 recordInfo->RecordCreateCopy(&qrect, &record);
698 QSize qsize(qvar.toSize());
699 recordInfo->RecordCreateCopy(&qsize, &record);
704 QPoint qpoint(qvar.toPoint());
705 recordInfo->RecordCreateCopy(&qpoint, &record);
711 arg.pRecInfo = recordInfo,
712 arg.pvRecord = record;
714 qWarning(
"QVariantToVARIANT: out-parameter not supported for records");
727 if (!
qstrcmp(qvar.typeName(),
"IDispatch*")) {
728 arg.vt = VT_DISPATCH;
729 arg.pdispVal = *(IDispatch**)qvar.data();
731 arg.pdispVal->AddRef();
733 qWarning(
"QVariantToVARIANT: out-parameter not supported for IDispatch");
736 }
else if (!
qstrcmp(qvar.typeName(),
"IDispatch**")) {
737 arg.vt = VT_DISPATCH;
738 arg.ppdispVal = *(IDispatch***)qvar.data();
741 }
else if (!
qstrcmp(qvar.typeName(),
"IUnknown*")) {
743 arg.punkVal = *(IUnknown**)qvar.data();
745 arg.punkVal->AddRef();
747 qWarning(
"QVariantToVARIANT: out-parameter not supported for IUnknown");
752 arg.vt = VT_DISPATCH;
753 void *user = *(
void**)qvar.constData();
761 qWarning(
"QVariantToVARIANT: out-parameter not supported for subtype");
768 arg.vt = VT_DISPATCH;
771 qWarning(
"QVariantToVARIANT: out-parameter not supported for subtype");
781 if (out && arg.vt == (VT_ERROR|VT_BYREF)) {
782 *arg.plVal = DISP_E_PARAMNOTFOUND;
785 arg.lVal = DISP_E_PARAMNOTFOUND;
787 arg.plVal =
new long(arg.lVal);
797 Q_ASSERT(!out || (arg.vt & VT_BYREF));
824 switch (var.
type()) {
831 *(
int*)data = var.
toInt();
837 *(
bool*)data = var.
toBool();
843 *(
QColor*)data = qvariant_cast<QColor>(var);
855 *(
QFont*)data = qvariant_cast<QFont>(var);
858 *(
QPixmap*)data = qvariant_cast<QPixmap>(var);
862 *(
QCursor*)data = qvariant_cast<QCursor>(var);
890 *(
void**)data = *(
void**)var.
constData();
894 qWarning(
"QVariantToVoidStar: Unhandled QVariant type");
926 case VT_BSTR|VT_BYREF:
932 case VT_BOOL|VT_BYREF:
933 var =
QVariant((
bool)*arg.pboolVal);
937 if (typeName ==
"char")
942 if (typeName ==
"char")
947 if (typeName ==
"short")
952 if (typeName ==
"short")
959 else if (type ==
QVariant::Cursor || (!type && (typeName ==
"QCursor" || typeName ==
"QCursor*")))
969 else if (type ==
QVariant::Cursor || (!type && (typeName ==
"QCursor" || typeName ==
"QCursor*")))
973 var = (int)*arg.plVal;
978 case VT_INT|VT_BYREF:
984 case VT_UI1|VT_BYREF:
990 case VT_UI2|VT_BYREF:
997 else if (type ==
QVariant::Cursor || (!type && (typeName ==
"QCursor" || typeName ==
"QCursor*")))
1001 var = (int)arg.ulVal;
1003 case VT_UI4|VT_BYREF:
1006 #ifndef QT_NO_CURSOR 1007 else if (type ==
QVariant::Cursor || (!type && (typeName ==
"QCursor" || typeName ==
"QCursor*")))
1011 var = (int)*arg.pulVal;
1016 case VT_UINT|VT_BYREF:
1017 var = *arg.puintVal;
1020 var = arg.cyVal.int64;
1022 case VT_CY|VT_BYREF:
1023 var = arg.pcyVal->int64;
1025 #
if !defined(Q_OS_WINCE) && defined(_MSC_VER) && _MSC_VER >= 1400
1029 case VT_I8|VT_BYREF:
1035 case VT_UI8|VT_BYREF:
1042 case VT_R4|VT_BYREF:
1048 case VT_R8|VT_BYREF:
1053 if (type ==
QVariant::Date || (!type && (typeName ==
"QDate" || typeName ==
"QDate*"))) {
1055 }
else if (type ==
QVariant::Time || (!type && (typeName ==
"QTime" || typeName ==
"QTime*"))) {
1059 case VT_DATE|VT_BYREF:
1061 if (type ==
QVariant::Date || (!type && (typeName ==
"QDate" || typeName ==
"QDate*"))) {
1063 }
else if (type ==
QVariant::Time || (!type && (typeName ==
"QTime" || typeName ==
"QTime*"))) {
1068 case VT_VARIANT|VT_BYREF:
1074 case VT_DISPATCH|VT_BYREF:
1077 IDispatch *disp = 0;
1078 if (arg.vt & VT_BYREF)
1079 disp = *arg.ppdispVal;
1081 disp = arg.pdispVal;
1082 if (type ==
QVariant::Font || (!type && (typeName ==
"QFont" || typeName ==
"QFont*"))) {
1085 disp->QueryInterface(IID_IFont, (
void**)&ifont);
1092 }
else if (type ==
QVariant::Pixmap || (!type && (typeName ==
"QPixmap" || typeName ==
"QPixmap*"))) {
1095 disp->QueryInterface(IID_IPicture, (
void**)&ipic);
1105 if (disp && typeName !=
"IDispatch*")
1106 disp->QueryInterface(IID_IAxServerBase, (
void**)&iface);
1108 QObject *qObj = iface->qObject();
1115 if (arg.vt & VT_BYREF) {
1116 var =
QVariant(qRegisterMetaType<IDispatch**>(
"IDispatch**"), &arg.ppdispVal);
1119 if (typeName ==
"QVariant") {
1121 var = QVariant::fromValue<QAxObject*>(
object);
1126 typeNameStr = typeName.
left(pIndex);
1133 var =
QVariant(qRegisterMetaType<IDispatch*>(typeName), &disp);
1141 case VT_UNKNOWN|VT_BYREF:
1144 if (arg.vt & VT_BYREF)
1145 unkn = *arg.ppunkVal;
1151 case VT_ARRAY|VT_VARIANT:
1152 case VT_ARRAY|VT_VARIANT|VT_BYREF:
1154 SAFEARRAY *array = 0;
1155 if ( arg.vt & VT_BYREF )
1156 array = *arg.pparray;
1160 UINT cDims = array ? SafeArrayGetDim(array) : 0;
1166 long lBound, uBound;
1167 SafeArrayGetLBound( array, 1, &lBound );
1168 SafeArrayGetUBound( array, 1, &uBound );
1170 for (
long i = lBound; i <= uBound; ++i ) {
1172 VariantInit( &var );
1173 SafeArrayGetElement( array, &i, &var );
1189 long xlBound, xuBound, ylBound, yuBound;
1190 SafeArrayGetLBound(array, 1, &xlBound);
1191 SafeArrayGetUBound(array, 1, &xuBound);
1192 SafeArrayGetLBound(array, 2, &ylBound);
1193 SafeArrayGetUBound(array, 2, &yuBound);
1195 for (
long x = xlBound; x <= xuBound; ++x) {
1199 for (
long y = ylBound; y <= yuBound; ++y) {
1203 SafeArrayGetElement(array, dimIndices, &var);
1222 case VT_ARRAY|VT_BSTR:
1223 case VT_ARRAY|VT_BSTR|VT_BYREF:
1225 SAFEARRAY *array = 0;
1226 if (arg.vt & VT_BYREF)
1227 array = *arg.pparray;
1232 if (!array || array->cDims != 1) {
1237 long lBound, uBound;
1238 SafeArrayGetLBound(array, 1, &lBound);
1239 SafeArrayGetUBound(array, 1, &uBound);
1241 for (
long i = lBound; i <= uBound; ++i) {
1243 SafeArrayGetElement(array, &i, &bstr);
1245 SysFreeString(bstr);
1252 case VT_ARRAY|VT_UI1:
1253 case VT_ARRAY|VT_UI1|VT_BYREF:
1255 SAFEARRAY *array = 0;
1256 if (arg.vt & VT_BYREF)
1257 array = *arg.pparray;
1262 if (!array || array->cDims != 1) {
1267 long lBound, uBound;
1268 SafeArrayGetLBound(array, 1, &lBound);
1269 SafeArrayGetUBound(array, 1, &uBound);
1272 bytes.
resize(uBound - lBound + 1);
1275 SafeArrayAccessData(array, (
void**)&src);
1276 memcpy(data, src, bytes.
size());
1277 SafeArrayUnaccessData(array);
1284 #if defined(QAX_SERVER) 1286 case VT_RECORD|VT_BYREF:
1287 if (arg.pvRecord && arg.pRecInfo) {
1288 IRecordInfo *recordInfo = arg.pRecInfo;
1289 void *record = arg.pvRecord;
1291 recordInfo->GetGuid(&guid);
1295 recordInfo->RecordCopy(record, &qrect);
1299 recordInfo->RecordCopy(record, &qsize);
1303 recordInfo->RecordCopy(record, &qpoint);
1308 #endif // QAX_SERVER 1310 #if !defined(Q_OS_WINCE) 1313 if (arg.vt & VT_ARRAY) {
1314 SAFEARRAY *array = 0;
1315 if (arg.vt & VT_BYREF)
1316 array = *arg.pparray;
1321 if (!array || array->cDims != 1) {
1329 SafeArrayGetVartype(array, &vt);
1333 case VT_BSTR:
Q_ASSERT(
false);
break;
1334 case VT_BOOL: pElement = &variant.boolVal;
break;
1335 case VT_I1: pElement = &variant.cVal;
break;
1336 case VT_I2: pElement = &variant.iVal;
break;
1337 case VT_I4: pElement = &variant.lVal;
break;
1338 #if defined(_MSC_VER) && _MSC_VER >= 1400 1339 case VT_I8: pElement = &variant.llVal;
break;
1340 case VT_UI8: pElement = &variant.ullVal;
break;
1342 case VT_INT: pElement = &variant.intVal;
break;
1343 case VT_UI1:
Q_ASSERT(
false);
break;
1344 case VT_UI2: pElement = &variant.uiVal;
break;
1345 case VT_UI4: pElement = &variant.ulVal;
break;
1346 case VT_UINT: pElement = &variant.uintVal;
break;
1347 case VT_CY: pElement = &variant.cyVal;
break;
1348 case VT_R4: pElement = &variant.fltVal;
break;
1349 case VT_R8: pElement = &variant.dblVal;
break;
1350 case VT_DATE: pElement = &variant.date;
break;
1351 case VT_VARIANT:
Q_ASSERT(
false);
break;
1360 long lBound, uBound;
1361 SafeArrayGetLBound( array, 1, &lBound );
1362 SafeArrayGetUBound( array, 1, &uBound );
1364 for (
long i = lBound; i <= uBound; ++i ) {
1366 SafeArrayGetElement(array, &i, pElement);
1380 if (typeName !=
"QVariant")
1389 bool allStrings =
true;
1410 if (var->vt & VT_BYREF) {
1412 case VT_BSTR|VT_BYREF:
1413 SysFreeString(*var->pbstrVal);
1414 delete var->pbstrVal;
1416 case VT_BOOL|VT_BYREF:
1417 delete var->pboolVal;
1419 case VT_I1|VT_BYREF:
1422 case VT_I2|VT_BYREF:
1425 case VT_I4|VT_BYREF:
1428 case VT_INT|VT_BYREF:
1429 delete var->pintVal;
1431 case VT_UI1|VT_BYREF:
1434 case VT_UI2|VT_BYREF:
1437 case VT_UI4|VT_BYREF:
1440 case VT_UINT|VT_BYREF:
1441 delete var->puintVal;
1443 #if !defined(Q_OS_WINCE) && defined(_MSC_VER) && _MSC_VER >= 1400 1444 case VT_I8|VT_BYREF:
1447 case VT_UI8|VT_BYREF:
1448 delete var->pullVal;
1451 case VT_CY|VT_BYREF:
1454 case VT_R4|VT_BYREF:
1455 delete var->pfltVal;
1457 case VT_R8|VT_BYREF:
1458 delete var->pdblVal;
1460 case VT_DATE|VT_BYREF:
1463 case VT_DISPATCH|VT_BYREF:
1465 delete var->ppdispVal;
1467 case VT_ARRAY|VT_VARIANT|VT_BYREF:
1468 case VT_ARRAY|VT_UI1|VT_BYREF:
1469 case VT_ARRAY|VT_BSTR|VT_BYREF:
1470 SafeArrayDestroy(*var->pparray);
1471 delete var->pparray;
1473 case VT_VARIANT|VT_BYREF:
1474 delete var->pvarVal;
1484 #endif // QT_NO_WIN_ACTIVEQT The QVariant class acts like a union for the most common Qt data types.
static QString fromWCharArray(const wchar_t *, int size=-1)
Returns a copy of the string, where the encoding of string depends on the size of wchar...
The QColor class provides colors based on RGB, HSV or CMYK values.
void clearVARIANT(VARIANT *var)
bool isNull() const
Returns true if both the date and the time are null; otherwise returns false.
void truncate(int pos)
Truncates the byte array at index position pos.
The QCursor class provides a mouse cursor with an arbitrary shape.
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
#define QT_END_NAMESPACE
This macro expands to.
bool isNull() const
Returns true if the date is null; otherwise returns false.
char * data()
Returns a pointer to the data stored in the byte array.
bool isValid() const
Returns true if this date is valid; otherwise returns false.
QAxFactory * qAxFactory()
#define it(className, varName)
bool underline() const
Returns true if underline has been set; otherwise returns false.
void setUnderline(bool)
If enable is true, sets underline on; otherwise sets underline off.
bool isNull() const
Returns true if the time is null (i.
The QByteArray class provides an array of bytes.
int month() const
Returns the number corresponding to the month of this date, using the following convention: ...
QString toString() const
Returns the variant as a QString if the variant has type() String , Bool , ByteArray ...
static QPixmap fromWinHBITMAP(HBITMAP hbitmap, HBitmapFormat format=NoAlpha)
Win32 only: Returns a QPixmap that is equivalent to the given bitmap.
QDateTime toDateTime() const
Returns the variant as a QDateTime if the variant has type() DateTime , Date , or String ; otherwise ...
static QFont IFontToQFont(IFont *f)
int day() const
Returns the day of the month (1 to 31) of this date.
QList< QVariant > toList() const
Returns the variant as a QVariantList if the variant has type() List or StringList ; otherwise return...
bool isValid() const
Returns true if both the date and the time are valid; otherwise returns false.
The QDate class provides date functions.
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
bool toBool() const
Returns the variant as a bool if the variant has type() Bool.
int msec() const
Returns the millisecond part (0 to 999) of the time.
int count(const T &t) const
Returns the number of occurrences of value in the list.
ITypeLib * qAxTypeLibrary
The QString class provides a Unicode character string.
int qstrcmp(const char *str1, const char *str2)
A safe strcmp() function.
QColor OLEColorToQColor(uint col)
The QAxObject class provides a QObject that wraps a COM object.
void setValue(const T &value)
Stores a copy of value.
The QObject class is the base class of all Qt objects.
static DATE QDateTimeToDATE(const QDateTime &dt)
QByteArray toByteArray() const
Returns the variant as a QByteArray if the variant has type() ByteArray or String (converted using QS...
int toInt(bool *ok=0) const
Returns the variant as an int if the variant has type() Int , Bool , ByteArray , Char ...
QStringList toStringList() const
Returns the variant as a QStringList if the variant has type() StringList, String ...
The QTime class provides clock time functions.
#define QT_BEGIN_NAMESPACE
This macro expands to.
qlonglong toLongLong(bool *ok=0) const
Returns the variant as a long long int if the variant has type() LongLong , Bool , ByteArray , Char , Double , Int , String , UInt , or ULongLong ; otherwise returns 0.
void setBold(bool)
If enable is true sets the font's weight to QFont::Bold ; otherwise sets the weight to QFont::Normal...
int lastIndexOf(char c, int from=-1) const
Returns the index position of the last occurrence of character ch in the byte array, searching backward from index position from.
bool canConvert(Type t) const
Returns true if the variant's type can be cast to the requested type, t.
static IPictureDisp * QPixmapToIPicture(const QPixmap &pixmap)
void setStrikeOut(bool)
If enable is true, sets strikeout on; otherwise sets strikeout off.
const T & at(int i) const
Returns the item at index position i in the list.
The QStringList class provides a list of strings.
bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &typeName, bool out)
qulonglong toULongLong(bool *ok=0) const
Returns the variant as as an unsigned long long int if the variant has type() ULongLong ...
Q_CORE_EXPORT void qWarning(const char *,...)
int second() const
Returns the second part (0 to 59) of the time.
static const char * data(const QByteArray &arr)
Type
This enum type defines the types of variable that a QVariant can contain.
static uint QColorToOLEColor(const QColor &col)
QByteArray left(int len) const
Returns a byte array that contains the leftmost len bytes of this byte array.
int minute() const
Returns the minute part (0 to 59) of the time.
virtual bool createObjectWrapper(QObject *object, IDispatch **wrapper)
Reimplement this function to provide the COM object for object in wrapper.
static QVariant fromValue(const T &value)
Returns a QVariant containing a copy of value.
void * qax_createObjectWrapper(int metaType, IUnknown *iface)
const char * typeName() const
Returns the name of the type stored in the variant.
QSize toSize() const
Returns the variant as a QSize if the variant has type() Size ; otherwise returns an invalid QSize...
QVariantList
Synonym for QList<QVariant>.
bool convert(Type t)
Casts the variant to the requested type, t.
int length() const
Same as size().
bool QVariantToVoidStar(const QVariant &var, void *data, const QByteArray &typeName, uint type)
Copies the data in var into data.
const char * constData() const
Returns a pointer to the data stored in the byte array.
QDate date() const
Returns the date part of the datetime.
QDate toDate() const
Returns the variant as a QDate if the variant has type() Date , DateTime , or String ; otherwise retu...
void * resolve(const char *symbol)
The QDateTime class provides date and time functions.
HBITMAP toWinHBITMAP(HBitmapFormat format=NoAlpha) const
It is the caller's responsibility to free the HBITMAP data after use.
int count(char c) const
Returns the number of occurrences of character ch in the byte array.
The QFont class specifies a font used for drawing text.
QRect toRect() const
Returns the variant as a QRect if the variant has type() Rect ; otherwise returns an invalid QRect...
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
QString family() const
Returns the requested font family name, i.e.
Type type() const
Returns the storage type of the value stored in the variant.
const void * constData() const
The QPoint class defines a point in the plane using integer precision.
static BSTR QStringToBSTR(const QString &str)
void resize(int size)
Sets the size of the byte array to size bytes.
uint toUInt(bool *ok=0) const
Returns the variant as an unsigned int if the variant has type() UInt , Bool , ByteArray ...
QVariant VARIANTToQVariant(const VARIANT &arg, const QByteArray &typeName, uint type)
Returns arg as a QVariant of type type.
if(void) toggleToolbarShown
The QRect class defines a rectangle in the plane using integer precision.
static QPixmap IPictureToQPixmap(IPicture *ipic)
int weight() const
Returns the weight of the font which is one of the enumerated values from QFont::Weight.
int size() const
Returns the number of bytes in this byte array.
double toDouble(bool *ok=0) const
Returns the variant as a double if the variant has type() Double , QMetaType::Float ...
The QPixmap class is an off-screen image representation that can be used as a paint device...
bool italic() const
Returns true if the style() of the font is not QFont::StyleNormal.
int pointSize() const
Returns the point size of the font.
int year() const
Returns the year of this date.
bool isEmpty() const
Returns true if the byte array has size 0; otherwise returns false.
The QSize class defines the size of a two-dimensional object using integer point precision.
QTime time() const
Returns the time part of the datetime.
QTime toTime() const
Returns the variant as a QTime if the variant has type() Time , DateTime , or String ; otherwise retu...
bool isNull() const
Returns true if this is a null pixmap; otherwise returns false.
bool strikeOut() const
Returns true if strikeout has been set; otherwise returns false.
static IFontDisp * QFontToIFont(const QFont &font)
static QDateTime DATEToQDateTime(DATE ole)
static Type nameToType(const char *name)
Converts the string representation of the storage type given in name, to its enum representation...
long queryInterface(const QUuid &, void **) const
Requests the interface uuid from the COM object and sets the value of iface to the provided interface...
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
QPoint toPoint() const
Returns the variant as a QPoint if the variant has type() Point or PointF ; otherwise returns a null ...
virtual const QMetaObject * metaObject() const
Returns a pointer to the meta-object of this object.
bool isValid() const
Returns true if the time is valid; otherwise returns false.
int hour() const
Returns the hour part (0 to 23) of the time.
bool endsWith(const QByteArray &a) const
Returns true if this byte array ends with byte array ba; otherwise returns false. ...
T qvariant_cast(const QVariant &value)
Returns the given value converted to the template type T.