summaryrefslogtreecommitdiffstats
path: root/src/activeqt/container
diff options
context:
space:
mode:
Diffstat (limited to 'src/activeqt/container')
-rw-r--r--src/activeqt/container/qaxbase.cpp86
-rw-r--r--src/activeqt/container/qaxdump.cpp38
-rw-r--r--src/activeqt/container/qaxscript.cpp4
-rw-r--r--src/activeqt/container/qaxwidget.cpp12
4 files changed, 72 insertions, 68 deletions
diff --git a/src/activeqt/container/qaxbase.cpp b/src/activeqt/container/qaxbase.cpp
index 1ec704a..e1ffb81 100644
--- a/src/activeqt/container/qaxbase.cpp
+++ b/src/activeqt/container/qaxbase.cpp
@@ -421,7 +421,7 @@ public:
argv[p + 1] = varp + p + 1;
} else {
argv[p + 1] = const_cast<void*>(varp[p + 1].constData());
- if (ptype.endsWith("*")) {
+ if (ptype.endsWith('*')) {
argv_pointer[p + 1] = argv[p + 1];
argv[p + 1] = argv_pointer + p + 1;
}
@@ -648,7 +648,7 @@ QByteArray QAxEventSink::findProperty(DISPID dispID)
int index = mo->indexOfProperty(propname);
const QMetaProperty prop = mo->property(index);
propsignal += prop.typeName();
- propsignal += ")";
+ propsignal += ')';
addProperty(dispID, propname, propsignal);
return propname;
@@ -1660,11 +1660,15 @@ private:
QMap<QByteArray, Property> property_list;
void addProperty(const QByteArray &type, const QByteArray &name, uint flags)
{
+ QByteArray propertyType(type);
+ if (propertyType.endsWith('&'))
+ propertyType.chop(1);
+
Property &prop = property_list[name];
- if (!type.isEmpty() && type != "HRESULT") {
- prop.type = replaceType(type);
- if (prop.type != type)
- prop.realType = type;
+ if (!propertyType.isEmpty() && propertyType != "HRESULT") {
+ prop.type = replaceType(propertyType);
+ if (prop.type != propertyType)
+ prop.realType = propertyType;
}
if (flags & Writable)
flags |= Stored;
@@ -2042,11 +2046,11 @@ QByteArray MetaObjectGenerator::guessTypes(const TYPEDESC &tdesc, ITypeInfo *inf
case VT_INT:
case VT_UINT:
case VT_CY:
- str += "&";
+ str += '&';
break;
case VT_PTR:
if (str == "QFont" || str == "QPixmap") {
- str += "&";
+ str += '&';
break;
} else if (str == "void*") {
str = "void **";
@@ -2055,19 +2059,19 @@ QByteArray MetaObjectGenerator::guessTypes(const TYPEDESC &tdesc, ITypeInfo *inf
// FALLTHROUGH
default:
if (str == "QColor")
- str += "&";
+ str += '&';
else if (str == "QDateTime")
- str += "&";
+ str += '&';
else if (str == "QVariantList")
- str += "&";
+ str += '&';
else if (str == "QByteArray")
- str += "&";
+ str += '&';
else if (str == "QStringList")
- str += "&";
+ str += '&';
else if (!str.isEmpty() && hasEnum(str))
- str += "&";
+ str += '&';
else if (!str.isEmpty() && str != "QFont" && str != "QPixmap" && str != "QVariant")
- str += "*";
+ str += '*';
}
break;
case VT_SAFEARRAY:
@@ -2085,7 +2089,7 @@ QByteArray MetaObjectGenerator::guessTypes(const TYPEDESC &tdesc, ITypeInfo *inf
default:
str = guessTypes(tdesc.lpadesc->tdescElem, info, function);
if (!str.isEmpty())
- str = "QList<" + str + ">";
+ str = "QList<" + str + '>';
break;
}
break;
@@ -2093,7 +2097,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:
@@ -2110,7 +2114,7 @@ QByteArray MetaObjectGenerator::guessTypes(const TYPEDESC &tdesc, ITypeInfo *inf
}
if (tdesc.vt & VT_BYREF)
- str += "&";
+ str += '&';
str.replace("&*", "**");
return str;
@@ -2137,7 +2141,7 @@ void MetaObjectGenerator::readClassInfo()
if (d->useClassInfo && !hasClassInfo("CoClass")) {
QString coClassIDstr = iidnames.value(QLatin1String("/CLSID/") + coClassID + QLatin1String("/Default"), coClassID).toString();
addClassInfo("CoClass", coClassIDstr.isEmpty() ? coClassID.toLatin1() : coClassIDstr.toLatin1());
- QByteArray version = QByteArray::number(typeattr->wMajorVerNum) + "." + QByteArray::number(typeattr->wMinorVerNum);
+ QByteArray version = QByteArray::number(typeattr->wMajorVerNum) + '.' + QByteArray::number(typeattr->wMinorVerNum);
if (version != "0.0")
addClassInfo("Version", version);
}
@@ -2170,7 +2174,7 @@ void MetaObjectGenerator::readClassInfo()
while (tlfile.isEmpty() && vit != versions.end()) {
QString version = *vit;
++vit;
- tlfile = controls.value(QLatin1String("/") + version + QLatin1String("/0/win32/.")).toString();
+ tlfile = controls.value(QLatin1Char('/') + version + QLatin1String("/0/win32/.")).toString();
}
controls.endGroup();
} else {
@@ -2343,7 +2347,7 @@ void MetaObjectGenerator::addChangedSignal(const QByteArray &function, const QBy
// generate changed signal
QByteArray signalName(function);
signalName += "Changed";
- QByteArray signalProto = signalName + "(" + replaceType(type) + ")";
+ QByteArray signalProto = signalName + '(' + replaceType(type) + ')';
if (!hasSignal(signalProto))
addSignal(signalProto, function);
if (eventSink)
@@ -2360,7 +2364,7 @@ void MetaObjectGenerator::addSetterSlot(const QByteArray &property)
set = "set";
prototype[0] = toupper(prototype[0]);
}
- prototype = set + prototype + "(" + propertyType(property) + ")";
+ prototype = set + prototype + '(' + propertyType(property) + ')';
if (!hasSlot(prototype))
addSlot(0, prototype, property);
}
@@ -2377,7 +2381,7 @@ QByteArray MetaObjectGenerator::createPrototype(FUNCDESC *funcdesc, ITypeInfo *t
type = guessTypes(funcdesc->lprgelemdescParam->tdesc, typeinfo, function);
}
- prototype = function + "(";
+ prototype = function + '(';
if (funcdesc->invkind == INVOKE_FUNC && type == hresult)
type = 0;
@@ -2391,7 +2395,7 @@ QByteArray MetaObjectGenerator::createPrototype(FUNCDESC *funcdesc, ITypeInfo *t
QByteArray ptype = guessTypes(tdesc, typeinfo, function);
if (pdesc.wParamFlags & PARAMFLAG_FRETVAL) {
- if (ptype.endsWith("&")) {
+ if (ptype.endsWith('&')) {
ptype.truncate(ptype.length() - 1);
} else if (ptype.endsWith("**")) {
ptype.truncate(ptype.length() - 1);
@@ -2399,8 +2403,8 @@ QByteArray MetaObjectGenerator::createPrototype(FUNCDESC *funcdesc, ITypeInfo *t
type = ptype;
} else {
prototype += ptype;
- if (pdesc.wParamFlags & PARAMFLAG_FOUT && !ptype.endsWith("&") && !ptype.endsWith("**"))
- prototype += "&";
+ if (pdesc.wParamFlags & PARAMFLAG_FOUT && !ptype.endsWith('&') && !ptype.endsWith("**"))
+ prototype += '&';
if (optional || pdesc.wParamFlags & PARAMFLAG_FOPT)
paramName += "=0";
else if (pdesc.wParamFlags & PARAMFLAG_FHASDEFAULT) {
@@ -2410,22 +2414,22 @@ QByteArray MetaObjectGenerator::createPrototype(FUNCDESC *funcdesc, ITypeInfo *t
parameters << paramName;
}
if (p < funcdesc->cParams && !(pdesc.wParamFlags & PARAMFLAG_FRETVAL))
- prototype += ",";
+ prototype += ',';
}
if (!prototype.isEmpty()) {
- if (prototype.right(1) == ",") {
+ if (prototype.endsWith(',')) {
if (funcdesc->invkind == INVOKE_PROPERTYPUT && p == funcdesc->cParams) {
TYPEDESC tdesc = funcdesc->lprgelemdescParam[p-1].tdesc;
QByteArray ptype = guessTypes(tdesc, typeinfo, function);
prototype += ptype;
- prototype += ")";
+ prototype += ')';
parameters << "rhs";
} else {
prototype[prototype.length()-1] = ')';
}
} else {
- prototype += ")";
+ prototype += ')';
}
}
@@ -2573,11 +2577,11 @@ void MetaObjectGenerator::readFuncsInfo(ITypeInfo *typeinfo, ushort nFuncs)
if (defargs) {
parameters.takeLast();
- int lastParam = prototype.lastIndexOf(",");
+ int lastParam = prototype.lastIndexOf(',');
if (lastParam == -1)
- lastParam = prototype.indexOf("(") + 1;
+ lastParam = prototype.indexOf('(') + 1;
prototype.truncate(lastParam);
- prototype += ")";
+ prototype += ')';
}
} while (defargs);
}
@@ -2593,8 +2597,8 @@ void MetaObjectGenerator::readFuncsInfo(ITypeInfo *typeinfo, ushort nFuncs)
QString strDocu = QString::fromUtf16((const ushort*)bstrDocu);
SysFreeString(bstrDocu);
if (!!strDocu)
- desc += "[" + strDocu + "]";
- desc += "\n";
+ desc += '[' + strDocu + ']';
+ desc += '\n';
#endif
typeinfo->ReleaseFuncDesc(funcdesc);
}
@@ -2676,8 +2680,8 @@ void MetaObjectGenerator::readVarsInfo(ITypeInfo *typeinfo, ushort nVars)
QString strDocu = QString::fromUtf16((const ushort*)bstrDocu);
SysFreeString(bstrDocu);
if (!!strDocu)
- desc += "[" + strDocu + "]";
- desc += "\n";
+ desc += '[' + strDocu + ']';
+ desc += '\n';
#endif
typeinfo->ReleaseVarDesc(vardesc);
}
@@ -2823,8 +2827,8 @@ void MetaObjectGenerator::readEventInterface(ITypeInfo *eventinfo, IConnectionPo
QString strDocu = QString::fromUtf16((const ushort*)bstrDocu);
SysFreeString(bstrDocu);
if (!!strDocu)
- desc += "[" + strDocu + "]";
- desc += "\n";
+ desc += '[' + strDocu + ']';
+ desc += '\n';
#endif
eventinfo->ReleaseFuncDesc(funcdesc);
}
@@ -4394,8 +4398,8 @@ QVariant QAxBase::asVariant() const
cn = cn.mid(cn.lastIndexOf(':') + 1);
QObject *object = qObject();
if (QMetaType::type(cn))
- qvar = QVariant(qRegisterMetaType<QObject*>(cn + "*"), &object);
-// qVariantSetValue(qvar, qObject(), cn + "*");
+ qvar = QVariant(qRegisterMetaType<QObject*>(cn + '*'), &object);
+// qVariantSetValue(qvar, qObject(), cn + '*');
}
return qvar;
diff --git a/src/activeqt/container/qaxdump.cpp b/src/activeqt/container/qaxdump.cpp
index 62ef0a4..c3218a9 100644
--- a/src/activeqt/container/qaxdump.cpp
+++ b/src/activeqt/container/qaxdump.cpp
@@ -94,14 +94,14 @@ static QByteArray namedPrototype(const QList<QByteArray> &parameterTypes, const
prototype += type;
if (p < parameterNames.count())
- prototype += " " + parameterNames.at(p);
+ prototype += ' ' + parameterNames.at(p);
if (numDefArgs >= parameterTypes.count() - p)
prototype += " = 0";
if (p < parameterTypes.count() - 1)
prototype += ", ";
}
- prototype += ")";
+ prototype += ')';
return prototype;
}
@@ -196,8 +196,8 @@ QString qax_generateDocumentation(QAxBase *that)
prototype = namedPrototype(slot.parameterTypes(), slot.parameterNames());
QString detail = QString::fromLatin1("<h3><a name=") + QString::fromLatin1(name.constData()) + QLatin1String("></a>") +
- QString::fromLatin1(returntype.constData()) + QLatin1String(" ") +
- QString::fromLatin1(name.constData()) + QLatin1String(" ") +
+ QLatin1String(returntype.constData()) + QLatin1Char(' ') +
+ QLatin1String(name.constData()) + QLatin1Char(' ') +
QString::fromLatin1(prototype.constData()) + QLatin1String("<tt> [slot]</tt></h3>\n");
prototype = namedPrototype(slot.parameterTypes(), QList<QByteArray>());
detail += docuFromName(typeInfo, QString::fromLatin1(name.constData()));
@@ -220,14 +220,14 @@ QString qax_generateDocumentation(QAxBase *that)
returntype = "QAxObject *";
}
if (returntype != "void")
- detail += QString::fromLatin1(returntype.constData()) + QLatin1String(" result = ");
- detail += QLatin1String("object->") + QString::fromLatin1(functionToCall.constData()) +
- QLatin1String("(\"" + name + prototype + "\"");
+ detail += QLatin1String(returntype.constData()) + QLatin1String(" result = ");
+ detail += QLatin1String("object->") + QLatin1String(functionToCall.constData()) +
+ QLatin1String("(\"" + name + prototype + '\"');
if (hasParams)
detail += QLatin1String(", params");
- detail += QLatin1String(")");
+ detail += QLatin1Char(')');
if (returntype != "void" && returntype != "QAxObject *" && returntype != "QVariant")
- detail += QLatin1String(".") + QString::fromLatin1(toType(returntype));
+ detail += QLatin1Char('.') + QLatin1String(toType(returntype));
detail += QLatin1String(";</pre>\n");
} else {
detail += QLatin1String("<p>This function has parameters of unsupported types and cannot be called directly.");
@@ -262,9 +262,9 @@ QString qax_generateDocumentation(QAxBase *that)
QByteArray name = signature.left(signature.indexOf('('));
stream << "<li>void <a href=\"#" << name << "\"><b>" << name << "</b></a>" << prototype << ";</li>" << endl;
- QString detail = QLatin1String("<h3><a name=") + QString::fromLatin1(name.constData()) + QLatin1String("></a>void ") +
- QString::fromLatin1(name.constData()) + QLatin1String(" ") +
- QString::fromLatin1(prototype.constData()) + QLatin1String("<tt> [signal]</tt></h3>\n");
+ QString detail = QLatin1String("<h3><a name=") + QLatin1String(name.constData()) + QLatin1String("></a>void ") +
+ QLatin1String(name.constData()) + QLatin1Char(' ') +
+ QLatin1String(prototype.constData()) + QLatin1String("<tt> [signal]</tt></h3>\n");
if (typeLib) {
interCount = 0;
do {
@@ -311,8 +311,8 @@ QString qax_generateDocumentation(QAxBase *that)
stream << "<li>" << type << " <a href=\"#" << name << "\"><b>" << name << "</b></a>;</li>" << endl;
QString detail = QLatin1String("<h3><a name=") + QString::fromLatin1(name.constData()) + QLatin1String("></a>") +
- QString::fromLatin1(type.constData()) +
- QLatin1String(" ") + QString::fromLatin1(name.constData()) + QLatin1String("</h3>\n");
+ QLatin1String(type.constData()) +
+ QLatin1Char(' ') + QLatin1String(name.constData()) + QLatin1String("</h3>\n");
detail += docuFromName(typeInfo, QString::fromLatin1(name));
QVariant::Type vartype = QVariant::nameToType(type);
if (!prop.isReadable())
@@ -326,14 +326,14 @@ QString qax_generateDocumentation(QAxBase *that)
if (prop.isEnumType())
detail += QLatin1String("\tint val = ");
else
- detail += QLatin1String("\t") + QString::fromLatin1(type.constData()) + QLatin1String(" val = ");
- detail += QLatin1String("object->property(\"") + QString::fromLatin1(name.constData()) +
- QLatin1String("\").") + QString::fromLatin1(toType(type).constData()) + QLatin1String(";\n");
+ detail += QLatin1Char('\t') + QLatin1String(type.constData()) + QLatin1String(" val = ");
+ detail += QLatin1String("object->property(\"") + QLatin1String(name.constData()) +
+ QLatin1String("\").") + QLatin1String(toType(type).constData()) + QLatin1String(";\n");
detail += QLatin1String("</pre>\n");
} else if (type == "IDispatch*" || type == "IUnknown*") {
detail += QLatin1String("<p>Get the subobject using querySubObject:<pre>\n");
- detail += QLatin1String("\tQAxObject *") + QString::fromLatin1(name.constData()) +
- QLatin1String(" = object->querySubObject(\"") + QString::fromLatin1(name.constData()) + QLatin1String("\");\n");
+ detail += QLatin1String("\tQAxObject *") + QLatin1String(name.constData()) +
+ QLatin1String(" = object->querySubObject(\"") + QLatin1String(name.constData()) + QLatin1String("\");\n");
detail += QLatin1String("</pre>\n");
} else {
detail += QLatin1String("<p>This property is of an unsupported type.\n");
diff --git a/src/activeqt/container/qaxscript.cpp b/src/activeqt/container/qaxscript.cpp
index c69fea0..8f8186a 100644
--- a/src/activeqt/container/qaxscript.cpp
+++ b/src/activeqt/container/qaxscript.cpp
@@ -1203,9 +1203,9 @@ QString QAxScriptManager::scriptFileFilter()
continue;
allFiles += QLatin1String(" *") + engine.extension;
- specialFiles += QLatin1String(";;") + engine.name + QLatin1String(" Files (*") + engine.extension + QLatin1String(")");
+ specialFiles += QLatin1String(";;") + engine.name + QLatin1String(" Files (*") + engine.extension + QLatin1Char(')');
}
- allFiles += QLatin1String(")");
+ allFiles += QLatin1Char(')');
return allFiles + specialFiles + QLatin1String(";;All Files (*.*)");
}
diff --git a/src/activeqt/container/qaxwidget.cpp b/src/activeqt/container/qaxwidget.cpp
index 4e8473f..7f20a5c 100644
--- a/src/activeqt/container/qaxwidget.cpp
+++ b/src/activeqt/container/qaxwidget.cpp
@@ -383,7 +383,7 @@ public:
bool eventTranslated : 1;
private:
-#if !defined(Q_OS_WINCE)
+#if !defined(Q_WS_WINCE)
struct OleMenuItem {
OleMenuItem(HMENU hm = 0, int ID = 0, QMenu *menu = 0)
: hMenu(hm), id(ID), subMenu(menu)
@@ -408,7 +408,7 @@ private:
bool canHostDocument : 1;
DWORD m_dwOleObject;
-#if !defined(Q_OS_WINCE)
+#if !defined(Q_WS_WINCE)
HWND m_menuOwner;
#endif
CONTROLINFO control_info;
@@ -417,7 +417,7 @@ private:
unsigned long ref;
QAxWidget *widget;
QAxHostWidget *host;
-#if !defined(Q_OS_WINCE)
+#if !defined(Q_WS_WINCE)
QPointer<QMenuBar> menuBar;
QMap<QAction*,OleMenuItem> menuItemMap;
#endif
@@ -467,7 +467,7 @@ static QAbstractEventDispatcher::EventFilter previous_filter = 0;
#if QT_VERSION >= 0x050000
#error "Fix QAbstractEventDispatcher::setEventFilter"
#endif
-#if defined(Q_OS_WINCE)
+#if defined(Q_WS_WINCE)
static int filter_ref = 0;
#else
static const char *qaxatom = "QAxContainer4_Atom";
@@ -551,7 +551,7 @@ QAxClientSite::QAxClientSite(QAxWidget *c)
canHostDocument = false;
m_dwOleObject = 0;
-#if !defined(Q_OS_WINCE)
+#if !defined(Q_WS_WINCE)
m_menuOwner = 0;
menuBar = 0;
#endif
@@ -1132,7 +1132,7 @@ HRESULT WINAPI QAxClientSite::OnPosRectChange(LPCRECT /*lprcPosRect*/)
}
//**** IOleInPlaceFrame
-#if defined(Q_OS_WINCE)
+#if defined(Q_WS_WINCE)
HRESULT WINAPI QAxClientSite::InsertMenus(HMENU /*hmenuShared*/, LPOLEMENUGROUPWIDTHS /*lpMenuWidths*/)
{
return E_NOTIMPL;