summaryrefslogtreecommitdiffstats
path: root/src/activeqt/container
diff options
context:
space:
mode:
Diffstat (limited to 'src/activeqt/container')
-rw-r--r--src/activeqt/container/qaxbase.cpp232
-rw-r--r--src/activeqt/container/qaxbase.h10
-rw-r--r--src/activeqt/container/qaxdump.cpp11
-rw-r--r--src/activeqt/container/qaxobject.cpp6
-rw-r--r--src/activeqt/container/qaxobject.h14
-rw-r--r--src/activeqt/container/qaxscript.cpp32
-rw-r--r--src/activeqt/container/qaxscript.h4
-rw-r--r--src/activeqt/container/qaxselect.cpp8
-rw-r--r--src/activeqt/container/qaxselect.h2
-rw-r--r--src/activeqt/container/qaxwidget.cpp122
-rw-r--r--src/activeqt/container/qaxwidget.h16
11 files changed, 232 insertions, 225 deletions
diff --git a/src/activeqt/container/qaxbase.cpp b/src/activeqt/container/qaxbase.cpp
index 472e041..f2deedb 100644
--- a/src/activeqt/container/qaxbase.cpp
+++ b/src/activeqt/container/qaxbase.cpp
@@ -93,14 +93,15 @@ static inline HRESULT Invoke(IDispatch *disp,
VARTYPE vt = pDispParams->rgvarg->vt;
if (vt == VT_UNKNOWN || vt == VT_DISPATCH || (vt & VT_ARRAY) || (vt & VT_BYREF)) {
- HRESULT hr = disp->Invoke(dispIdMember, riid, lcid, (wFlags & ~DISPATCH_PROPERTYPUT) | DISPATCH_PROPERTYPUTREF,
- pDispParams, pVarResult, pExcepInfo, puArgErr);
+ const HRESULT hr =
+ disp->Invoke(dispIdMember, riid, lcid, (WORD(wFlags) & ~DISPATCH_PROPERTYPUT) | DISPATCH_PROPERTYPUTREF,
+ pDispParams, pVarResult, pExcepInfo, puArgErr);
if (SUCCEEDED(hr))
return hr;
}
}
- return disp->Invoke(dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
+ return disp->Invoke(dispIdMember, riid, lcid, WORD(wFlags), pDispParams, pVarResult, pExcepInfo, puArgErr);
}
/*
@@ -118,8 +119,8 @@ struct QAxMetaObject : public QMetaObject
}
~QAxMetaObject()
{
- delete [] (int*)d.data;
- delete [] (char*)d.stringdata;
+ delete [] d.data;
+ delete [] reinterpret_cast<char *>(const_cast<QByteArrayData *>(d.stringdata));
}
int numParameter(const QByteArray &prototype);
@@ -206,7 +207,7 @@ inline DISPID QAxMetaObject::dispIDofName(const QByteArray &name, IDispatch *dis
if (dispid == DISPID_UNKNOWN) {
// get the Dispatch ID from the object
QString unicodeName = QLatin1String(name);
- OLECHAR *names = (wchar_t*)unicodeName.utf16();
+ OLECHAR *names = reinterpret_cast<wchar_t *>(const_cast<ushort *>(unicodeName.utf16()));
disp->GetIDsOfNames(IID_NULL, &names, 1, LOCALE_USER_DEFAULT, &dispid);
if (dispid != DISPID_UNKNOWN)
dispIDs.insert(name, dispid);
@@ -277,7 +278,7 @@ public:
cpoint = cp;
cpoint->AddRef();
ciid = iid;
- cpoint->Advise((IUnknown*)(IDispatch*)this, &cookie);
+ cpoint->Advise(static_cast<IUnknown *>(static_cast<IDispatch *>(this)), &cookie);
}
// disconnect from all connection points
@@ -332,13 +333,11 @@ public:
{
*ppvObject = 0;
if (riid == IID_IUnknown)
- *ppvObject = (IUnknown*)(IDispatch*)this;
- else if (riid == IID_IDispatch)
- *ppvObject = (IDispatch*)this;
+ *ppvObject = static_cast<IUnknown *>(static_cast<IDispatch *>(this));
+ else if (riid == IID_IDispatch || ciid == riid)
+ *ppvObject = static_cast<IDispatch *>(this);
else if (riid == IID_IPropertyNotifySink)
- *ppvObject = (IPropertyNotifySink*)this;
- else if (ciid == riid)
- *ppvObject = (IDispatch*)this;
+ *ppvObject = static_cast<IPropertyNotifySink *>(this);
else
return E_NOINTERFACE;
@@ -402,8 +401,8 @@ public:
Q_ASSERT(signal.methodType() == QMetaMethod::Signal);
Q_ASSERT(signame == signal.methodSignature());
// verify parameter count
- int pcount = axmeta->numParameter(signame);
- int argcount = pDispParams->cArgs;
+ const int pcount = axmeta->numParameter(signame);
+ const int argcount = int(pDispParams->cArgs);
if (pcount > argcount)
return DISP_E_PARAMNOTOPTIONAL;
else if (pcount < argcount)
@@ -557,7 +556,7 @@ public:
static bool signalHasReceivers(QObject *qobject, const char *signalName)
{
Q_ASSERT(qobject);
- return ((QAxObject*)qobject)->receivers(QByteArray::number(QSIGNAL_CODE) + signalName);
+ return static_cast<QAxObject *>(qobject)->receivers(QByteArray::number(QSIGNAL_CODE) + signalName);
}
IConnectionPoint *cpoint;
@@ -616,7 +615,7 @@ public:
return disp;
if (ptr)
- ptr->QueryInterface(IID_IDispatch, (void**)&disp);
+ ptr->QueryInterface(IID_IDispatch, reinterpret_cast<void **>(&disp));
return disp;
}
@@ -992,7 +991,7 @@ bool QAxBase::setControl(const QString &c)
QUuid uuid(search);
if (uuid.isNull()) {
CLSID clsid;
- HRESULT res = CLSIDFromProgID((wchar_t*)c.utf16(), &clsid);
+ HRESULT res = CLSIDFromProgID(reinterpret_cast<const wchar_t *>(c.utf16()), &clsid);
if (res == S_OK)
search = QUuid(clsid).toString();
else {
@@ -1142,7 +1141,7 @@ QStringList QAxBase::verbs() const
if (d->verbs.isEmpty()) {
IOleObject *ole = 0;
- d->ptr->QueryInterface(IID_IOleObject, (void**)&ole);
+ d->ptr->QueryInterface(IID_IOleObject, reinterpret_cast<void **>(&ole));
if (ole) {
IEnumOLEVERB *enumVerbs = 0;
ole->EnumVerbs(&enumVerbs);
@@ -1227,7 +1226,8 @@ bool QAxBase::initialize(IUnknown **ptr)
res = initializeFromFile(ptr);
if (!res) { // standard
- HRESULT hres = CoCreateInstance(QUuid(ctrl), 0, CLSCTX_SERVER, IID_IUnknown, (void**)ptr);
+ HRESULT hres = CoCreateInstance(QUuid(ctrl), 0, CLSCTX_SERVER, IID_IUnknown,
+ reinterpret_cast<void **>(ptr));
res = S_OK == hres;
#ifndef QT_NO_DEBUG
if (!res)
@@ -1256,7 +1256,8 @@ bool QAxBase::initializeLicensed(IUnknown** ptr)
QString key(control().mid(at+2));
IClassFactory *factory = 0;
- CoGetClassObject(QUuid(clsid), CLSCTX_SERVER, 0, IID_IClassFactory, (void**)&factory);
+ CoGetClassObject(QUuid(clsid), CLSCTX_SERVER, 0, IID_IClassFactory,
+ reinterpret_cast<void **>(&factory));
if (!factory)
return false;
initializeLicensedHelper(factory, key, ptr);
@@ -1271,12 +1272,13 @@ bool QAxBase::initializeLicensed(IUnknown** ptr)
*/
bool QAxBase::initializeLicensedHelper(void *f, const QString &key, IUnknown **ptr)
{
- IClassFactory *factory = (IClassFactory*)f;
+ IClassFactory *factory = reinterpret_cast<IClassFactory *>(f);
IClassFactory2 *factory2 = 0;
- factory->QueryInterface(IID_IClassFactory2, (void**)&factory2);
+ factory->QueryInterface(IID_IClassFactory2, reinterpret_cast<void **>(&factory2));
if (factory2) {
BSTR bkey = QStringToBSTR(key);
- HRESULT hres = factory2->CreateInstanceLic(0, 0, IID_IUnknown, bkey, (void**)ptr);
+ HRESULT hres = factory2->CreateInstanceLic(0, 0, IID_IUnknown, bkey,
+ reinterpret_cast<void **>(ptr));
SysFreeString(bkey);
#ifdef QT_DEBUG
LICINFO licinfo;
@@ -1284,7 +1286,7 @@ bool QAxBase::initializeLicensedHelper(void *f, const QString &key, IUnknown **p
factory2->GetLicInfo(&licinfo);
if (hres != S_OK) {
- SetLastError(hres);
+ SetLastError(DWORD(hres));
qErrnoWarning("CreateInstanceLic failed");
if (!licinfo.fLicVerified) {
qWarning("Wrong license key specified, and machine is not fully licensed.");
@@ -1313,7 +1315,7 @@ bool QAxBase::initializeLicensedHelper(void *f, const QString &key, IUnknown **p
#endif
factory2->Release();
} else { // give it a shot without license
- factory->CreateInstance(0, IID_IUnknown, (void**)ptr);
+ factory->CreateInstance(0, IID_IUnknown, reinterpret_cast<void **>(ptr));
}
return *ptr != 0;
}
@@ -1362,7 +1364,9 @@ bool QAxBase::initializeFromFile(IUnknown** ptr)
HRESULT hres = ::CreateILockBytesOnHGlobal(0, TRUE, &bytes);
hres = ::StgCreateDocfileOnILockBytes(bytes, STGM_SHARE_EXCLUSIVE|STGM_CREATE|STGM_READWRITE, 0, &storage);
- hres = OleCreateFromFile(CLSID_NULL, reinterpret_cast<const wchar_t*>(control().utf16()), IID_IUnknown, OLERENDER_NONE, 0, 0, storage, (void**)ptr);
+ hres = OleCreateFromFile(CLSID_NULL, reinterpret_cast<const wchar_t*>(control().utf16()),
+ IID_IUnknown, OLERENDER_NONE, 0, 0, storage,
+ reinterpret_cast<void **>(ptr));
storage->Release();
bytes->Release();
@@ -1428,12 +1432,15 @@ bool QAxBase::initializeRemote(IUnknown** ptr)
d->ctrl = d->ctrl + QChar::fromLatin1(':') + key;
COAUTHIDENTITY authIdentity;
- authIdentity.UserLength = user.length();
- authIdentity.User = authIdentity.UserLength ? (ushort*)user.utf16() : 0;
- authIdentity.DomainLength = domain.length();
- authIdentity.Domain = authIdentity.DomainLength ? (ushort*)domain.utf16() : 0;
- authIdentity.PasswordLength = passwd.length();
- authIdentity.Password = authIdentity.PasswordLength ? (ushort*)passwd.utf16() : 0;
+ authIdentity.UserLength = ULONG(user.length());
+ authIdentity.User = authIdentity.UserLength
+ ? const_cast<ushort *>(user.utf16()) : Q_NULLPTR;
+ authIdentity.DomainLength = ULONG(domain.length());
+ authIdentity.Domain = authIdentity.DomainLength
+ ? const_cast<ushort *>(domain.utf16()) : Q_NULLPTR;
+ authIdentity.PasswordLength = ULONG(passwd.length());
+ authIdentity.Password = authIdentity.PasswordLength
+ ? const_cast<ushort *>(passwd.utf16()) : Q_NULLPTR;
authIdentity.Flags = SEC_WINNT_AUTH_IDENTITY_UNICODE;
COAUTHINFO authInfo;
@@ -1449,15 +1456,16 @@ bool QAxBase::initializeRemote(IUnknown** ptr)
serverInfo.dwReserved1 = 0;
serverInfo.dwReserved2 = 0;
serverInfo.pAuthInfo = &authInfo;
- serverInfo.pwszName = (wchar_t*)server.utf16();
+ serverInfo.pwszName = reinterpret_cast<wchar_t *>(const_cast<ushort *>(server.utf16()));
IClassFactory *factory = 0;
- HRESULT res = CoGetClassObject(QUuid(clsid), CLSCTX_REMOTE_SERVER, &serverInfo, IID_IClassFactory, (void**)&factory);
+ HRESULT res = CoGetClassObject(QUuid(clsid), CLSCTX_REMOTE_SERVER, &serverInfo,
+ IID_IClassFactory, reinterpret_cast<void **>(&factory));
if (factory) {
if (!key.isEmpty())
initializeLicensedHelper(factory, key, ptr);
else
- res = factory->CreateInstance(0, IID_IUnknown, (void**)ptr);
+ res = factory->CreateInstance(0, IID_IUnknown, reinterpret_cast<void **>(ptr));
factory->Release();
}
#ifndef QT_NO_DEBUG
@@ -1481,7 +1489,7 @@ long QAxBase::queryInterface(const QUuid &uuid, void **iface) const
{
*iface = 0;
if (!d->ptr) {
- ((QAxBase*)this)->initialize(&d->ptr);
+ const_cast<QAxBase *>(this)->initialize(&d->ptr);
d->initialized = true;
}
@@ -1578,7 +1586,8 @@ private:
while (type_conversion[type][0]) {
int paren = proto.indexOf('(');
while ((paren = proto.indexOf(type_conversion[type][0])) != -1) {
- proto.replace(paren, qstrlen(type_conversion[type][0]), type_conversion[type][1]);
+ proto.replace(paren, int(qstrlen(type_conversion[type][0])),
+ type_conversion[type][1]);
}
++type;
}
@@ -1758,10 +1767,10 @@ QMetaObject *qax_readClassInfo(ITypeLib *typeLib, ITypeInfo *classInfo, const QM
TYPEATTR *typeattr;
classInfo->GetTypeAttr(&typeattr);
if (typeattr) {
- int nInterfaces = typeattr->cImplTypes;
+ const UINT nInterfaces = typeattr->cImplTypes;
classInfo->ReleaseTypeAttr(typeattr);
- for (int index = 0; index < nInterfaces; ++index) {
+ for (UINT index = 0; index < nInterfaces; ++index) {
HREFTYPE refType;
if (S_OK != classInfo->GetRefTypeOfImplType(index, &refType))
continue;
@@ -1883,7 +1892,7 @@ QByteArray MetaObjectGenerator::usertypeToString(const TYPEDESC &tdesc, ITypeInf
// get type name
BSTR usertypename = 0;
- usertypelib->GetDocumentation(index, &usertypename, 0, 0, 0);
+ usertypelib->GetDocumentation(INT(index), &usertypename, 0, 0, 0);
QByteArray userTypeName = QString::fromWCharArray(usertypename).toLatin1();
SysFreeString(usertypename);
@@ -2086,7 +2095,7 @@ QByteArray MetaObjectGenerator::guessTypes(const TYPEDESC &tdesc, ITypeInfo *inf
str = guessTypes(tdesc.lpadesc->tdescElem, info, function);
if (!str.isEmpty()) {
for (int index = 0; index < tdesc.lpadesc->cDims; ++index)
- str += '[' + QByteArray::number((int)tdesc.lpadesc->rgbounds[index].cElements) + ']';
+ str += '[' + QByteArray::number(int(tdesc.lpadesc->rgbounds[index].cElements)) + ']';
}
break;
case VT_USERDEFINED:
@@ -2114,7 +2123,7 @@ void MetaObjectGenerator::readClassInfo()
// Read class information
IProvideClassInfo *provideClassInfo = 0;
if (d)
- d->ptr->QueryInterface(IID_IProvideClassInfo, (void**)&provideClassInfo);
+ d->ptr->QueryInterface(IID_IProvideClassInfo, reinterpret_cast<void **>(&provideClassInfo));
if (provideClassInfo) {
provideClassInfo->GetClassInfo(&classInfo);
TYPEATTR *typeattr = 0;
@@ -2142,7 +2151,7 @@ void MetaObjectGenerator::readClassInfo()
if (d->tryCache && !coClassID.isEmpty())
cacheKey = QString::fromLatin1("%1$%2$%3$%4").arg(coClassID)
- .arg((int)d->useEventSink).arg((int)d->useClassInfo).arg((int)qax_dispatchEqualsIDispatch);
+ .arg(d->useEventSink).arg(d->useClassInfo).arg(int(qax_dispatchEqualsIDispatch));
}
UINT index = 0;
@@ -2171,16 +2180,16 @@ void MetaObjectGenerator::readClassInfo()
tlfile = controls.value(QLatin1String("/Classes/CLSID/") + that->control() + QLatin1String("/LocalServer32/.")).toString();
}
if (!tlfile.isEmpty()) {
- LoadTypeLib((OLECHAR*)tlfile.utf16(), &typelib);
+ LoadTypeLib(reinterpret_cast<const OLECHAR *>(tlfile.utf16()), &typelib);
if (!typelib) {
tlfile.truncate(tlfile.lastIndexOf(QLatin1Char('.')));
tlfile += QLatin1String(".tlb");
- LoadTypeLib((OLECHAR*)tlfile.utf16(), &typelib);
+ LoadTypeLib(reinterpret_cast<const OLECHAR *>(tlfile.utf16()), &typelib);
}
if (!typelib) {
tlfile.truncate(tlfile.lastIndexOf(QLatin1Char('.')));
tlfile.append(QLatin1String(".olb"));
- LoadTypeLib((OLECHAR*)tlfile.utf16(), &typelib);
+ LoadTypeLib(reinterpret_cast<const OLECHAR *>(tlfile.utf16()), &typelib);
}
}
}
@@ -2192,7 +2201,7 @@ void MetaObjectGenerator::readClassInfo()
TYPEATTR *classAttr;
classInfo->GetTypeAttr(&classAttr);
if (classAttr) {
- for (int i = 0; i < classAttr->cImplTypes; ++i) {
+ for (UINT i = 0; i < classAttr->cImplTypes; ++i) {
int typeFlags = 0;
classInfo->GetImplTypeFlags(i, &typeFlags);
if (typeFlags & IMPLTYPEFLAG_FSOURCE)
@@ -2234,7 +2243,7 @@ void MetaObjectGenerator::readClassInfo()
// ### event interfaces!!
if (!interfaceID.isEmpty())
cacheKey = QString::fromLatin1("%1$%2$%3$%4").arg(interfaceID)
- .arg((int)d->useEventSink).arg((int)d->useClassInfo).arg((int)qax_dispatchEqualsIDispatch);
+ .arg(d->useEventSink).arg(d->useClassInfo).arg(int(qax_dispatchEqualsIDispatch));
}
}
@@ -2276,7 +2285,7 @@ void MetaObjectGenerator::readEnumInfo()
// Get the name of the enumeration
BSTR enumname;
QByteArray enumName;
- if (typelib->GetDocumentation(i, &enumname, 0, 0, 0) == S_OK) {
+ if (typelib->GetDocumentation(INT(i), &enumname, 0, 0, 0) == S_OK) {
enumName = QString::fromWCharArray(enumname).toLatin1();
SysFreeString(enumname);
} else {
@@ -2288,7 +2297,7 @@ void MetaObjectGenerator::readEnumInfo()
enuminfo->GetTypeAttr(&typeattr);
if (typeattr) {
// Get all values of the enumeration
- for (UINT vd = 0; vd < (UINT)typeattr->cVars; ++vd) {
+ for (UINT vd = 0; vd < typeattr->cVars; ++vd) {
VARDESC *vardesc = 0;
enuminfo->GetVarDesc(vd, &vardesc);
if (vardesc && vardesc->varkind == VAR_CONST) {
@@ -2342,7 +2351,7 @@ void MetaObjectGenerator::addSetterSlot(const QByteArray &property)
if (isupper(prototype.at(0))) {
prototype.insert(0, "Set");
} else {
- prototype[0] = toupper(prototype[0]);
+ prototype[0] = char(toupper(prototype[0]));
prototype.insert(0, "set");
}
const QByteArray type = propertyType(property);
@@ -2541,7 +2550,7 @@ void MetaObjectGenerator::readFuncsInfo(ITypeInfo *typeinfo, ushort nFuncs)
set = "Set";
} else {
set = "set";
- prototype[0] = toupper(prototype[0]);
+ prototype[0] = char(toupper(prototype[0]));
}
prototype = set + prototype;
@@ -2759,7 +2768,7 @@ void MetaObjectGenerator::readEventInterface(ITypeInfo *eventinfo, IConnectionPo
}
// get information about all event functions
- for (UINT fd = 0; fd < (UINT)eventattr->cFuncs; ++fd) {
+ for (UINT fd = 0; fd < eventattr->cFuncs; ++fd) {
FUNCDESC *funcdesc;
eventinfo->GetFuncDesc(fd, &funcdesc);
if (!funcdesc)
@@ -2810,7 +2819,7 @@ void MetaObjectGenerator::readEventInfo()
int event_serial = 0;
IConnectionPointContainer *cpoints = 0;
if (d && d->useEventSink)
- d->ptr->QueryInterface(IID_IConnectionPointContainer, (void**)&cpoints);
+ d->ptr->QueryInterface(IID_IConnectionPointContainer, reinterpret_cast<void **>(&cpoints));
if (cpoints) {
// Get connection point enumerator
IEnumConnectionPoints *epoints = 0;
@@ -2869,7 +2878,7 @@ void MetaObjectGenerator::readEventInfo()
TYPEATTR *typeattr = 0;
classInfo->GetTypeAttr(&typeattr);
if (typeattr) {
- for (int i = 0; i < typeattr->cImplTypes; ++i) {
+ for (UINT i = 0; i < typeattr->cImplTypes; ++i) {
int flags = 0;
classInfo->GetImplTypeFlags(i, &flags);
if (!(flags & IMPLTYPEFLAG_FSOURCE))
@@ -2917,7 +2926,7 @@ QMetaObject *MetaObjectGenerator::tryCache()
d->cachedMetaObject = true;
IConnectionPointContainer *cpoints = 0;
- d->ptr->QueryInterface(IID_IConnectionPointContainer, (void**)&cpoints);
+ d->ptr->QueryInterface(IID_IConnectionPointContainer, reinterpret_cast<void **>(&cpoints));
if (cpoints) {
foreach (const QUuid &iid, d->metaobj->connectionInterfaces) {
IConnectionPoint *cpoint = 0;
@@ -2951,9 +2960,9 @@ static uint nameToTypeInfo(const QByteArray &typeName, QMetaStringTable &strings
{
int id = nameToBuiltinType(typeName);
if (id != QMetaType::UnknownType)
- return id;
+ return uint(id);
else
- return IsUnresolvedType | strings.enter(typeName);
+ return IsUnresolvedType | uint(strings.enter(typeName));
}
// Returns the sum of all parameters (including return type) for the given
@@ -3000,7 +3009,7 @@ QMetaObject *MetaObjectGenerator::metaObject(const QMetaObject *parentObject, co
- signal_list.count() // return "parameters" don't have names
- slot_list.count(); // ditto
- uint int_data_size = MetaObjectPrivateFieldCount;
+ int int_data_size = MetaObjectPrivateFieldCount;
int_data_size += classinfo_list.count() * 2;
int_data_size += (signal_list.count() + slot_list.count()) * 5 + paramsDataSize;
int_data_size += property_list.count() * 3;
@@ -3033,7 +3042,7 @@ QMetaObject *MetaObjectGenerator::metaObject(const QMetaObject *parentObject, co
classNameForMetaObject = that->className();
QMetaStringTable strings(classNameForMetaObject);
- uint offset = header->classInfoData;
+ int offset = header->classInfoData;
// each class info in form key\0value\0
typedef QMap<QByteArray, QByteArray>::ConstIterator ClassInfoConstIterator;
@@ -3041,12 +3050,12 @@ QMetaObject *MetaObjectGenerator::metaObject(const QMetaObject *parentObject, co
for (ClassInfoConstIterator it = classinfo_list.begin(); it != cend; ++it) {
QByteArray key(it.key());
QByteArray value(it.value());
- int_data[offset++] = strings.enter(key);
- int_data[offset++] = strings.enter(value);
+ int_data[offset++] = uint(strings.enter(key));
+ int_data[offset++] = uint(strings.enter(value));
}
- Q_ASSERT(offset == uint(header->methodData));
+ Q_ASSERT(offset == header->methodData);
- uint paramsOffset = offset + header->methodCount * 5;
+ int paramsOffset = offset + header->methodCount * 5;
// add each method:
for (int x = 0; x < 2; ++x) {
// Signals must be added before other methods, to match moc.
@@ -3062,12 +3071,11 @@ QMetaObject *MetaObjectGenerator::metaObject(const QMetaObject *parentObject, co
metaobj->realPrototype.insert(prototype, it.value().realPrototype);
int argc = paramTypeNames.size();
QByteArray tag;
- int flags = it.value().flags;
- int_data[offset++] = strings.enter(name);
- int_data[offset++] = argc;
- int_data[offset++] = paramsOffset;
- int_data[offset++] = strings.enter(tag);
- int_data[offset++] = flags;
+ int_data[offset++] = uint(strings.enter(name));
+ int_data[offset++] = uint(argc);
+ int_data[offset++] = uint(paramsOffset);
+ int_data[offset++] = uint(strings.enter(tag));
+ int_data[offset++] = uint(it.value().flags);
// Parameter types
for (int i = -1; i < argc; ++i) {
@@ -3076,13 +3084,13 @@ QMetaObject *MetaObjectGenerator::metaObject(const QMetaObject *parentObject, co
}
// Parameter names
for (int i = 0; i < argc; ++i)
- int_data[paramsOffset++] = strings.enter(paramNames.at(i));
+ int_data[paramsOffset++] = uint(strings.enter(paramNames.at(i)));
}
}
- Q_ASSERT(offset == uint(header->methodData + header->methodCount * 5));
+ Q_ASSERT(offset == header->methodData + header->methodCount * 5);
Q_ASSERT(paramsOffset = header->propertyData);
offset += paramsDataSize;
- Q_ASSERT(offset == uint(header->propertyData));
+ Q_ASSERT(offset == header->propertyData);
// each property in form name\0type\0
typedef QMap<QByteArray, Property>::ConstIterator PropertyMapConstIterator;
@@ -3094,37 +3102,33 @@ QMetaObject *MetaObjectGenerator::metaObject(const QMetaObject *parentObject, co
QByteArray realType(it.value().realType);
if (!realType.isEmpty() && realType != type)
metaobj->realPrototype.insert(name, realType);
- uint flags = it.value().flags;
-
- int_data[offset++] = strings.enter(name);
+ int_data[offset++] = uint(strings.enter(name));
int_data[offset++] = nameToTypeInfo(type, strings);
- int_data[offset++] = flags;
+ int_data[offset++] = uint(it.value().flags);
}
- Q_ASSERT(offset == uint(header->enumeratorData));
+ Q_ASSERT(offset == header->enumeratorData);
int value_offset = offset + enum_list.count() * 4;
// each enum in form name\0
for (EnumListMapConstIterator it = enum_list.begin(); it != ecend; ++it) {
QByteArray name(it.key());
- int flags = 0x0; // 0x1 for flag?
int count = it.value().count();
- int_data[offset++] = strings.enter(name);
- int_data[offset++] = flags;
- int_data[offset++] = count;
- int_data[offset++] = value_offset;
+ int_data[offset++] = uint(strings.enter(name));
+ int_data[offset++] = 0x0; // 0x1 for flag?
+ int_data[offset++] = uint(count);
+ int_data[offset++] = uint(value_offset);
value_offset += count * 2;
}
- Q_ASSERT(offset == uint(header->enumeratorData + enum_list.count() * 4));
+ Q_ASSERT(offset == header->enumeratorData + enum_list.count() * 4);
// each enum value in form key\0
for (EnumListMapConstIterator it = enum_list.begin(); it != ecend; ++it) {
const ByteArrayIntPairList::ConstIterator vcend = it.value().end();
for (ByteArrayIntPairList::ConstIterator it2 = it.value().begin(); it2 != vcend; ++it2) {
QByteArray key((*it2).first);
- int value = (*it2).second;
- int_data[offset++] = strings.enter(key);
- int_data[offset++] = value;
+ int_data[offset++] = uint(strings.enter(key));
+ int_data[offset++] = uint((*it2).second);
}
}
Q_ASSERT(offset == int_data_size-1);
@@ -3255,7 +3259,7 @@ const QMetaObject *QAxBase::metaObject() const
if (!d->ptr || !d->useMetaObject)
return fallbackMetaObject();
- MetaObjectGenerator generator((QAxBase*)this, d);
+ MetaObjectGenerator generator(const_cast<QAxBase *>(this), d);
return generator.metaObject(parentObject);
}
@@ -3275,7 +3279,7 @@ void QAxBase::connectNotify()
IEnumConnectionPoints *epoints = 0;
if (d->ptr && d->useEventSink) {
IConnectionPointContainer *cpoints = 0;
- d->ptr->QueryInterface(IID_IConnectionPointContainer, (void**)&cpoints);
+ d->ptr->QueryInterface(IID_IConnectionPointContainer, reinterpret_cast<void **>(&cpoints));
if (!cpoints)
return;
@@ -3392,7 +3396,7 @@ static bool checkHRESULT(HRESULT hres, EXCEPINFO *exc, QAxBase *that, const QStr
case DISP_E_EXCEPTION:
{
bool printWarning = true;
- unsigned short code = -1;
+ unsigned short code = ushort(-1);
QString source, desc, help;
const QMetaObject *mo = that->metaObject();
int exceptionSignal = mo->indexOfSignal("exception(int,QString,QString,QString)");
@@ -3541,12 +3545,12 @@ int QAxBase::internalProperty(QMetaObject::Call call, int index, void **v)
// map void* to VARIANTARG via QVariant
QVariant qvar;
if (prop.isEnumType()) {
- qvar = *(int*)v[0];
+ qvar = *reinterpret_cast<const int *>(v[0]);
proptype = 0;
} else {
int typeId = prop.userType();
if (typeId == int(QMetaType::QVariant)) {
- qvar = *(QVariant*)v[0];
+ qvar = *reinterpret_cast<const QVariant *>(v[0]);
proptype = 0;
} else {
qvar = QVariant(typeId, v[0]);
@@ -3613,7 +3617,7 @@ int QAxBase::internalInvoke(QMetaObject::Call call, int index, void **v)
// setup the parameters
DISPPARAMS params;
DISPID dispidNamed = DISPID_PROPERTYPUT;
- params.cArgs = d->metaobj->numParameter(signature);
+ params.cArgs = UINT(d->metaobj->numParameter(signature));
params.cNamedArgs = isProperty ? 1 : 0;
params.rgdispidNamedArgs = isProperty ? &dispidNamed : 0;
params.rgvarg = 0;
@@ -3628,7 +3632,7 @@ int QAxBase::internalInvoke(QMetaObject::Call call, int index, void **v)
VariantInit(vp);
int p;
- for (p = 0; p < (int)params.cArgs; ++p) {
+ for (p = 0; p < int(params.cArgs); ++p) {
bool out;
QByteArray type = d->metaobj->paramType(signature, p, &out);
QVariant::Type vt = QVariant::nameToType(type);
@@ -3639,21 +3643,21 @@ int QAxBase::internalInvoke(QMetaObject::Call call, int index, void **v)
if (!qvar.isValid()) {
if (type == "IDispatch*") {
if (out)
- qvar.setValue(*(IDispatch***)v[p+1]);
+ qvar.setValue(*reinterpret_cast<IDispatch ***>(v[p+1]));
else
- qvar.setValue(*(IDispatch**)v[p+1]);
+ qvar.setValue(*reinterpret_cast<IDispatch **>(v[p+1]));
} else if (type == "IUnknown*") {
- qvar.setValue(*(IUnknown**)v[p+1]);
+ qvar.setValue(*reinterpret_cast<IUnknown **>(v[p+1]));
} else if (type == "QVariant") {
- qvar = *(QVariant*)v[p + 1];
+ qvar = *reinterpret_cast<const QVariant *>(v[p + 1]);
} else if (mo->indexOfEnumerator(type) != -1) {
- qvar = *(int*)v[p + 1];
+ qvar = *reinterpret_cast<const int *>(v[p + 1]);
} else {
qvar = QVariant(QMetaType::type(type), v[p + 1]);
}
}
- QVariantToVARIANT(qvar, params.rgvarg[params.cArgs - p - 1], type, out);
+ QVariantToVARIANT(qvar, params.rgvarg[int(params.cArgs) - p - 1], type, out);
}
// call the method
@@ -3672,18 +3676,18 @@ int QAxBase::internalInvoke(QMetaObject::Call call, int index, void **v)
QVariantToVoidStar(VARIANTToQVariant(ret, slot.typeName()), v[0], slot.typeName());
// update out parameters
- for (p = 0; p < (int)params.cArgs; ++p) {
+ for (p = 0; p < int(params.cArgs); ++p) {
bool out;
QByteArray ptype = d->metaobj->paramType(signature, p, &out);
if (out) {
- VARIANTARG &var = params.rgvarg[params.cArgs - p - 1];
+ VARIANTARG &var = params.rgvarg[int(params.cArgs) - p - 1];
QVariantToVoidStar(VARIANTToQVariant(var, ptype), v[p+1], ptype);
if (var.vt == (VT_DISPATCH | VT_BYREF))
VariantInit(&var); // Prevent clearVARIANT() from releasing returned IDispatch* out parameters.
}
}
// clean up
- for (p = 0; p < (int)params.cArgs; ++p)
+ for (p = 0; p < int(params.cArgs); ++p)
clearVARIANT(params.rgvarg+p);
if (params.rgvarg != static_rgvarg)
delete [] params.rgvarg;
@@ -3809,7 +3813,7 @@ bool QAxBase::dynamicCallHelper(const char *name, void *inout, QList<QVariant> &
QByteArray function(normFunction);
VARIANT staticarg[QAX_NUM_PARAMS];
VARIANT *arg = 0;
- VARIANTARG *res = (VARIANTARG*)inout;
+ VARIANTARG *res = reinterpret_cast<VARIANTARG *>(inout);
unsigned short disptype;
@@ -3839,7 +3843,7 @@ bool QAxBase::dynamicCallHelper(const char *name, void *inout, QList<QVariant> &
int index = 0;
bool inString = false;
bool inEscape = false;
- while (index < (int)args.length()) {
+ while (index < args.length()) {
QChar cc = *c;
++c;
++index;
@@ -3975,7 +3979,7 @@ bool QAxBase::dynamicCallHelper(const char *name, void *inout, QList<QVariant> &
DISPPARAMS params;
DISPID dispidNamed = DISPID_PROPERTYPUT;
- params.cArgs = varc;
+ params.cArgs = UINT(varc);
params.cNamedArgs = (disptype == DISPATCH_PROPERTYPUT) ? 1 : 0;
params.rgdispidNamedArgs = (disptype == DISPATCH_PROPERTYPUT) ? &dispidNamed : 0;
params.rgvarg = arg;
@@ -3997,7 +4001,7 @@ bool QAxBase::dynamicCallHelper(const char *name, void *inout, QList<QVariant> &
if (arg && arg != staticarg)
delete[] arg;
- return checkHRESULT(hres, &excepinfo, this, QLatin1String(function), varc-argerr-1);
+ return checkHRESULT(hres, &excepinfo, this, QLatin1String(function), uint(varc) - argerr - 1);
}
/*!
@@ -4324,14 +4328,14 @@ QAxBase::PropertyBag QAxBase::propertyBag() const
PropertyBag result;
if (!d->ptr && !d->initialized) {
- ((QAxBase*)this)->initialize(&d->ptr);
+ const_cast<QAxBase *>(this)->initialize(&d->ptr);
d->initialized = true;
}
if (isNull())
return result;
IPersistPropertyBag *persist = 0;
- d->ptr->QueryInterface(IID_IPersistPropertyBag, (void**)&persist);
+ d->ptr->QueryInterface(IID_IPersistPropertyBag, reinterpret_cast<void **>(&persist));
if (persist) {
QtPropertyBag *pbag = new QtPropertyBag();
pbag->AddRef();
@@ -4373,7 +4377,7 @@ void QAxBase::setPropertyBag(const PropertyBag &bag)
if (isNull())
return;
IPersistPropertyBag *persist = 0;
- d->ptr->QueryInterface(IID_IPersistPropertyBag, (void**)&persist);
+ d->ptr->QueryInterface(IID_IPersistPropertyBag, reinterpret_cast<void **>(&persist));
if (persist) {
QtPropertyBag *pbag = new QtPropertyBag();
pbag->map = bag;
@@ -4440,7 +4444,7 @@ bool QAxBase::isNull() const
QVariant QAxBase::asVariant() const
{
if (!d->ptr && !d->initialized) {
- ((QAxBase*)this)->initialize(&d->ptr);
+ const_cast<QAxBase *>(this)->initialize(&d->ptr);
d->initialized = true;
}
@@ -4471,8 +4475,8 @@ void *qax_createObjectWrapper(int metaType, IUnknown *iface)
if (!iface)
return 0;
- QAxObject *object = (QAxObject*)QMetaType::create(metaType, 0);
- QAxBasePrivate *d = object->d;
+ void *object = QMetaType::create(metaType, 0);
+ QAxBasePrivate *d = reinterpret_cast<const QAxObject *>(object)->d;
d->ptr = iface;
d->initialized = true;
diff --git a/src/activeqt/container/qaxbase.h b/src/activeqt/container/qaxbase.h
index 7b667af..f83c920 100644
--- a/src/activeqt/container/qaxbase.h
+++ b/src/activeqt/container/qaxbase.h
@@ -64,7 +64,7 @@ class QAxBase
public:
typedef QMap<QString, QVariant> PropertyBag;
- QAxBase(IUnknown *iface = 0);
+ explicit QAxBase(IUnknown *iface = Q_NULLPTR);
virtual ~QAxBase();
QString control() const;
@@ -173,14 +173,14 @@ private:
template <> inline QAxBase *qobject_cast<QAxBase*>(const QObject *o)
{
- void *result = o ? const_cast<QObject *>(o)->qt_metacast("QAxBase") : 0;
- return (QAxBase*)(result);
+ void *result = o ? const_cast<QObject *>(o)->qt_metacast("QAxBase") : Q_NULLPTR;
+ return static_cast<QAxBase *>(result);
}
template <> inline QAxBase *qobject_cast<QAxBase*>(QObject *o)
{
- void *result = o ? o->qt_metacast("QAxBase") : 0;
- return (QAxBase*)(result);
+ void *result = o ? o->qt_metacast("QAxBase") : Q_NULLPTR;
+ return static_cast<QAxBase *>(result);
}
extern QString qax_generateDocumentation(QAxBase *);
diff --git a/src/activeqt/container/qaxdump.cpp b/src/activeqt/container/qaxdump.cpp
index be22892..2d519e1 100644
--- a/src/activeqt/container/qaxdump.cpp
+++ b/src/activeqt/container/qaxdump.cpp
@@ -59,7 +59,7 @@ QString qax_docuFromName(ITypeInfo *typeInfo, const QString &name)
MEMBERID memId;
BSTR names = QStringToBSTR(name);
- typeInfo->GetIDsOfNames((BSTR*)&names, 1, &memId);
+ typeInfo->GetIDsOfNames(&names, 1, &memId);
SysFreeString(names);
if (memId != DISPID_UNKNOWN) {
BSTR docStringBstr, helpFileBstr;
@@ -73,7 +73,8 @@ QString qax_docuFromName(ITypeInfo *typeInfo, const QString &name)
if (!docString.isEmpty())
docu += docString + QLatin1String("\n");
if (!helpFile.isEmpty())
- docu += QString::fromLatin1("For more information, see help context %1 in %2.").arg((uint)helpContext).arg(helpFile);
+ docu += QString::fromLatin1("For more information, see help context %1 in %2.")
+ .arg(uint(helpContext)).arg(helpFile);
}
}
@@ -134,7 +135,7 @@ QString qax_generateDocumentation(QAxBase *that)
ITypeInfo *typeInfo = 0;
IDispatch *dispatch = 0;
- that->queryInterface(IID_IDispatch, (void**)&dispatch);
+ that->queryInterface(IID_IDispatch, reinterpret_cast<void **>(&dispatch));
if (dispatch)
dispatch->GetTypeInfo(0, LOCALE_SYSTEM_DEFAULT, &typeInfo);
@@ -151,7 +152,7 @@ QString qax_generateDocumentation(QAxBase *that)
stream << "<h3>Interfaces</h3>" << endl;
stream << "<ul>" << endl;
const char *inter = 0;
- int interCount = 1;
+ UINT interCount = 1;
while ((inter = mo->classInfo(mo->indexOfClassInfo("Interface " + QByteArray::number(interCount))).value())) {
stream << "<li>" << inter << endl;
interCount++;
@@ -352,7 +353,7 @@ QString qax_generateDocumentation(QAxBase *that)
setterSlot = "Set" + name;
} else {
QByteArray nameUp = name;
- nameUp[0] = toupper(nameUp.at(0));
+ nameUp[0] = char(toupper(nameUp.at(0)));
setterSlot = "set" + nameUp;
}
detail += QLatin1String("<a href=\"#") + QString::fromLatin1(setterSlot) + QLatin1String("\">") +
diff --git a/src/activeqt/container/qaxobject.cpp b/src/activeqt/container/qaxobject.cpp
index a2ea2dd..dc5189c 100644
--- a/src/activeqt/container/qaxobject.cpp
+++ b/src/activeqt/container/qaxobject.cpp
@@ -162,8 +162,8 @@ const QMetaObject *QAxObject::parentMetaObject() const
*/
void *QAxObject::qt_metacast(const char *cname)
{
- if (!qstrcmp(cname, "QAxObject")) return (void*)this;
- if (!qstrcmp(cname, "QAxBase")) return (QAxBase*)this;
+ if (!qstrcmp(cname, "QAxObject")) return static_cast<void *>(this);
+ if (!qstrcmp(cname, "QAxBase")) return static_cast<QAxBase *>(this);
return QObject::qt_metacast(cname);
}
@@ -212,7 +212,7 @@ bool QAxObject::doVerb(const QString &verb)
if (!verbs().contains(verb))
return false;
IOleObject *ole = 0;
- queryInterface(IID_IOleObject, (void**)&ole);
+ queryInterface(IID_IOleObject, reinterpret_cast<void **>(&ole));
if (!ole)
return false;
diff --git a/src/activeqt/container/qaxobject.h b/src/activeqt/container/qaxobject.h
index fc09a70..f7e16d2 100644
--- a/src/activeqt/container/qaxobject.h
+++ b/src/activeqt/container/qaxobject.h
@@ -53,9 +53,9 @@ public:
QObject* qObject() const Q_DECL_OVERRIDE { return static_cast<QObject *>(const_cast<QAxObject *>(this)); }
const char *className() const Q_DECL_OVERRIDE;
- QAxObject(QObject *parent = 0);
- QAxObject(const QString &c, QObject *parent = 0);
- QAxObject(IUnknown *iface, QObject *parent = 0);
+ explicit QAxObject(QObject *parent = Q_NULLPTR);
+ explicit QAxObject(const QString &c, QObject *parent = Q_NULLPTR);
+ explicit QAxObject(IUnknown *iface, QObject *parent = Q_NULLPTR);
~QAxObject();
bool doVerb(const QString &verb);
@@ -70,14 +70,14 @@ private:
template <> inline QAxObject *qobject_cast<QAxObject*>(const QObject *o)
{
- void *result = o ? const_cast<QObject *>(o)->qt_metacast("QAxObject") : 0;
- return (QAxObject*)(result);
+ void *result = o ? const_cast<QObject *>(o)->qt_metacast("QAxObject") : Q_NULLPTR;
+ return reinterpret_cast<QAxObject*>(result);
}
template <> inline QAxObject *qobject_cast<QAxObject*>(QObject *o)
{
- void *result = o ? o->qt_metacast("QAxObject") : 0;
- return (QAxObject*)(result);
+ void *result = o ? o->qt_metacast("QAxObject") : Q_NULLPTR;
+ return reinterpret_cast<QAxObject*>(result);
}
QT_END_NAMESPACE
diff --git a/src/activeqt/container/qaxscript.cpp b/src/activeqt/container/qaxscript.cpp
index 861edab..7c84e4b 100644
--- a/src/activeqt/container/qaxscript.cpp
+++ b/src/activeqt/container/qaxscript.cpp
@@ -151,11 +151,11 @@ HRESULT WINAPI QAxScriptSite::QueryInterface(REFIID iid, void **ppvObject)
{
*ppvObject = 0;
if (iid == IID_IUnknown)
- *ppvObject = (IUnknown*)(IActiveScriptSite*)this;
+ *ppvObject = static_cast<IUnknown *>(static_cast<IActiveScriptSite *>(this));
else if (iid == IID_IActiveScriptSite)
- *ppvObject = (IActiveScriptSite*)this;
+ *ppvObject = static_cast<IActiveScriptSite *>(this);
else if (iid == IID_IActiveScriptSiteWindow)
- *ppvObject = (IActiveScriptSiteWindow*)this;
+ *ppvObject = static_cast<IActiveScriptSiteWindow *>(this);
else
return E_NOINTERFACE;
@@ -196,10 +196,10 @@ HRESULT WINAPI QAxScriptSite::GetItemInfo(LPCOLESTR pstrName, DWORD mask, IUnkno
return TYPE_E_ELEMENTNOTFOUND;
if (mask & SCRIPTINFO_IUNKNOWN)
- object->queryInterface(IID_IUnknown, (void**)item);
+ object->queryInterface(IID_IUnknown, reinterpret_cast<void **>(item));
if (mask & SCRIPTINFO_ITYPEINFO) {
IProvideClassInfo *classInfo = 0;
- object->queryInterface(IID_IProvideClassInfo, (void**)&classInfo);
+ object->queryInterface(IID_IProvideClassInfo, reinterpret_cast<void **>(&classInfo));
if (classInfo) {
classInfo->GetClassInfo(type);
classInfo->Release();
@@ -291,7 +291,8 @@ HRESULT WINAPI QAxScriptSite::OnScriptError(IActiveScriptError *error)
SysFreeString(exception.bstrDescription);
SysFreeString(exception.bstrHelpFile);
- emit script->error(exception.wCode, QString::fromWCharArray(exception.bstrDescription), lineNumber, lineText);
+ emit script->error(exception.wCode, QString::fromWCharArray(exception.bstrDescription),
+ int(lineNumber), lineText);
return S_OK;
}
@@ -461,16 +462,16 @@ bool QAxScriptEngine::initialize(IUnknown **ptr)
return false;
CLSID clsid;
- HRESULT hres = CLSIDFromProgID((wchar_t*)script_language.utf16(), &clsid);
+ HRESULT hres = CLSIDFromProgID(reinterpret_cast<const wchar_t *>(script_language.utf16()), &clsid);
if(FAILED(hres))
return false;
- CoCreateInstance(clsid, 0, CLSCTX_INPROC_SERVER, IID_IActiveScript, (void**)&engine);
+ CoCreateInstance(clsid, 0, CLSCTX_INPROC_SERVER, IID_IActiveScript, reinterpret_cast<void **>(&engine));
if (!engine)
return false;
IActiveScriptParse *parser = 0;
- engine->QueryInterface(IID_IActiveScriptParse, (void**)&parser);
+ engine->QueryInterface(IID_IActiveScriptParse, reinterpret_cast<void **>(&parser));
if (!parser) {
engine->Release();
engine = 0;
@@ -510,7 +511,7 @@ bool QAxScriptEngine::initialize(IUnknown **ptr)
IDispatch *scriptDispatch = 0;
engine->GetScriptDispatch(0, &scriptDispatch);
if (scriptDispatch) {
- scriptDispatch->QueryInterface(IID_IUnknown, (void**)ptr);
+ scriptDispatch->QueryInterface(IID_IUnknown, reinterpret_cast<void **>(ptr));
scriptDispatch->Release();
}
#endif
@@ -535,7 +536,7 @@ bool QAxScriptEngine::hasIntrospection() const
return false;
IDispatch *scriptDispatch = 0;
- QAxBase::queryInterface(IID_IDispatch, (void**)&scriptDispatch);
+ QAxBase::queryInterface(IID_IDispatch, reinterpret_cast<void **>(&scriptDispatch));
if (!scriptDispatch)
return false;
@@ -579,7 +580,7 @@ QAxScriptEngine::State QAxScriptEngine::state() const
#ifndef QT_NO_QAXSCRIPT
SCRIPTSTATE state;
engine->GetScriptState(&state);
- return (State)state;
+ return State(state);
#else
return Uninitialized;
#endif
@@ -595,7 +596,7 @@ void QAxScriptEngine::setState(State st)
if (!engine)
return;
- engine->SetScriptState((SCRIPTSTATE)st);
+ engine->SetScriptState(SCRIPTSTATE(st));
#else
Q_UNUSED(st);
#endif
@@ -611,7 +612,8 @@ void QAxScriptEngine::addItem(const QString &name)
if (!engine)
return;
- engine->AddNamedItem((wchar_t*)name.utf16(), SCRIPTITEM_ISSOURCE|SCRIPTITEM_ISVISIBLE);
+ engine->AddNamedItem(reinterpret_cast<const wchar_t *>(name.utf16()),
+ SCRIPTITEM_ISSOURCE|SCRIPTITEM_ISVISIBLE);
#else
Q_UNUSED(name);
#endif
@@ -1153,7 +1155,7 @@ bool QAxScriptManager::registerEngine(const QString &name, const QString &extens
return false;
CLSID clsid;
- HRESULT hres = CLSIDFromProgID((wchar_t*)name.utf16(), &clsid);
+ const HRESULT hres = CLSIDFromProgID(reinterpret_cast<const wchar_t *>(name.utf16()), &clsid);
if (hres != S_OK)
return false;
diff --git a/src/activeqt/container/qaxscript.h b/src/activeqt/container/qaxscript.h
index ef2ae0a..67c94da 100644
--- a/src/activeqt/container/qaxscript.h
+++ b/src/activeqt/container/qaxscript.h
@@ -149,7 +149,7 @@ class QAxScriptManager : public QObject
Q_OBJECT
public:
- QAxScriptManager(QObject *parent = 0);
+ explicit QAxScriptManager(QObject *parent = Q_NULLPTR);
~QAxScriptManager();
void addObject(QAxBase *object);
@@ -212,7 +212,7 @@ inline QAxScriptEngine *QAxScript::scriptEngine() const
inline bool QAxScriptEngine::isValid() const
{
- return engine != 0;
+ return engine != Q_NULLPTR;
}
inline QString QAxScriptEngine::scriptLanguage() const
diff --git a/src/activeqt/container/qaxselect.cpp b/src/activeqt/container/qaxselect.cpp
index 0b40e78..0fc7d62 100644
--- a/src/activeqt/container/qaxselect.cpp
+++ b/src/activeqt/container/qaxselect.cpp
@@ -170,18 +170,20 @@ static QList<Control> readControls(const wchar_t *rootKey, unsigned wordSize)
if (result == ERROR_SUCCESS) {
RegCloseKey(subKey);
szBuffer = sizeof(buffer) / sizeof(wchar_t);
- RegistryQueryValue(classesKey, buffer, (LPBYTE)buffer, &szBuffer);
+ RegistryQueryValue(classesKey, buffer, reinterpret_cast<LPBYTE>(buffer), &szBuffer);
Control control;
control.clsid = clsid;
control.wordSize = wordSize;
control.name = QString::fromWCharArray(buffer);
szBuffer = sizeof(buffer) / sizeof(wchar_t);
- if (querySubKeyValue(classesKey, clsid + QStringLiteral("\\InprocServer32"), (LPBYTE)buffer, &szBuffer)) {
+ if (querySubKeyValue(classesKey, clsid + QStringLiteral("\\InprocServer32"),
+ reinterpret_cast<LPBYTE>(buffer), &szBuffer)) {
control.dll = QString::fromWCharArray(buffer);
control.dll.replace(systemRootPattern, systemRoot);
}
szBuffer = sizeof(buffer) / sizeof(wchar_t);
- if (querySubKeyValue(classesKey, clsid + QStringLiteral("\\VERSION"), (LPBYTE)buffer, &szBuffer))
+ if (querySubKeyValue(classesKey, clsid + QStringLiteral("\\VERSION"),
+ reinterpret_cast<LPBYTE>(buffer), &szBuffer))
control.version = QString::fromWCharArray(buffer);
controls.push_back(control);
}
diff --git a/src/activeqt/container/qaxselect.h b/src/activeqt/container/qaxselect.h
index 0b21c02..160b436 100644
--- a/src/activeqt/container/qaxselect.h
+++ b/src/activeqt/container/qaxselect.h
@@ -51,7 +51,7 @@ class QAxSelect : public QDialog
{
Q_OBJECT
public:
- QAxSelect(QWidget *parent = 0, Qt::WindowFlags flags = 0);
+ explicit QAxSelect(QWidget *parent = Q_NULLPTR, Qt::WindowFlags flags = Qt::WindowFlags());
~QAxSelect();
QString clsid() const;
diff --git a/src/activeqt/container/qaxwidget.cpp b/src/activeqt/container/qaxwidget.cpp
index 2dd4c31..bdc6e1d 100644
--- a/src/activeqt/container/qaxwidget.cpp
+++ b/src/activeqt/container/qaxwidget.cpp
@@ -194,7 +194,7 @@ public:
RECT rcPos = qaxNativeWidgetRect(host);
return m_spOleObject->DoVerb(index, 0, this, 0,
- (HWND)host->winId(),
+ reinterpret_cast<HWND>(host->winId()),
&rcPos);
}
@@ -383,11 +383,11 @@ public:
private:
struct OleMenuItem {
OleMenuItem(HMENU hm = 0, int ID = 0, QMenu *menu = 0)
- : hMenu(hm), id(ID), subMenu(menu)
+ : hMenu(hm), subMenu(menu), id(ID)
{}
HMENU hMenu;
- int id;
QMenu *subMenu;
+ int id;
};
typedef QMap<QAction*, OleMenuItem> MenuItemMap;
@@ -469,7 +469,7 @@ Q_GLOBAL_STATIC(QAxNativeEventFilter, s_nativeEventFilter)
bool QAxNativeEventFilter::nativeEventFilter(const QByteArray &, void *m, long *)
{
- MSG *msg = (MSG*)m;
+ MSG *msg = static_cast<MSG *>(m);
const uint message = msg->message;
if (message == WM_DISPLAYCHANGE)
qaxClearCachedSystemLogicalDpi();
@@ -486,7 +486,7 @@ bool QAxNativeEventFilter::nativeEventFilter(const QByteArray &, void *m, long *
}
if (host)
ax = qobject_cast<QAxWidget*>(host->parentWidget());
- if (ax && msg->hwnd != (HWND)host->winId()) {
+ if (ax && msg->hwnd != reinterpret_cast<HWND>(host->winId())) {
if (message >= WM_KEYFIRST && message <= WM_KEYLAST) {
QAxClientSite *site = host->clientSite();
site->eventTranslated = true; // reset in QAxClientSite::TranslateAccelerator
@@ -503,7 +503,7 @@ bool QAxNativeEventFilter::nativeEventFilter(const QByteArray &, void *m, long *
;
if (mouseTbl[i]) {
- QEvent::Type type = (QEvent::Type)mouseTbl[++i];
+ const QEvent::Type type = static_cast<QEvent::Type>(mouseTbl[++i]);
int button = mouseTbl[++i];
if (type != QEvent::MouseMove || ax->hasMouseTracking() || button) {
if (type == QEvent::MouseMove)
@@ -514,9 +514,9 @@ bool QAxNativeEventFilter::nativeEventFilter(const QByteArray &, void *m, long *
const QPoint gpos = qaxFromNativePosition(ax, nativeGlobalPos);
QPoint pos = ax->mapFromGlobal(gpos);
- QMouseEvent e(type, pos, gpos, (Qt::MouseButton)button,
- translateMouseButtonState(msg->wParam),
- translateModifierState(msg->wParam));
+ QMouseEvent e(type, pos, gpos, static_cast<Qt::MouseButton>(button),
+ translateMouseButtonState(int(msg->wParam)),
+ translateModifierState(int(msg->wParam)));
QCoreApplication::sendEvent(ax, &e);
}
}
@@ -532,7 +532,7 @@ QAxClientSite::QAxClientSite(QAxWidget *c)
{
aggregatedObject = widget->createAggregate();
if (aggregatedObject) {
- aggregatedObject->controlling_unknown = (IUnknown*)(IDispatch*)this;
+ aggregatedObject->controlling_unknown = static_cast<IUnknown *>(static_cast<IDispatch *>(this));
aggregatedObject->the_object = c;
}
@@ -617,13 +617,12 @@ bool QAxClientSite::activateObject(bool initialized, const QByteArray &data)
spPSI->Release();
} else if (data.length()) { //try initializing using a IPersistStorage
IPersistStorage *spPS = 0;
- m_spOleObject->QueryInterface( IID_IPersistStorage, (void**)&spPS );
+ m_spOleObject->QueryInterface( IID_IPersistStorage, reinterpret_cast<void **>(&spPS));
if (spPS) {
- HGLOBAL hGlobal = GlobalAlloc(GMEM_MOVEABLE, data.length());
+ HGLOBAL hGlobal = GlobalAlloc(GMEM_MOVEABLE, size_t(data.length()));
if (hGlobal) {
- BYTE* pbData = (BYTE*)GlobalLock(hGlobal);
- if (pbData)
- memcpy(pbData, data.data(), data.length());
+ if (BYTE* pbData = static_cast<BYTE *>(GlobalLock(hGlobal)))
+ memcpy(pbData, data.data(), size_t(data.length()));
GlobalUnlock(hGlobal);
// open an IStorage on the data and pass it to Load
LPLOCKBYTES pLockBytes = 0;
@@ -648,11 +647,11 @@ bool QAxClientSite::activateObject(bool initialized, const QByteArray &data)
}
IViewObject *spViewObject = 0;
- m_spOleObject->QueryInterface(IID_IViewObject, (void**) &spViewObject);
+ m_spOleObject->QueryInterface(IID_IViewObject, reinterpret_cast<void **>(&spViewObject));
m_spOleObject->Advise(this, &m_dwOleObject);
IAdviseSink *spAdviseSink = 0;
- QueryInterface(IID_IAdviseSink, (void**)&spAdviseSink);
+ QueryInterface(IID_IAdviseSink, reinterpret_cast<void **>(&spAdviseSink));
if (spAdviseSink && spViewObject) {
if (spViewObject)
spViewObject->SetAdvise(DVASPECT_CONTENT, 0, spAdviseSink);
@@ -684,12 +683,12 @@ bool QAxClientSite::activateObject(bool initialized, const QByteArray &data)
RECT rcPos = qaxQRect2Rect(QRect(qaxNativeWidgetPosition(host), qaxToNativeSize(host, sizehint)));
- m_spOleObject->DoVerb(OLEIVERB_INPLACEACTIVATE, 0, (IOleClientSite*)this, 0,
- (HWND)host->winId(),
+ m_spOleObject->DoVerb(OLEIVERB_INPLACEACTIVATE, 0, static_cast<IOleClientSite *>(this), 0,
+ reinterpret_cast<HWND>(host->winId()),
&rcPos);
if (!m_spOleControl)
- m_spOleObject->QueryInterface(IID_IOleControl, (void**)&m_spOleControl);
+ m_spOleObject->QueryInterface(IID_IOleControl, reinterpret_cast<void **>(&m_spOleControl));
if (m_spOleControl) {
m_spOleControl->OnAmbientPropertyChange(DISPID_AMBIENT_BACKCOLOR);
m_spOleControl->OnAmbientPropertyChange(DISPID_AMBIENT_FORECOLOR);
@@ -708,9 +707,9 @@ bool QAxClientSite::activateObject(bool initialized, const QByteArray &data)
}
} else {
IObjectWithSite *spSite = 0;
- widget->queryInterface(IID_IObjectWithSite, (void**)&spSite);
+ widget->queryInterface(IID_IObjectWithSite, reinterpret_cast<void **>(&spSite));
if (spSite) {
- spSite->SetSite((IUnknown*)(IDispatch*)this);
+ spSite->SetSite(static_cast<IUnknown *>(static_cast<IDispatch *>(this)));
spSite->Release();
}
}
@@ -785,7 +784,7 @@ HRESULT WINAPI QAxClientSite::QueryInterface(REFIID iid, void **iface)
*iface = 0;
if (iid == IID_IUnknown) {
- *iface = (IUnknown*)(IDispatch*)this;
+ *iface = static_cast<IUnknown *>(static_cast<IDispatch *>(this));
} else {
HRESULT res = S_OK;
if (aggregatedObject)
@@ -796,29 +795,29 @@ HRESULT WINAPI QAxClientSite::QueryInterface(REFIID iid, void **iface)
if (!(*iface)) {
if (iid == IID_IDispatch)
- *iface = (IDispatch*)this;
+ *iface = static_cast<IDispatch *>(this);
else if (iid == IID_IOleClientSite)
- *iface = (IOleClientSite*)this;
+ *iface = static_cast<IOleClientSite *>(this);
else if (iid == IID_IOleControlSite)
- *iface = (IOleControlSite*)this;
+ *iface = static_cast<IOleControlSite *>(this);
else if (iid == IID_IOleWindow)
- *iface = (IOleWindow*)(IOleInPlaceSite*)this;
+ *iface = static_cast<IOleWindow *>(static_cast<IOleInPlaceSite *>(this));
else if (iid == IID_IOleInPlaceSite)
- *iface = (IOleInPlaceSite*)this;
+ *iface = static_cast<IOleInPlaceSite *>(this);
#ifdef QAX_SUPPORT_WINDOWLESS
else if (iid == IID_IOleInPlaceSiteEx)
- *iface = (IOleInPlaceSiteEx*)this;
+ *iface = static_cast<IOleInPlaceSiteEx *>(this);
else if (iid == IID_IOleInPlaceSiteWindowless)
- *iface = (IOleInPlaceSiteWindowless*)this;
+ *iface = static_cast<IOleInPlaceSiteWindowless *>(this);
#endif
else if (iid == IID_IOleInPlaceFrame)
- *iface = (IOleInPlaceFrame*)this;
+ *iface = static_cast<IOleInPlaceFrame *>(this);
else if (iid == IID_IOleInPlaceUIWindow)
- *iface = (IOleInPlaceUIWindow*)this;
+ *iface = static_cast<IOleInPlaceUIWindow *>(this);
else if (iid == IID_IOleDocumentSite && canHostDocument)
- *iface = (IOleDocumentSite*)this;
+ *iface = static_cast<IOleDocumentSite *>(this);
else if (iid == IID_IAdviseSink)
- *iface = (IAdviseSink*)this;
+ *iface = static_cast<IAdviseSink *>(this);
}
if (!*iface)
return E_NOINTERFACE;
@@ -994,7 +993,7 @@ HRESULT WINAPI QAxClientSite::TranslateAccelerator(LPMSG lpMsg, DWORD /*grfModif
// if the request is coming from an out-of-proc server or a non ActiveQt server,
// we send the message to the host window. This will make sure this key event
// comes to Qt for processing.
- SendMessage((HWND)host->winId(), lpMsg->message, lpMsg->wParam, lpMsg->lParam);
+ SendMessage(reinterpret_cast<HWND>(host->winId()), lpMsg->message, lpMsg->wParam, lpMsg->lParam);
if (ActiveQtDetected && !fromInProcServer) {
// ActiveQt based servers will need further processing of the event
// (eg. <SPACE> key for a checkbox), so we return false.
@@ -1029,7 +1028,7 @@ HRESULT WINAPI QAxClientSite::GetWindow(HWND *phwnd)
if (!phwnd)
return E_POINTER;
- *phwnd = (HWND)host->winId();
+ *phwnd = reinterpret_cast<HWND>(host->winId());
return S_OK;
}
@@ -1062,7 +1061,7 @@ HRESULT WINAPI QAxClientSite::OnInPlaceActivate()
inPlaceObjectWindowless = true;
} else {
inPlaceObjectWindowless = false;
- m_spOleObject->QueryInterface(IID_IOleInPlaceObject, (void**) &m_spInPlaceObject);
+ m_spOleObject->QueryInterface(IID_IOleInPlaceObject, reinterpret_cast<void **>(&m_spInPlaceObject));
}
}
@@ -1080,10 +1079,10 @@ HRESULT WINAPI QAxClientSite::GetWindowContext(IOleInPlaceFrame **ppFrame, IOleI
if (!ppFrame || !ppDoc || !lprcPosRect || !lprcClipRect || !lpFrameInfo)
return E_POINTER;
- QueryInterface(IID_IOleInPlaceFrame, (void**)ppFrame);
- QueryInterface(IID_IOleInPlaceUIWindow, (void**)ppDoc);
+ QueryInterface(IID_IOleInPlaceFrame, reinterpret_cast<void **>(ppFrame));
+ QueryInterface(IID_IOleInPlaceUIWindow, reinterpret_cast<void **>(ppDoc));
- const HWND hwnd = (HWND)host->winId();
+ const HWND hwnd = reinterpret_cast<HWND>(host->winId());
::GetClientRect(hwnd, lprcPosRect);
::GetClientRect(hwnd, lprcClipRect);
@@ -1186,7 +1185,7 @@ static int menuItemEntry(HMENU menu, int index, MENUITEMINFO item, QString &text
wchar_t *titlebuf = new wchar_t[item.cch + 1];
item.dwTypeData = titlebuf;
item.cch++;
- ::GetMenuItemInfo(menu, index, true, &item);
+ ::GetMenuItemInfo(menu, UINT(index), true, &item);
text = QString::fromWCharArray(titlebuf);
delete [] titlebuf;
return MFT_STRING;
@@ -1225,7 +1224,7 @@ QMenu *QAxClientSite::generatePopup(HMENU subMenu, QWidget *parent)
memset(&item, 0, sizeof(MENUITEMINFO));
item.cbSize = sizeof(MENUITEMINFO);
item.fMask = MIIM_ID | MIIM_TYPE | MIIM_SUBMENU;
- ::GetMenuItemInfo(subMenu, i, true, &item);
+ ::GetMenuItemInfo(subMenu, UINT(i), true, &item);
QAction *action = 0;
QMenu *popupMenu = 0;
@@ -1273,7 +1272,7 @@ QMenu *QAxClientSite::generatePopup(HMENU subMenu, QWidget *parent)
}
if (action) {
- OleMenuItem oleItem(subMenu, item.wID, popupMenu);
+ OleMenuItem oleItem(subMenu, int(item.wID), popupMenu);
menuItemMap.insert(action, oleItem);
}
}
@@ -1299,7 +1298,7 @@ HRESULT WINAPI QAxClientSite::SetMenu(HMENU hmenuShared, HOLEMENU holemenu, HWND
memset(&item, 0, sizeof(MENUITEMINFO));
item.cbSize = sizeof(MENUITEMINFO);
item.fMask = MIIM_ID | MIIM_TYPE | MIIM_SUBMENU;
- ::GetMenuItemInfo(hmenuShared, i, true, &item);
+ ::GetMenuItemInfo(hmenuShared, UINT(i), true, &item);
QAction *action = 0;
QMenu *popupMenu = 0;
@@ -1335,7 +1334,7 @@ HRESULT WINAPI QAxClientSite::SetMenu(HMENU hmenuShared, HOLEMENU holemenu, HWND
}
if (action) {
- OleMenuItem oleItem(hmenuShared, item.wID, popupMenu);
+ OleMenuItem oleItem(hmenuShared, int(item.wID), popupMenu);
menuItemMap.insert(action, oleItem);
}
}
@@ -1366,12 +1365,12 @@ int QAxClientSite::qt_metacall(QMetaObject::Call call, int isignal, void **argv)
if (isignal != menuBar->metaObject()->indexOfSignal("triggered(QAction*)"))
return isignal;
- QAction *action = *(QAction**)argv[1];
+ QAction *action = *reinterpret_cast<QAction **>(argv[1]);
// ###
OleMenuItem oleItem = menuItemMap.value(action);
if (oleItem.hMenu)
- ::PostMessage(m_menuOwner, WM_COMMAND, oleItem.id, 0);
+ ::PostMessage(m_menuOwner, WM_COMMAND, WPARAM(oleItem.id), 0);
return -1;
}
@@ -1419,7 +1418,7 @@ HRESULT WINAPI QAxClientSite::EnableModeless(BOOL fEnable)
HRESULT WINAPI QAxClientSite::TranslateAccelerator(LPMSG lpMsg, WORD grfModifiers)
{
- return TranslateAccelerator(lpMsg, (DWORD)grfModifiers);
+ return TranslateAccelerator(lpMsg, DWORD(grfModifiers));
}
//**** IOleInPlaceUIWindow
@@ -1531,7 +1530,7 @@ HRESULT WINAPI QAxClientSite::ActivateMe(IOleDocumentView *pViewToActivate)
if (!pViewToActivate) {
IOleDocument *document = 0;
- m_spOleObject->QueryInterface(IID_IOleDocument, (void**)&document);
+ m_spOleObject->QueryInterface(IID_IOleDocument, reinterpret_cast<void **>(&document));
if (!document)
return E_FAIL;
@@ -1652,7 +1651,7 @@ void QAxHostWidget::resizeObject()
// document server - talk to view?
if (axhost->m_spActiveView) {
RECT rect;
- GetClientRect((HWND)winId(), &rect);
+ GetClientRect(reinterpret_cast<HWND>(winId()), &rect);
axhost->m_spActiveView->SetRect(&rect);
return;
@@ -1683,7 +1682,7 @@ bool QAxHostWidget::nativeEvent(const QByteArray &eventType, void *message, long
&& eventType == QByteArrayLiteral("windows_generic_MSG")) {
Q_ASSERT(axhost->m_spInPlaceObject);
MSG *msg = static_cast<MSG *>(message);
- IOleInPlaceObjectWindowless *windowless = (IOleInPlaceObjectWindowless*)axhost->m_spInPlaceObject;
+ IOleInPlaceObjectWindowless *windowless = axhost->m_spInPlaceObject;
Q_ASSERT(windowless);
LRESULT lres;
HRESULT hres = windowless->OnWindowMessage(msg->message, msg->wParam, msg->lParam, &lres);
@@ -1699,20 +1698,19 @@ bool QAxHostWidget::event(QEvent *e)
{
switch (e->type()) {
case QEvent::Timer:
- if (axhost && ((QTimerEvent*)e)->timerId() == setFocusTimer) {
+ if (axhost && static_cast<const QTimerEvent *>(e)->timerId() == setFocusTimer) {
killTimer(setFocusTimer);
setFocusTimer = 0;
RECT rcPos = qaxNativeWidgetRect(this);
- axhost->m_spOleObject->DoVerb(OLEIVERB_UIACTIVATE, 0, (IOleClientSite*)axhost, 0,
- (HWND)winId(),
- &rcPos);
+ axhost->m_spOleObject->DoVerb(OLEIVERB_UIACTIVATE, 0, static_cast<IOleClientSite *>(axhost), 0,
+ reinterpret_cast<HWND>(winId()), &rcPos);
if (axhost->m_spActiveView)
axhost->m_spActiveView->UIActivate(TRUE);
}
break;
case QEvent::WindowBlocked:
- if (IsWindowEnabled((HWND)winId())) {
- EnableWindow((HWND)winId(), false);
+ if (IsWindowEnabled(reinterpret_cast<HWND>(winId()))) {
+ EnableWindow(reinterpret_cast<HWND>(winId()), false);
if (axhost && axhost->m_spInPlaceActiveObject) {
axhost->inPlaceModelessEnabled = false;
axhost->m_spInPlaceActiveObject->EnableModeless(false);
@@ -1720,8 +1718,8 @@ bool QAxHostWidget::event(QEvent *e)
}
break;
case QEvent::WindowUnblocked:
- if (!IsWindowEnabled((HWND)winId())) {
- EnableWindow((HWND)winId(), true);
+ if (!IsWindowEnabled(reinterpret_cast<HWND>(winId()))) {
+ EnableWindow(reinterpret_cast<HWND>(winId()), true);
if (axhost && axhost->m_spInPlaceActiveObject) {
axhost->inPlaceModelessEnabled = true;
axhost->m_spInPlaceActiveObject->EnableModeless(true);
@@ -1792,7 +1790,7 @@ void QAxHostWidget::paintEvent(QPaintEvent*)
IViewObject *view = 0;
if (axhost)
- axhost->widget->queryInterface(IID_IViewObject, (void**)&view);
+ axhost->widget->queryInterface(IID_IViewObject, reinterpret_cast<void **>(&view));
if (!view)
return;
@@ -2082,8 +2080,8 @@ const QMetaObject *QAxWidget::parentMetaObject() const
*/
void *QAxWidget::qt_metacast(const char *cname)
{
- if (!qstrcmp(cname, "QAxWidget")) return (void*)this;
- if (!qstrcmp(cname, "QAxBase")) return (QAxBase*)this;
+ if (!qstrcmp(cname, "QAxWidget")) return static_cast<void *>(this);
+ if (!qstrcmp(cname, "QAxBase")) return static_cast<QAxBase *>(this);
return QWidget::qt_metacast(cname);
}
diff --git a/src/activeqt/container/qaxwidget.h b/src/activeqt/container/qaxwidget.h
index ce5efd3..e6131d9 100644
--- a/src/activeqt/container/qaxwidget.h
+++ b/src/activeqt/container/qaxwidget.h
@@ -56,12 +56,12 @@ class QAxWidget : public QWidget, public QAxBase
{
Q_OBJECT_FAKE
public:
- QObject* qObject() const Q_DECL_OVERRIDE { return (QWidget*)this; }
+ QObject* qObject() const Q_DECL_OVERRIDE { return const_cast<QAxWidget *>(this); }
const char *className() const Q_DECL_OVERRIDE;
- QAxWidget(QWidget* parent = 0, Qt::WindowFlags f = 0);
- QAxWidget(const QString &c, QWidget *parent = 0, Qt::WindowFlags f = 0);
- QAxWidget(IUnknown *iface, QWidget *parent = 0, Qt::WindowFlags f = 0);
+ explicit QAxWidget(QWidget* parent = Q_NULLPTR, Qt::WindowFlags f = Qt::WindowFlags());
+ explicit QAxWidget(const QString &c, QWidget *parent = Q_NULLPTR, Qt::WindowFlags f = Qt::WindowFlags());
+ explicit QAxWidget(IUnknown *iface, QWidget *parent = Q_NULLPTR, Qt::WindowFlags f = Qt::WindowFlags());
~QAxWidget();
void clear() Q_DECL_OVERRIDE;
@@ -94,14 +94,14 @@ private:
template <> inline QAxWidget *qobject_cast<QAxWidget*>(const QObject *o)
{
- void *result = o ? const_cast<QObject *>(o)->qt_metacast("QAxWidget") : 0;
- return (QAxWidget*)(result);
+ void *result = o ? const_cast<QObject *>(o)->qt_metacast("QAxWidget") : Q_NULLPTR;
+ return static_cast<QAxWidget *>(result);
}
template <> inline QAxWidget *qobject_cast<QAxWidget*>(QObject *o)
{
- void *result = o ? o->qt_metacast("QAxWidget") : 0;
- return (QAxWidget*)(result);
+ void *result = o ? o->qt_metacast("QAxWidget") : Q_NULLPTR;
+ return static_cast<QAxWidget *>(result);
}
QT_END_NAMESPACE