diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-07-31 17:12:02 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-12-19 21:33:44 +0100 |
commit | e3c06beffd3ccf59c5266dd2c9620c499561e26f (patch) | |
tree | a7f3c2d16d50540a25e2a899ce33316e43beb68c | |
parent | c6957f36e5581b8f21d5c870235ce759f595a5bb (diff) |
Fix Qt6 build
Change-Id: Iaaa644cfe6777b0ffbe3fb5850fb58b323715fd2
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
(cherry picked from commit 62ed66bce6e6602d82f9474a8589a7dabd7bc9ca)
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
-rw-r--r-- | src/activeqt/container/qaxdump.cpp | 62 | ||||
-rw-r--r-- | src/activeqt/control/qaxserver.cpp | 276 | ||||
-rw-r--r-- | tools/dumpcpp/main.cpp | 436 |
3 files changed, 387 insertions, 387 deletions
diff --git a/src/activeqt/container/qaxdump.cpp b/src/activeqt/container/qaxdump.cpp index 00b7ca2..2313306 100644 --- a/src/activeqt/container/qaxdump.cpp +++ b/src/activeqt/container/qaxdump.cpp @@ -154,36 +154,36 @@ QString qax_generateDocumentation(QAxBase *that) const QMetaObject *mo = that->metaObject(); QString coClass = QLatin1String(mo->classInfo(mo->indexOfClassInfo("CoClass")).value()); - stream << "<h1 align=center>" << coClass << " Reference</h1>" << endl; + stream << "<h1 align=center>" << coClass << " Reference</h1>" << Qt::endl; stream << "<p>The " << coClass << " COM object is a " << that->qObject()->metaObject()->className(); - stream << " with the CLSID " << that->control() << ".</p>" << endl; + stream << " with the CLSID " << that->control() << ".</p>" << Qt::endl; - stream << "<h3>Interfaces</h3>" << endl; - stream << "<ul>" << endl; + stream << "<h3>Interfaces</h3>" << Qt::endl; + stream << "<ul>" << Qt::endl; const char *inter = nullptr; UINT interCount = 1; while ((inter = mo->classInfo(mo->indexOfClassInfo("Interface " + QByteArray::number(interCount))).value())) { - stream << "<li>" << inter << endl; + stream << "<li>" << inter << Qt::endl; interCount++; } - stream << "</ul>" << endl; + stream << "</ul>" << Qt::endl; - stream << "<h3>Event Interfaces</h3>" << endl; - stream << "<ul>" << endl; + stream << "<h3>Event Interfaces</h3>" << Qt::endl; + stream << "<ul>" << Qt::endl; interCount = 1; while ((inter = mo->classInfo(mo->indexOfClassInfo("Event Interface " + QByteArray::number(interCount))).value())) { - stream << "<li>" << inter << endl; + stream << "<li>" << inter << Qt::endl; interCount++; } - stream << "</ul>" << endl; + stream << "</ul>" << Qt::endl; QStringList methodDetails; QStringList propDetails; const int slotCount = mo->methodCount(); if (slotCount) { - stream << "<h2>Public Slots:</h2>" << endl; - stream << "<ul>" << endl; + stream << "<h2>Public Slots:</h2>" << Qt::endl; + stream << "<ul>" << Qt::endl; int defArgCount = 0; for (int islot = mo->methodOffset(); islot < slotCount; ++islot) { @@ -202,7 +202,7 @@ QString qax_generateDocumentation(QAxBase *that) QByteArray prototype = namedPrototype(slot.parameterTypes(), slot.parameterNames(), defArgCount); QByteArray signature = slot.methodSignature(); QByteArray name = signature.left(signature.indexOf('(')); - stream << "<li>" << returntype << " <a href=\"#" << name << "\"><b>" << name << "</b></a>" << prototype << ";</li>" << endl; + stream << "<li>" << returntype << " <a href=\"#" << name << "\"><b>" << name << "</b></a>" << prototype << ";</li>" << Qt::endl; prototype = namedPrototype(slot.parameterTypes(), slot.parameterNames()); QString detail = QString::fromLatin1("<h3><a name=") + QString::fromLatin1(name.constData()) + QLatin1String("></a>") + @@ -243,7 +243,7 @@ QString qax_generateDocumentation(QAxBase *that) defArgCount = 0; } - stream << "</ul>" << endl; + stream << "</ul>" << Qt::endl; } int signalCount = mo->methodCount(); if (signalCount) { @@ -255,8 +255,8 @@ QString qax_generateDocumentation(QAxBase *that) } typeInfo = nullptr; - stream << "<h2>Signals:</h2>" << endl; - stream << "<ul>" << endl; + stream << "<h2>Signals:</h2>" << Qt::endl; + stream << "<ul>" << Qt::endl; for (int isignal = mo->methodOffset(); isignal < signalCount; ++isignal) { const QMetaMethod signal(mo->method(isignal)); @@ -266,7 +266,7 @@ QString qax_generateDocumentation(QAxBase *that) QByteArray prototype = namedPrototype(signal.parameterTypes(), signal.parameterNames()); QByteArray signature = signal.methodSignature(); QByteArray name = signature.left(signature.indexOf('(')); - stream << "<li>void <a href=\"#" << name << "\"><b>" << name << "</b></a>" << prototype << ";</li>" << endl; + stream << "<li>void <a href=\"#" << name << "\"><b>" << name << "</b></a>" << prototype << ";</li>" << Qt::endl; QString detail = QLatin1String("<h3><a name=") + QLatin1String(name.constData()) + QLatin1String("></a>void ") + QLatin1String(name.constData()) + QLatin1Char(' ') + @@ -297,7 +297,7 @@ QString qax_generateDocumentation(QAxBase *that) typeInfo->Release(); typeInfo = nullptr; } - stream << "</ul>" << endl; + stream << "</ul>" << Qt::endl; if (typeLib) typeLib->Release(); @@ -307,15 +307,15 @@ QString qax_generateDocumentation(QAxBase *that) if (propCount) { if (dispatch) dispatch->GetTypeInfo(0, LOCALE_SYSTEM_DEFAULT, &typeInfo); - stream << "<h2>Properties:</h2>" << endl; - stream << "<ul>" << endl; + stream << "<h2>Properties:</h2>" << Qt::endl; + stream << "<ul>" << Qt::endl; for (int iprop = 0; iprop < propCount; ++iprop) { const QMetaProperty prop = mo->property(iprop); QByteArray name(prop.name()); QByteArray type(prop.typeName()); - stream << "<li>" << type << " <a href=\"#" << name << "\"><b>" << name << "</b></a>;</li>" << endl; + stream << "<li>" << type << " <a href=\"#" << name << "\"><b>" << name << "</b></a>;</li>" << Qt::endl; QString detail = QLatin1String("<h3><a name=") + QString::fromLatin1(name.constData()) + QLatin1String("></a>") + QLatin1String(type.constData()) + QLatin1Char(' ') + QLatin1String(name.constData()) + QLatin1String("</h3>\n"); @@ -372,31 +372,31 @@ QString qax_generateDocumentation(QAxBase *that) propDetails << detail; } - stream << "</ul>" << endl; + stream << "</ul>" << Qt::endl; } const int enumCount = mo->enumeratorCount(); if (enumCount) { - stream << "<hr><h2>Member Type Documentation</h2>" << endl; + stream << "<hr><h2>Member Type Documentation</h2>" << Qt::endl; for (int i = 0; i < enumCount; ++i) { const QMetaEnum enumdata = mo->enumerator(i); - stream << "<h3><a name=" << enumdata.name() << "></a>" << enumdata.name() << "</h3>" << endl; - stream << "<ul>" << endl; + stream << "<h3><a name=" << enumdata.name() << "></a>" << enumdata.name() << "</h3>" << Qt::endl; + stream << "<ul>" << Qt::endl; for (int e = 0; e < enumdata.keyCount(); ++e) { - stream << "<li>" << enumdata.key(e) << "\t=" << enumdata.value(e) << "</li>" << endl; + stream << "<li>" << enumdata.key(e) << "\t=" << enumdata.value(e) << "</li>" << Qt::endl; } - stream << "</ul>" << endl; + stream << "</ul>" << Qt::endl; } } if (methodDetails.count()) { - stream << "<hr><h2>Member Function Documentation</h2>" << endl; + stream << "<hr><h2>Member Function Documentation</h2>" << Qt::endl; for (int i = 0; i < methodDetails.count(); ++i) - stream << methodDetails.at(i) << endl; + stream << methodDetails.at(i) << Qt::endl; } if (propDetails.count()) { - stream << "<hr><h2>Property Documentation</h2>" << endl; + stream << "<hr><h2>Property Documentation</h2>" << Qt::endl; for (int i = 0; i < propDetails.count(); ++i) - stream << propDetails.at(i) << endl; + stream << propDetails.at(i) << Qt::endl; } if (typeInfo) diff --git a/src/activeqt/control/qaxserver.cpp b/src/activeqt/control/qaxserver.cpp index 3427c02..af6fbb2 100644 --- a/src/activeqt/control/qaxserver.cpp +++ b/src/activeqt/control/qaxserver.cpp @@ -333,7 +333,7 @@ static void UpdateRegistryKeys(bool bRegister, const QString keyPath, QScopedPoi qCDebug(lcAxRegistration).nospace().noquote() << "Registered \"" << progId << "\"/" << classId << ", \"" << file << "\" at \"" << keyPath << "\", insertable=" << insertable << ", control=" << control - << ", olemisc=" << hex << showbase << olemisc + << ", olemisc=" << Qt::hex << Qt::showbase << olemisc << ", mime=" << mime; } @@ -872,7 +872,7 @@ static HRESULT classIDL(QObject *o, const QMetaObject *mo, const QString &classN enums.append(enumerator.name()); - out << "\tenum " << enumerator.name() << " {" << endl; + out << "\tenum " << enumerator.name() << " {" << Qt::endl; for (int j = 0; j < enumerator.keyCount(); ++j) { QByteArray key(enumerator.key(j)); @@ -889,54 +889,54 @@ static HRESULT classIDL(QObject *o, const QMetaObject *mo, const QString &classN out << value; if (j < enumerator.keyCount()-1) out << ", "; - out << endl; + out << Qt::endl; } - out << "\t};" << endl << endl; + out << "\t};" << Qt::endl << Qt::endl; } // mouse cursor enum for QCursor support if (!enums.contains("MousePointer")) { enums.append("MousePointer"); - out << "\tenum MousePointer {" << endl; - out << "\t\tArrowCursor = " << Qt::ArrowCursor << ',' << endl; - out << "\t\tUpArrowCursor = " << Qt::UpArrowCursor << ',' << endl; - out << "\t\tCrossCursor = " << Qt::CrossCursor << ',' << endl; - out << "\t\tWaitCursor = " << Qt::WaitCursor << ',' << endl; - out << "\t\tIBeamCursor = " << Qt::IBeamCursor << ',' << endl; - out << "\t\tSizeVerCursor = " << Qt::SizeVerCursor << ',' << endl; - out << "\t\tSizeHorCursor = " << Qt::SizeHorCursor << ',' << endl; - out << "\t\tSizeBDiagCursor = " << Qt::SizeBDiagCursor << ',' << endl; - out << "\t\tSizeFDiagCursor = " << Qt::SizeFDiagCursor << ',' << endl; - out << "\t\tSizeAllCursor = " << Qt::SizeAllCursor << ',' << endl; - out << "\t\tBlankCursor = " << Qt::BlankCursor << ',' << endl; - out << "\t\tSplitVCursor = " << Qt::SplitVCursor << ',' << endl; - out << "\t\tSplitHCursor = " << Qt::SplitHCursor << ',' << endl; - out << "\t\tPointingHandCursor = " << Qt::PointingHandCursor << ',' << endl; - out << "\t\tForbiddenCursor = " << Qt::ForbiddenCursor << ',' << endl; - out << "\t\tWhatsThisCursor = " << Qt::WhatsThisCursor << ',' << endl; - out << "\t\tBusyCursor\t= " << Qt::BusyCursor << endl; - out << "\t};" << endl << endl; + out << "\tenum MousePointer {" << Qt::endl; + out << "\t\tArrowCursor = " << Qt::ArrowCursor << ',' << Qt::endl; + out << "\t\tUpArrowCursor = " << Qt::UpArrowCursor << ',' << Qt::endl; + out << "\t\tCrossCursor = " << Qt::CrossCursor << ',' << Qt::endl; + out << "\t\tWaitCursor = " << Qt::WaitCursor << ',' << Qt::endl; + out << "\t\tIBeamCursor = " << Qt::IBeamCursor << ',' << Qt::endl; + out << "\t\tSizeVerCursor = " << Qt::SizeVerCursor << ',' << Qt::endl; + out << "\t\tSizeHorCursor = " << Qt::SizeHorCursor << ',' << Qt::endl; + out << "\t\tSizeBDiagCursor = " << Qt::SizeBDiagCursor << ',' << Qt::endl; + out << "\t\tSizeFDiagCursor = " << Qt::SizeFDiagCursor << ',' << Qt::endl; + out << "\t\tSizeAllCursor = " << Qt::SizeAllCursor << ',' << Qt::endl; + out << "\t\tBlankCursor = " << Qt::BlankCursor << ',' << Qt::endl; + out << "\t\tSplitVCursor = " << Qt::SplitVCursor << ',' << Qt::endl; + out << "\t\tSplitHCursor = " << Qt::SplitHCursor << ',' << Qt::endl; + out << "\t\tPointingHandCursor = " << Qt::PointingHandCursor << ',' << Qt::endl; + out << "\t\tForbiddenCursor = " << Qt::ForbiddenCursor << ',' << Qt::endl; + out << "\t\tWhatsThisCursor = " << Qt::WhatsThisCursor << ',' << Qt::endl; + out << "\t\tBusyCursor\t= " << Qt::BusyCursor << Qt::endl; + out << "\t};" << Qt::endl << Qt::endl; } if (!enums.contains("FocusPolicy")) { enums.append("FocusPolicy"); - out << "\tenum FocusPolicy {" << endl; - out << "\t\tNoFocus = " << Qt::NoFocus << ',' << endl; - out << "\t\tTabFocus = " << Qt::TabFocus << ',' << endl; - out << "\t\tClickFocus = " << Qt::ClickFocus << ',' << endl; - out << "\t\tStrongFocus = " << Qt::StrongFocus << ',' << endl; - out << "\t\tWheelFocus = " << Qt::WheelFocus << endl; - out << "\t};" << endl << endl; + out << "\tenum FocusPolicy {" << Qt::endl; + out << "\t\tNoFocus = " << Qt::NoFocus << ',' << Qt::endl; + out << "\t\tTabFocus = " << Qt::TabFocus << ',' << Qt::endl; + out << "\t\tClickFocus = " << Qt::ClickFocus << ',' << Qt::endl; + out << "\t\tStrongFocus = " << Qt::StrongFocus << ',' << Qt::endl; + out << "\t\tWheelFocus = " << Qt::WheelFocus << Qt::endl; + out << "\t};" << Qt::endl << Qt::endl; } - out << endl; - out << "\t[" << endl; - out << "\t\tuuid(" << interfaceID << ")," << endl; - out << "\t\thelpstring(\"" << cleanClassName << " Interface\")" << endl; - out << "\t]" << endl; - out << "\tdispinterface I" << cleanClassName << endl; - out << "\t{" << endl; + out << Qt::endl; + out << "\t[" << Qt::endl; + out << "\t\tuuid(" << interfaceID << ")," << Qt::endl; + out << "\t\thelpstring(\"" << cleanClassName << " Interface\")" << Qt::endl; + out << "\t]" << Qt::endl; + out << "\tdispinterface I" << cleanClassName << Qt::endl; + out << "\t{" << Qt::endl; - out << "\tproperties:" << endl; + out << "\tproperties:" << Qt::endl; for (i = propoff; i < mo->propertyCount(); ++i) { const QMetaProperty property = mo->property(i); /* if (property.testFlags(QMetaProperty::Override)) @@ -951,7 +951,7 @@ static HRESULT classIDL(QObject *o, const QMetaObject *mo, const QString &classN QByteArray name(replaceKeyword(property.name())); if (!ok) - out << "\t/****** Property is of unsupported datatype" << endl; + out << "\t/****** Property is of unsupported datatype" << Qt::endl; out << "\t\t[id(" << id << ')'; if (!property.isWritable()) @@ -964,14 +964,14 @@ static HRESULT classIDL(QObject *o, const QMetaObject *mo, const QString &classN out << ", requestedit"; if (defProp == QLatin1String(name)) out << ", uidefault"; - out << "] " << type << ' ' << name << ';' << endl; + out << "] " << type << ' ' << name << ';' << Qt::endl; if (!ok) - out << "\t******/" << endl; + out << "\t******/" << Qt::endl; ++id; } - out << endl; - out << "\tmethods:" << endl; + out << Qt::endl; + out << "\tmethods:" << Qt::endl; int numDefArgs = 0; QByteArray outBuffer; for (i = methodoff; i < mo->methodCount(); ++i) { @@ -1028,31 +1028,31 @@ static HRESULT classIDL(QObject *o, const QMetaObject *mo, const QString &classN out << outBuffer; outBuffer = QByteArray(); } - out << "\t};" << endl << endl; + out << "\t};" << Qt::endl << Qt::endl; mapping.clear(); id = 1; if (hasEvents) { - out << "\t[" << endl; - out << "\t\tuuid(" << eventsID << ")," << endl; - out << "\t\thelpstring(\"" << cleanClassName << " Events Interface\")" << endl; - out << "\t]" << endl; - out << "\tdispinterface I" << cleanClassName << "Events" << endl; - out << "\t{" << endl; - out << "\tproperties:" << endl; - out << "\tmethods:" << endl; + out << "\t[" << Qt::endl; + out << "\t\tuuid(" << eventsID << ")," << Qt::endl; + out << "\t\thelpstring(\"" << cleanClassName << " Events Interface\")" << Qt::endl; + out << "\t]" << Qt::endl; + out << "\tdispinterface I" << cleanClassName << "Events" << Qt::endl; + out << "\t{" << Qt::endl; + out << "\tproperties:" << Qt::endl; + out << "\tmethods:" << Qt::endl; if (hasStockEvents) { - out << "\t/****** Stock events ******/" << endl; - out << "\t\t[id(DISPID_CLICK)] void Click();" << endl; - out << "\t\t[id(DISPID_DBLCLICK)] void DblClick();" << endl; - out << "\t\t[id(DISPID_KEYDOWN)] void KeyDown(short* KeyCode, short Shift);" << endl; - out << "\t\t[id(DISPID_KEYPRESS)] void KeyPress(short* KeyAscii);" << endl; - out << "\t\t[id(DISPID_KEYUP)] void KeyUp(short* KeyCode, short Shift);" << endl; - out << "\t\t[id(DISPID_MOUSEDOWN)] void MouseDown(short Button, short Shift, OLE_XPOS_PIXELS x, OLE_YPOS_PIXELS y);" << endl; - out << "\t\t[id(DISPID_MOUSEMOVE)] void MouseMove(short Button, short Shift, OLE_XPOS_PIXELS x, OLE_YPOS_PIXELS y);" << endl; - out << "\t\t[id(DISPID_MOUSEUP)] void MouseUp(short Button, short Shift, OLE_XPOS_PIXELS x, OLE_YPOS_PIXELS y);" << endl << endl; + out << "\t/****** Stock events ******/" << Qt::endl; + out << "\t\t[id(DISPID_CLICK)] void Click();" << Qt::endl; + out << "\t\t[id(DISPID_DBLCLICK)] void DblClick();" << Qt::endl; + out << "\t\t[id(DISPID_KEYDOWN)] void KeyDown(short* KeyCode, short Shift);" << Qt::endl; + out << "\t\t[id(DISPID_KEYPRESS)] void KeyPress(short* KeyAscii);" << Qt::endl; + out << "\t\t[id(DISPID_KEYUP)] void KeyUp(short* KeyCode, short Shift);" << Qt::endl; + out << "\t\t[id(DISPID_MOUSEDOWN)] void MouseDown(short Button, short Shift, OLE_XPOS_PIXELS x, OLE_YPOS_PIXELS y);" << Qt::endl; + out << "\t\t[id(DISPID_MOUSEMOVE)] void MouseMove(short Button, short Shift, OLE_XPOS_PIXELS x, OLE_YPOS_PIXELS y);" << Qt::endl; + out << "\t\t[id(DISPID_MOUSEUP)] void MouseUp(short Button, short Shift, OLE_XPOS_PIXELS x, OLE_YPOS_PIXELS y);" << Qt::endl << Qt::endl; } for (i = methodoff; i < mo->methodCount(); ++i) { @@ -1078,52 +1078,52 @@ static HRESULT classIDL(QObject *o, const QMetaObject *mo, const QString &classN QByteArray ptype(prototype(parameterTypes, parameterNames, &ok)); if (!ok) - out << "\t/****** Signal parameter uses unsupported datatype" << endl; + out << "\t/****** Signal parameter uses unsupported datatype" << Qt::endl; out << "\t\t[id(" << id << ')'; if (isDefault) out << ", uidefault"; - out << "] void " << name << '(' << ptype << ");" << endl; + out << "] void " << name << '(' << ptype << ");" << Qt::endl; if (!ok) - out << "\t******/" << endl; + out << "\t******/" << Qt::endl; ++id; } - out << "\t};" << endl << endl; + out << "\t};" << Qt::endl << Qt::endl; } - out << "\t[" << endl; + out << "\t[" << Qt::endl; if (qstricmp(mo->classInfo(mo->indexOfClassInfo("Aggregatable")).value(), "no")) - out << "\t\taggregatable," << endl; + out << "\t\taggregatable," << Qt::endl; if (!qstricmp(mo->classInfo(mo->indexOfClassInfo("RegisterObject")).value(), "yes")) - out << "\t\tappobject," << endl; + out << "\t\tappobject," << Qt::endl; if (mo->classInfo(mo->indexOfClassInfo("LicenseKey")).value()) - out << "\t\tlicensed," << endl; + out << "\t\tlicensed," << Qt::endl; const char *helpString = mo->classInfo(mo->indexOfClassInfo("Description")).value(); if (helpString) - out << "\t\thelpstring(\"" << helpString << "\")," << endl; + out << "\t\thelpstring(\"" << helpString << "\")," << Qt::endl; else - out << "\t\thelpstring(\"" << cleanClassName << " Class\")," << endl; + out << "\t\thelpstring(\"" << cleanClassName << " Class\")," << Qt::endl; const char *classVersion = mo->classInfo(mo->indexOfClassInfo("Version")).value(); if (classVersion) - out << "\t\tversion(" << classVersion << ")," << endl; + out << "\t\tversion(" << classVersion << ")," << Qt::endl; out << "\t\tuuid(" << classID << ')'; if (control) { - out << ", " << endl; + out << ", " << Qt::endl; out << "\t\tcontrol"; } else if (!o) { - out << ", " << endl; + out << ", " << Qt::endl; out << "\t\tnoncreatable"; } - out << endl; - out << "\t]" << endl; - out << "\tcoclass " << cleanClassName << endl; - out << "\t{" << endl; - out << "\t\t[default] dispinterface I" << cleanClassName << ';' << endl; + out << Qt::endl; + out << "\t]" << Qt::endl; + out << "\tcoclass " << cleanClassName << Qt::endl; + out << "\t{" << Qt::endl; + out << "\t\t[default] dispinterface I" << cleanClassName << ';' << Qt::endl; if (hasEvents) - out << "\t\t[default, source] dispinterface I" << cleanClassName << "Events;" << endl; - out << "\t};" << endl; + out << "\t\t[default, source] dispinterface I" << cleanClassName << "Events;" << Qt::endl; + out << "\t};" << Qt::endl; return S_OK; } @@ -1168,18 +1168,18 @@ extern "C" HRESULT __stdcall DumpIDL(const QString &outfile, const QString &ver) const QString idQSize = stripCurlyBraces(QUuid(CLSID_QSize)); const QString idQPoint = stripCurlyBraces(QUuid(CLSID_QPoint)); - out << "/****************************************************************************" << endl; - out << "** Interface definition generated for ActiveQt project" << endl; - out << "**" << endl; - out << "** '" << QString::fromWCharArray(qAxModuleFilename) << '\'' << endl; - out << "**" << endl; - out << "** Created: " << QDateTime::currentDateTime().toString() << endl; - out << "**" << endl; - out << "** WARNING! All changes made in this file will be lost!" << endl; - out << "****************************************************************************/" << endl << endl; + out << "/****************************************************************************" << Qt::endl; + out << "** Interface definition generated for ActiveQt project" << Qt::endl; + out << "**" << Qt::endl; + out << "** '" << QString::fromWCharArray(qAxModuleFilename) << '\'' << Qt::endl; + out << "**" << Qt::endl; + out << "** Created: " << QDateTime::currentDateTime().toString() << Qt::endl; + out << "**" << Qt::endl; + out << "** WARNING! All changes made in this file will be lost!" << Qt::endl; + out << "****************************************************************************/" << Qt::endl << Qt::endl; - out << "import \"ocidl.idl\";" << endl; - out << "#include <olectl.h>" << endl << endl; + out << "import \"ocidl.idl\";" << Qt::endl; + out << "#include <olectl.h>" << Qt::endl << Qt::endl; // dummy application to create widgets bool delete_qApp = false; @@ -1189,59 +1189,59 @@ extern "C" HRESULT __stdcall DumpIDL(const QString &outfile, const QString &ver) delete_qApp = true; } - out << '[' << endl; - out << "\tuuid(" << typeLibID << ")," << endl; - out << "\tversion(" << version << ")," << endl; - out << "\thelpstring(\"" << typelib << ' ' << version << " Type Library\")" << endl; - out << ']' << endl; - out << "library " << typelib << "Lib" << endl; - out << '{' << endl; - out << "\timportlib(\"stdole32.tlb\");" << endl; - out << "\timportlib(\"stdole2.tlb\");" << endl << endl; + out << '[' << Qt::endl; + out << "\tuuid(" << typeLibID << ")," << Qt::endl; + out << "\tversion(" << version << ")," << Qt::endl; + out << "\thelpstring(\"" << typelib << ' ' << version << " Type Library\")" << Qt::endl; + out << ']' << Qt::endl; + out << "library " << typelib << "Lib" << Qt::endl; + out << '{' << Qt::endl; + out << "\timportlib(\"stdole32.tlb\");" << Qt::endl; + out << "\timportlib(\"stdole2.tlb\");" << Qt::endl << Qt::endl; const QStringList keys = qAxFactory()->featureList(); - out << "\t/************************************************************************" << endl; - out << "\t** If this causes a compile error in MIDL you need to upgrade the" << endl; - out << "\t** Platform SDK you are using. Download the SDK from msdn.microsoft.com" << endl; - out << "\t** and make sure that both the system and the Visual Studio environment" << endl; - out << "\t** use the correct files." << endl; - out << "\t**" << endl; + out << "\t/************************************************************************" << Qt::endl; + out << "\t** If this causes a compile error in MIDL you need to upgrade the" << Qt::endl; + out << "\t** Platform SDK you are using. Download the SDK from msdn.microsoft.com" << Qt::endl; + out << "\t** and make sure that both the system and the Visual Studio environment" << Qt::endl; + out << "\t** use the correct files." << Qt::endl; + out << "\t**" << Qt::endl; #if __REQUIRED_RPCNDR_H_VERSION__ < Q_REQUIRED_RPCNDR_H_VERSION - out << "\t** Required version of MIDL could not be verified. QRect, QSize and QPoint" << endl; - out << "\t** support needs an updated Platform SDK to be installed." << endl; - out << "\t*************************************************************************" << endl; + out << "\t** Required version of MIDL could not be verified. QRect, QSize and QPoint" << Qt::endl; + out << "\t** support needs an updated Platform SDK to be installed." << Qt::endl; + out << "\t*************************************************************************" << Qt::endl; #else - out << "\t************************************************************************/" << endl; + out << "\t************************************************************************/" << Qt::endl; #endif - out << endl; - out << "\t[uuid(" << idQRect << ")]" << endl; - out << "\tstruct QRect {" << endl; - out << "\t\tint left;" << endl; - out << "\t\tint top;" << endl; - out << "\t\tint right;" << endl; - out << "\t\tint bottom;" << endl; - out << "\t};" << endl << endl; - - out << "\t[uuid(" << idQSize << ")]" << endl; - out << "\tstruct QSize {" << endl; - out << "\t\tint width;" << endl; - out << "\t\tint height;" << endl; - out << "\t};" << endl << endl; - - out << "\t[uuid(" << idQPoint << ")]" << endl; - out << "\tstruct QPoint {" << endl; - out << "\t\tint x;" << endl; - out << "\t\tint y;" << endl; - out << "\t};" << endl; + out << Qt::endl; + out << "\t[uuid(" << idQRect << ")]" << Qt::endl; + out << "\tstruct QRect {" << Qt::endl; + out << "\t\tint left;" << Qt::endl; + out << "\t\tint top;" << Qt::endl; + out << "\t\tint right;" << Qt::endl; + out << "\t\tint bottom;" << Qt::endl; + out << "\t};" << Qt::endl << Qt::endl; + + out << "\t[uuid(" << idQSize << ")]" << Qt::endl; + out << "\tstruct QSize {" << Qt::endl; + out << "\t\tint width;" << Qt::endl; + out << "\t\tint height;" << Qt::endl; + out << "\t};" << Qt::endl << Qt::endl; + + out << "\t[uuid(" << idQPoint << ")]" << Qt::endl; + out << "\tstruct QPoint {" << Qt::endl; + out << "\t\tint x;" << Qt::endl; + out << "\t\tint y;" << Qt::endl; + out << "\t};" << Qt::endl; #if __REQUIRED_RPCNDR_H_VERSION__ < Q_REQUIRED_RPCNDR_H_VERSION - out << "\t*/" << endl; + out << "\t*/" << Qt::endl; #endif - out << endl; + out << Qt::endl; - out << "\t/* Forward declaration of classes that might be used as parameters */" << endl << endl; + out << "\t/* Forward declaration of classes that might be used as parameters */" << Qt::endl << Qt::endl; int res = S_OK; for (const QString &className : keys) { @@ -1249,7 +1249,7 @@ extern "C" HRESULT __stdcall DumpIDL(const QString &outfile, const QString &ver) // We have meta object information for this type. Forward declare it. if (mo) { QByteArray cleanType = qax_clean_type(className, mo).toLatin1(); - out << "\tcoclass " << cleanType << ';' << endl; + out << "\tcoclass " << cleanType << ';' << Qt::endl; subtypes.append(cleanType); if (!QMetaType::type(cleanType)) qRegisterMetaType<void *>(cleanType); @@ -1259,7 +1259,7 @@ extern "C" HRESULT __stdcall DumpIDL(const QString &outfile, const QString &ver) qRegisterMetaType<void *>(cleanType); } } - out << endl; + out << Qt::endl; for (const QString &className : keys) { const QMetaObject *mo = qAxFactory()->metaObject(className); @@ -1273,7 +1273,7 @@ extern "C" HRESULT __stdcall DumpIDL(const QString &outfile, const QString &ver) } } - out << endl; + out << Qt::endl; if (res != S_OK) goto ErrorInClass; @@ -1294,7 +1294,7 @@ extern "C" HRESULT __stdcall DumpIDL(const QString &outfile, const QString &ver) break; } - out << "};" << endl; + out << "};" << Qt::endl; out.flush(); ErrorInClass: diff --git a/tools/dumpcpp/main.cpp b/tools/dumpcpp/main.cpp index 4ed9aaa..780d41b 100644 --- a/tools/dumpcpp/main.cpp +++ b/tools/dumpcpp/main.cpp @@ -86,42 +86,42 @@ void writeEnums(QTextStream &out, const QMetaObject *mo) // enums for (int ienum = mo->enumeratorOffset(); ienum < mo->enumeratorCount(); ++ienum) { QMetaEnum metaEnum = mo->enumerator(ienum); - out << " enum " << metaEnum.name() << " {" << endl; + out << " enum " << metaEnum.name() << " {" << Qt::endl; for (int k = 0; k < metaEnum.keyCount(); ++k) { QByteArray key(metaEnum.key(k)); out << " " << key.leftJustified(24) << "= " << metaEnum.value(k); if (k < metaEnum.keyCount() - 1) out << ','; - out << endl; + out << Qt::endl; } - out << " };" << endl; - out << endl; + out << " };" << Qt::endl; + out << Qt::endl; } } void writeHeader(QTextStream &out, const QString &nameSpace, const QString &outFileName) { - out << "#ifndef QAX_DUMPCPP_" << outFileName.toUpper() << "_H" << endl; - out << "#define QAX_DUMPCPP_" << outFileName.toUpper() << "_H" << endl; - out << endl; - out << "// Define this symbol to __declspec(dllexport) or __declspec(dllimport)" << endl; - out << "#ifndef " << nameSpace.toUpper() << "_EXPORT" << endl; - out << "#define " << nameSpace.toUpper() << "_EXPORT" << endl; - out << "#endif" << endl; - out << endl; - out << "#include <qaxobject.h>" << endl; - out << "#include <qaxwidget.h>" << endl; - out << "#include <qdatetime.h>" << endl; - out << "#include <qpixmap.h>" << endl; - out << endl; - out << "struct IDispatch;" << endl; - out << endl; + out << "#ifndef QAX_DUMPCPP_" << outFileName.toUpper() << "_H" << Qt::endl; + out << "#define QAX_DUMPCPP_" << outFileName.toUpper() << "_H" << Qt::endl; + out << Qt::endl; + out << "// Define this symbol to __declspec(dllexport) or __declspec(dllimport)" << Qt::endl; + out << "#ifndef " << nameSpace.toUpper() << "_EXPORT" << Qt::endl; + out << "#define " << nameSpace.toUpper() << "_EXPORT" << Qt::endl; + out << "#endif" << Qt::endl; + out << Qt::endl; + out << "#include <qaxobject.h>" << Qt::endl; + out << "#include <qaxwidget.h>" << Qt::endl; + out << "#include <qdatetime.h>" << Qt::endl; + out << "#include <qpixmap.h>" << Qt::endl; + out << Qt::endl; + out << "struct IDispatch;" << Qt::endl; + out << Qt::endl; } void generateNameSpace(QTextStream &out, const QMetaObject *mo, const QByteArray &nameSpace) { - out << "namespace " << nameSpace << " {" << endl; - out << endl; + out << "namespace " << nameSpace << " {" << Qt::endl; + out << Qt::endl; writeEnums(out, mo); // don't close on purpose @@ -189,25 +189,25 @@ static void formatConstructorBody(QTextStream &out, const QByteArray &className, { out << className << "::" << className; formatConstructorSignature(out, category, false); - out << " :" << endl << " "; + out << " :" << Qt::endl << " "; if (category & ActiveX) out << "QAxWidget(parent, f"; else if (category & SubObject) out << "QAxObject(subobject, parent"; else out << "QAxObject(parent"; - out << ')' << endl << '{' << endl; + out << ')' << Qt::endl << '{' << Qt::endl; if (category & SubObject) { - out << " internalRelease();" << endl; + out << " internalRelease();" << Qt::endl; } else if (category & Licensed) { - out << " if (licenseKey.isEmpty())" << endl; - out << " setControl(QStringLiteral(\"" << controlID << "\"));" << endl; - out << " else" << endl; - out << " setControl(QStringLiteral(\"" << controlID << ":\") + licenseKey);" << endl; + out << " if (licenseKey.isEmpty())" << Qt::endl; + out << " setControl(QStringLiteral(\"" << controlID << "\"));" << Qt::endl; + out << " else" << Qt::endl; + out << " setControl(QStringLiteral(\"" << controlID << ":\") + licenseKey);" << Qt::endl; } else { - out << " setControl(QStringLiteral(\"" << controlID << "\"));" << endl; + out << " setControl(QStringLiteral(\"" << controlID << "\"));" << Qt::endl; } - out << '}' << endl << endl; + out << '}' << Qt::endl << Qt::endl; } void generateClassDecl(QTextStream &out, const QMetaObject *mo, @@ -227,12 +227,12 @@ void generateClassDecl(QTextStream &out, const QMetaObject *mo, out << "QAxWidget"; else out << "QAxObject"; - out << endl; + out << Qt::endl; - out << '{' << endl; - out << "public:" << endl << " explicit " << className; + out << '{' << Qt::endl; + out << "public:" << Qt::endl << " explicit " << className; formatConstructorSignature(out, category, true); - out << ';' << endl; + out << ';' << Qt::endl; for (int ci = mo->classInfoOffset(); ci < mo->classInfoCount(); ++ci) { QMetaClassInfo info = mo->classInfo(ci); QByteArray iface_name = info.name(); @@ -241,17 +241,17 @@ void generateClassDecl(QTextStream &out, const QMetaObject *mo, QByteArray iface_class = info.value(); - out << " " << className << '(' << iface_class << " *iface)" << endl; + out << " " << className << '(' << iface_class << " *iface)" << Qt::endl; if (category & ActiveX) - out << " : QAxWidget()" << endl; + out << " : QAxWidget()" << Qt::endl; else - out << " : QAxObject()" << endl; - out << " {" << endl; - out << " initializeFrom(iface);" << endl; - out << " delete iface;" << endl; - out << " }" << endl; - out << endl; + out << " : QAxObject()" << Qt::endl; + out << " {" << Qt::endl; + out << " initializeFrom(iface);" << Qt::endl; + out << " delete iface;" << Qt::endl; + out << " }" << Qt::endl; + out << Qt::endl; } } @@ -261,16 +261,16 @@ void generateClassDecl(QTextStream &out, const QMetaObject *mo, if (nameSpace.isEmpty() && !(category & OnlyInlines)) { for (int ienum = mo->enumeratorOffset(); ienum < mo->enumeratorCount(); ++ienum) { QMetaEnum metaEnum = mo->enumerator(ienum); - out << " enum " << metaEnum.name() << " {" << endl; + out << " enum " << metaEnum.name() << " {" << Qt::endl; for (int k = 0; k < metaEnum.keyCount(); ++k) { QByteArray key(metaEnum.key(k)); out << " " << key.leftJustified(24) << "= " << metaEnum.value(k); if (k < metaEnum.keyCount() - 1) out << ','; - out << endl; + out << Qt::endl; } - out << " };" << endl; - out << endl; + out << " };" << Qt::endl; + out << Qt::endl; } } // QAxBase public virtual functions. @@ -292,13 +292,13 @@ void generateClassDecl(QTextStream &out, const QMetaObject *mo, continue; if (!(category & OnlyInlines)) { - out << indent << "/*" << endl << indent << "Property " << propertyName << endl; + out << indent << "/*" << Qt::endl << indent << "Property " << propertyName << Qt::endl; QString documentation = qax_docuFromName(currentTypeInfo, QString::fromLatin1(propertyName.constData())); if (!documentation.isEmpty()) { - out << endl; - out << indent << documentation << endl; + out << Qt::endl; + out << indent << documentation << Qt::endl; } - out << indent << "*/" << endl; + out << indent << "*/" << Qt::endl; } // Check whether the new function conflicts with any of QAxBase public virtual functions. @@ -331,36 +331,36 @@ void generateClassDecl(QTextStream &out, const QMetaObject *mo, out << propertyFunctionName << "() const"; if (!(category & NoInlines)) { - out << endl << indent << '{' << endl; + out << Qt::endl << indent << '{' << Qt::endl; if (qax_qualified_usertypes.contains(simplePropType)) { if (foreignNamespace) - out << "#ifdef QAX_DUMPCPP_" << propertyType.left(propertyType.indexOf("::")).toUpper() << "_H" << endl; - out << indent << " " << propertyType << " qax_pointer = 0;" << endl; + out << "#ifdef QAX_DUMPCPP_" << propertyType.left(propertyType.indexOf("::")).toUpper() << "_H" << Qt::endl; + out << indent << " " << propertyType << " qax_pointer = 0;" << Qt::endl; QByteArray simplePropTypeWithNamespace = propertyType; simplePropTypeWithNamespace.replace('*', ""); - out << indent << " qRegisterMetaType<" << propertyType << ">(\"" << property.typeName() << "\", &qax_pointer);" << endl; - out << indent << " qRegisterMetaType<" << simplePropTypeWithNamespace << ">(\"" << simplePropType << "\", qax_pointer);" << endl; + out << indent << " qRegisterMetaType<" << propertyType << ">(\"" << property.typeName() << "\", &qax_pointer);" << Qt::endl; + out << indent << " qRegisterMetaType<" << simplePropTypeWithNamespace << ">(\"" << simplePropType << "\", qax_pointer);" << Qt::endl; } - out << indent << " QVariant qax_result = property(\"" << propertyName << "\");" << endl; + out << indent << " QVariant qax_result = property(\"" << propertyName << "\");" << Qt::endl; if (propertyType.length() && propertyType.at(propertyType.length()-1) == '*') - out << indent << " if (!qax_result.constData()) return 0;" << endl; - out << indent << " Q_ASSERT(qax_result.isValid());" << endl; + out << indent << " if (!qax_result.constData()) return 0;" << Qt::endl; + out << indent << " Q_ASSERT(qax_result.isValid());" << Qt::endl; if (qax_qualified_usertypes.contains(simplePropType)) { simplePropType = propertyType; simplePropType.replace('*', ""); - out << indent << " return *(" << propertyType << "*)qax_result.constData();" << endl; + out << indent << " return *(" << propertyType << "*)qax_result.constData();" << Qt::endl; if (foreignNamespace) { - out << "#else" << endl; - out << indent << " return 0; // foreign namespace not included" << endl; - out << "#endif" << endl; + out << "#else" << Qt::endl; + out << indent << " return 0; // foreign namespace not included" << Qt::endl; + out << "#endif" << Qt::endl; } } else { - out << indent << " return *(" << propertyType << "*)qax_result.constData();" << endl; + out << indent << " return *(" << propertyType << "*)qax_result.constData();" << Qt::endl; } - out << indent << '}' << endl; + out << indent << '}' << Qt::endl; } else { - out << "; //Returns the value of " << propertyName << endl; + out << "; //Returns the value of " << propertyName << Qt::endl; } functions << propertyName; @@ -381,21 +381,21 @@ void generateClassDecl(QTextStream &out, const QMetaObject *mo, if (!(category & NoInlines)) { if (propertyType.endsWith('*')) { - out << '{' << endl; - out << " int typeId = qRegisterMetaType<" << propertyType << ">(\"" << propertyType << "\", &value);" << endl; - out << " setProperty(\"" << propertyName << "\", QVariant(typeId, &value));" << endl; - out << '}' << endl; + out << '{' << Qt::endl; + out << " int typeId = qRegisterMetaType<" << propertyType << ">(\"" << propertyType << "\", &value);" << Qt::endl; + out << " setProperty(\"" << propertyName << "\", QVariant(typeId, &value));" << Qt::endl; + out << '}' << Qt::endl; } else { - out << "{ setProperty(\"" << propertyName << "\", QVariant(value)); }" << endl; + out << "{ setProperty(\"" << propertyName << "\", QVariant(value)); }" << Qt::endl; } } else { - out << "; //Sets the value of the " << propertyName << " property" << endl; + out << "; //Sets the value of the " << propertyName << " property" << Qt::endl; } functions << setter; } - out << endl; + out << Qt::endl; } // slots - but not property setters @@ -419,13 +419,13 @@ void generateClassDecl(QTextStream &out, const QMetaObject *mo, continue; if (!(category & OnlyInlines)) { - out << indent << "/*" << endl << indent << "Method " << slotName << endl; + out << indent << "/*" << Qt::endl << indent << "Method " << slotName << Qt::endl; QString documentation = qax_docuFromName(currentTypeInfo, QString::fromLatin1(slotName.constData())); if (!documentation.isEmpty()) { - out << endl; - out << indent << documentation << endl; + out << Qt::endl; + out << indent << documentation << Qt::endl; } - out << indent << "*/" << endl; + out << indent << "*/" << Qt::endl; } QByteArray slotParameters(joinParameterNames(slot.parameterNames())); @@ -502,27 +502,27 @@ void generateClassDecl(QTextStream &out, const QMetaObject *mo, out << slotNamedSignature; if (category & NoInlines) { - out << ';' << endl; + out << ';' << Qt::endl; } else { - out << endl; - out << indent << '{' << endl; + out << Qt::endl; + out << indent << '{' << Qt::endl; if (slotType != QByteArrayLiteral("void")) { out << indent << " " << slotType << " qax_result"; if (slotType.endsWith('*')) out << " = 0"; - out << ';' << endl; + out << ';' << Qt::endl; if (qax_qualified_usertypes.contains(simpleSlotType)) { bool foreignNamespace = simpleSlotType.contains("::"); if (foreignNamespace) - out << "#ifdef QAX_DUMPCPP_" << simpleSlotType.left(simpleSlotType.indexOf(':')).toUpper() << "_H" << endl; + out << "#ifdef QAX_DUMPCPP_" << simpleSlotType.left(simpleSlotType.indexOf(':')).toUpper() << "_H" << Qt::endl; QByteArray simpleSlotTypeWithNamespace = slotType; simpleSlotTypeWithNamespace.replace('*', ""); - out << indent << " qRegisterMetaType<" << simpleSlotTypeWithNamespace << "*>(\"" << simpleSlotType << "*\", &qax_result);" << endl; + out << indent << " qRegisterMetaType<" << simpleSlotTypeWithNamespace << "*>(\"" << simpleSlotType << "*\", &qax_result);" << Qt::endl; if (!vTableOnlyStubs.contains(simpleSlotTypeWithNamespace)) - out << indent << " qRegisterMetaType<" << simpleSlotTypeWithNamespace << ">(\"" << simpleSlotType << "\", qax_result);" << endl; + out << indent << " qRegisterMetaType<" << simpleSlotTypeWithNamespace << ">(\"" << simpleSlotType << "\", qax_result);" << Qt::endl; if (foreignNamespace) - out << "#endif" << endl; + out << "#endif" << Qt::endl; } } out << indent << " void *_a[] = {"; @@ -534,27 +534,27 @@ void generateClassDecl(QTextStream &out, const QMetaObject *mo, out << ", (void*)&"; out << slotParameters.replace(",", ", (void*)&"); } - out << "};" << endl; + out << "};" << Qt::endl; - out << indent << " qt_metacall(QMetaObject::InvokeMetaMethod, " << islot << ", _a);" << endl; + out << indent << " qt_metacall(QMetaObject::InvokeMetaMethod, " << islot << ", _a);" << Qt::endl; if (slotType != QByteArrayLiteral("void")) - out << indent << " return qax_result;" << endl; - out << indent << '}' << endl; + out << indent << " return qax_result;" << Qt::endl; + out << indent << '}' << Qt::endl; } - out << endl; + out << Qt::endl; defaultArguments = 0; } if (!(category & OnlyInlines)) { if (!(category & NoMetaObject)) { - out << "// meta object functions" << endl; - out << " static const QMetaObject staticMetaObject;" << endl; - out << " const QMetaObject *metaObject() const override { return &staticMetaObject; }" << endl; - out << " void *qt_metacast(const char *) override;" << endl; + out << "// meta object functions" << Qt::endl; + out << " static const QMetaObject staticMetaObject;" << Qt::endl; + out << " const QMetaObject *metaObject() const override { return &staticMetaObject; }" << Qt::endl; + out << " void *qt_metacast(const char *) override;" << Qt::endl; } - out << "};" << endl; + out << "};" << Qt::endl; } } @@ -658,7 +658,7 @@ void generateMethods(QTextStream &out, const QMetaObject *mo, const QMetaMethod: out << "slot"; funcTypeFlag = MethodSlot; } - out << ": name, argc, parameters, tag, flags" << endl; + out << ": name, argc, parameters, tag, flags" << Qt::endl; int methodCount = mo->methodCount(); for (int i = mo->methodOffset(); i < methodCount; ++i) { @@ -670,10 +670,10 @@ void generateMethods(QTextStream &out, const QMetaObject *mo, const QMetaMethod: out << method.parameterCount() << ", "; out << paramsIndex << ", "; addStringIdx(method.tag()); - out << (AccessProtected | method.attributes() | funcTypeFlag) << ',' << endl; + out << (AccessProtected | method.attributes() | funcTypeFlag) << ',' << Qt::endl; paramsIndex += 1 + method.parameterCount() * 2; } - out << endl; + out << Qt::endl; } void generateMethodParameters(QTextStream &out, const QMetaObject *mo, const QMetaMethod::MethodType funcType) @@ -683,7 +683,7 @@ void generateMethodParameters(QTextStream &out, const QMetaObject *mo, const QMe out << "signal"; else if (funcType == QMetaMethod::Slot) out << "slot"; - out << ": parameters" << endl; + out << ": parameters" << Qt::endl; int methodCount = mo->methodCount(); for (int i = mo->methodOffset(); i < methodCount; ++i) { @@ -712,9 +712,9 @@ void generateMethodParameters(QTextStream &out, const QMetaObject *mo, const QMe for (int j = 0; j < argsCount; ++j) out << ' ' << stridx(parameterNames.at(j)) << ','; - out << endl; + out << Qt::endl; } - out << endl; + out << Qt::endl; } void generateClassImpl(QTextStream &out, const QMetaObject *mo, const QByteArray &className, @@ -789,38 +789,38 @@ void generateClassImpl(QTextStream &out, const QMetaObject *mo, const QByteArray } // Build data array - out << "static const uint qt_meta_data_" << qualifiedClassNameIdentifier << "[] = {" << endl; - out << endl; - out << " // content:" << endl; - out << " 7, // revision" << endl; + out << "static const uint qt_meta_data_" << qualifiedClassNameIdentifier << "[] = {" << Qt::endl; + out << Qt::endl; + out << " // content:" << Qt::endl; + out << " 7, // revision" << Qt::endl; out << " "; addStringIdx(qualifiedClassName); - out << " // classname" << endl; - out << " " << thisClassInfoCount << ", " << (thisClassInfoCount ? enumStart : 0) << ", // classinfo" << endl; + out << " // classname" << Qt::endl; + out << " " << thisClassInfoCount << ", " << (thisClassInfoCount ? enumStart : 0) << ", // classinfo" << Qt::endl; enumStart += thisClassInfoCount * 2; - out << " " << thisMethodCount << ", " << (thisMethodCount ? enumStart : 0) << ", // methods" << endl; + out << " " << thisMethodCount << ", " << (thisMethodCount ? enumStart : 0) << ", // methods" << Qt::endl; enumStart += thisMethodCount * 5; int paramsIndex = enumStart; enumStart += (combinedParameterCount * 2); // parameter types + names enumStart += thisMethodCount; // return types - out << " " << thisPropertyCount << ", " << (thisPropertyCount ? enumStart : 0) << ", // properties" << endl; + out << " " << thisPropertyCount << ", " << (thisPropertyCount ? enumStart : 0) << ", // properties" << Qt::endl; enumStart += thisPropertyCount * 3; - out << " " << thisEnumCount << ", " << (thisEnumCount ? enumStart : 0) << ", // enums/sets" << endl; - out << " 0, 0, // constructors" << endl; - out << " 0, // flags" << endl; - out << " " << signalCount << ", // signal count" << endl; - out << endl; + out << " " << thisEnumCount << ", " << (thisEnumCount ? enumStart : 0) << ", // enums/sets" << Qt::endl; + out << " 0, 0, // constructors" << Qt::endl; + out << " 0, // flags" << Qt::endl; + out << " " << signalCount << ", // signal count" << Qt::endl; + out << Qt::endl; if (thisClassInfoCount) { - out << " // classinfo: key, value" << endl; + out << " // classinfo: key, value" << Qt::endl; for (int i = mo->classInfoOffset(); i < allClassInfoCount; ++i) { QMetaClassInfo classInfo = mo->classInfo(i); out << " "; addStringIdx(classInfo.name()); addStringIdx(classInfo.value()); - out << endl; + out << Qt::endl; } - out << endl; + out << Qt::endl; } // Signal/Slot arrays @@ -836,7 +836,7 @@ void generateClassImpl(QTextStream &out, const QMetaObject *mo, const QByteArray generateMethodParameters(out, mo, QMetaMethod::Slot); if (thisPropertyCount) { - out << " // properties: name, type, flags" << endl; + out << " // properties: name, type, flags" << Qt::endl; for (int i = mo->propertyOffset(); i < allPropertyCount; ++i) { QMetaProperty property = mo->property(i); out << " "; @@ -866,24 +866,24 @@ void generateClassImpl(QTextStream &out, const QMetaObject *mo, const QByteArray out << "0x" << QString::number(flags, 16).rightJustified(8, QLatin1Char('0')) << ", \t\t // " << property.typeName() << ' ' << property.name() - << endl; + << Qt::endl; } - out << endl; + out << Qt::endl; } if (thisEnumCount) { - out << " // enums: name, flags, count, data" << endl; + out << " // enums: name, flags, count, data" << Qt::endl; enumStart += thisEnumCount * 4; for (int i = mo->enumeratorOffset(); i < allEnumCount; ++i) { QMetaEnum enumerator = mo->enumerator(i); out << " "; addStringIdx(enumerator.name()); - out << (enumerator.isFlag() ? "0x1" : "0x0") << ", " << enumerator.keyCount() << ", " << enumStart << ", " << endl; + out << (enumerator.isFlag() ? "0x1" : "0x0") << ", " << enumerator.keyCount() << ", " << enumStart << ", " << Qt::endl; enumStart += enumerator.keyCount() * 2; } - out << endl; + out << Qt::endl; - out << " // enum data: key, value" << endl; + out << " // enum data: key, value" << Qt::endl; for (int i = mo->enumeratorOffset(); i < allEnumCount; ++i) { QMetaEnum enumerator = mo->enumerator(i); for (int j = 0; j < enumerator.keyCount(); ++j) { @@ -894,36 +894,36 @@ void generateClassImpl(QTextStream &out, const QMetaObject *mo, const QByteArray out << className << "::"; else out << nameSpace << "::"; - out << enumerator.key(j) << ")," << endl; + out << enumerator.key(j) << ")," << Qt::endl; } } } - out << " 0 // eod" << endl; - out << "};" << endl; - out << endl; + out << " 0 // eod" << Qt::endl; + out << "};" << Qt::endl; + out << Qt::endl; formatConstructorBody(out, className, controlID, category); - out << "const QMetaObject " << className << "::staticMetaObject = {" << endl; + out << "const QMetaObject " << className << "::staticMetaObject = {" << Qt::endl; if (category & ActiveX) - out << "{ &QWidget::staticMetaObject," << endl; + out << "{ &QWidget::staticMetaObject," << Qt::endl; else - out << "{ &QObject::staticMetaObject," << endl; - out << "qt_meta_stringdata_all.data," << endl; - out << "qt_meta_data_" << qualifiedClassNameIdentifier << ", nullptr, nullptr, nullptr }" << endl; - out << "};" << endl; - out << endl; - - out << "void *" << className << "::qt_metacast(const char *_clname)" << endl; - out << '{' << endl; - out << " if (!_clname) return nullptr;" << endl; - out << " if (!strcmp(_clname, \"" << qualifiedClassName << "\"))" << endl; - out << " return static_cast<void*>(const_cast<" << className << "*>(this));" << endl; + out << "{ &QObject::staticMetaObject," << Qt::endl; + out << "qt_meta_stringdata_all.data," << Qt::endl; + out << "qt_meta_data_" << qualifiedClassNameIdentifier << ", nullptr, nullptr, nullptr }" << Qt::endl; + out << "};" << Qt::endl; + out << Qt::endl; + + out << "void *" << className << "::qt_metacast(const char *_clname)" << Qt::endl; + out << '{' << Qt::endl; + out << " if (!_clname) return nullptr;" << Qt::endl; + out << " if (!strcmp(_clname, \"" << qualifiedClassName << "\"))" << Qt::endl; + out << " return static_cast<void*>(const_cast<" << className << "*>(this));" << Qt::endl; if (category & ActiveX) - out << " return QAxWidget::qt_metacast(_clname);" << endl; + out << " return QAxWidget::qt_metacast(_clname);" << Qt::endl; else - out << " return QAxObject::qt_metacast(_clname);" << endl; - out << '}' << endl; + out << " return QAxObject::qt_metacast(_clname);" << Qt::endl; + out << '}' << Qt::endl; } static void formatCommentBlockFooter(const QString &typeLibFile, QTextStream &str) @@ -969,12 +969,12 @@ static void writeForwardDeclaration(QTextStream &declOut, const QByteArray &clas { if (className.startsWith("enum ")) { declOut << "#ifndef Q_CC_MINGW\n" - << " " << className << ';' << endl // Only MSVC accepts this + << " " << className << ';' << Qt::endl // Only MSVC accepts this << "#else\n" - << " " << className << " {};" << endl + << " " << className << " {};" << Qt::endl << "#endif\n"; } else { - declOut << " " << className << ';' << endl; + declOut << " " << className << ';' << Qt::endl; } } @@ -1038,13 +1038,13 @@ bool generateTypeLibrary(QString typeLibFile, QString outname, "**\n** Metadata for " << libName; formatCommentBlockFooter(typeLibFile, implOut); - implOut << "#define QAX_DUMPCPP_" << libName.toUpper() << "_NOINLINES" << endl; + implOut << "#define QAX_DUMPCPP_" << libName.toUpper() << "_NOINLINES" << Qt::endl; - implOut << "#include \"" << outname << ".h\"" << endl; - implOut << "#include <OAIdl.h>" << endl; // For IDispatch - implOut << endl; - implOut << "using namespace " << libName << ';' << endl; - implOut << endl; + implOut << "#include \"" << outname << ".h\"" << Qt::endl; + implOut << "#include <OAIdl.h>" << Qt::endl; // For IDispatch + implOut << Qt::endl; + implOut << "using namespace " << libName << ';' << Qt::endl; + implOut << Qt::endl; } QFile declFile(outname + QLatin1String(".h")); @@ -1072,8 +1072,8 @@ bool generateTypeLibrary(QString typeLibFile, QString outname, UINT typeCount = typelib->GetTypeInfoCount(); if (declFile.isOpen()) { QByteArrayList opaquePointerTypes; - declOut << endl; - declOut << "// Referenced namespace" << endl; + declOut << Qt::endl; + declOut << "// Referenced namespace" << Qt::endl; for (UINT index = 0; index < typeCount; ++index) { ITypeInfo *typeinfo = nullptr; typelib->GetTypeInfo(index, &typeinfo); @@ -1155,37 +1155,37 @@ bool generateTypeLibrary(QString typeLibFile, QString outname, for (auto it = namespaces.cbegin(), end = namespaces.cend(); it != end; ++it) { const QByteArray &nspace = it.key(); if (libName != QLatin1String(nspace)) { - declOut << "namespace " << nspace << " {" << endl; + declOut << "namespace " << nspace << " {" << Qt::endl; for (const auto &className : it.value()) { if (className.contains(' ')) { writeForwardDeclaration(declOut, className); namespaceForType.insert(className.mid(className.indexOf(' ') + 1), nspace); } else { - declOut << " class " << className << ';' << endl; + declOut << " class " << className << ';' << Qt::endl; opaquePointerTypes.append(nspace + "::" + className); namespaceForType.insert(className, nspace); namespaceForType.insert(className + '*', nspace); namespaceForType.insert(className + "**", nspace); } } - declOut << '}' << endl << endl; + declOut << '}' << Qt::endl << Qt::endl; } } for (const QByteArray &opaquePointerType : qAsConst(opaquePointerTypes)) - declOut << "Q_DECLARE_OPAQUE_POINTER(" << opaquePointerType << "*)" << endl; - declOut << endl; + declOut << "Q_DECLARE_OPAQUE_POINTER(" << opaquePointerType << "*)" << Qt::endl; + declOut << Qt::endl; } generateNameSpace(declOut, namespaceObject, libNameBa); auto nspIt = namespaces.constFind(libNameBa); if (nspIt != namespaces.constEnd() && !nspIt.value().isEmpty()) { - declOut << "// forward declarations" << endl; + declOut << "// forward declarations" << Qt::endl; for (const auto &className : nspIt.value()) { if (className.contains(' ')) { - declOut << " " << className << ';' << endl; + declOut << " " << className << ';' << Qt::endl; namespaceForType.insert(className.mid(className.indexOf(' ') + 1), libNameBa); } else { - declOut << " class " << className << ';' << endl; + declOut << " class " << className << ';' << Qt::endl; namespaceForType.insert(className, libNameBa); namespaceForType.insert(className + '*', libNameBa); namespaceForType.insert(className + "**", libNameBa); @@ -1193,7 +1193,7 @@ bool generateTypeLibrary(QString typeLibFile, QString outname, } } - declOut << endl; + declOut << Qt::endl; } QByteArrayList subtypes; @@ -1263,7 +1263,7 @@ bool generateTypeLibrary(QString typeLibFile, QString outname, if (!(typeattr->wTypeFlags & TYPEFLAG_FDUAL) && (metaObject->propertyCount() - metaObject->propertyOffset()) == 1 && className.contains("Events")) { - declOut << "// skipping event interface " << className << endl << endl; + declOut << "// skipping event interface " << className << Qt::endl << Qt::endl; } else { if (declFile.isOpen()) { if (typeattr->wTypeFlags & TYPEFLAG_FLICENSED) @@ -1271,16 +1271,16 @@ bool generateTypeLibrary(QString typeLibFile, QString outname, if (typekind == TKIND_COCLASS) { // write those later... generateClassDecl(classesOut, metaObject, className, libNameBa, object_category | NoInlines); - classesOut << endl; + classesOut << Qt::endl; } else { generateClassDecl(declOut, metaObject, className, libNameBa, object_category | NoInlines); - declOut << endl; + declOut << Qt::endl; } subtypes << className; generateClassDecl(inlinesOut, metaObject, className, libNameBa, object_category | OnlyInlines); - inlinesOut << endl; + inlinesOut << Qt::endl; } if (implFile.isOpen()) generateClassImpl(classImplOut, metaObject, className, guid.toString(), libNameBa, @@ -1301,8 +1301,8 @@ bool generateTypeLibrary(QString typeLibFile, QString outname, // // Build stringdata struct // - implOut << "struct qt_meta_stringdata_all_t {" << endl; - implOut << " QByteArrayData data[" << strings.size() << "];" << endl; + implOut << "struct qt_meta_stringdata_all_t {" << Qt::endl; + implOut << " QByteArrayData data[" << strings.size() << "];" << Qt::endl; QVector<QByteArrayList> listVector; QByteArrayList currentList; @@ -1313,14 +1313,14 @@ bool generateTypeLibrary(QString typeLibFile, QString outname, currentList.append(s); // Split strings into chunks less than 64k to work around compiler limits. if (currentTableLen > 60000) { - implOut << " char stringdata" << listVector.size() << '[' << currentTableLen + 1 << "];" << endl; + implOut << " char stringdata" << listVector.size() << '[' << currentTableLen + 1 << "];" << Qt::endl; listVector.append(currentList); currentList.clear(); currentTableLen = 0; } } - implOut << " char stringdata" << listVector.size() << '[' << currentTableLen + 1 << "];" << endl; - implOut << "};" << endl; + implOut << " char stringdata" << listVector.size() << '[' << currentTableLen + 1 << "];" << Qt::endl; + implOut << "};" << Qt::endl; listVector.append(currentList); // Macro that expands into a QByteArrayData. The offset member is @@ -1328,27 +1328,27 @@ bool generateTypeLibrary(QString typeLibFile, QString outname, // stringdata.stringdata member, and 2) the stringdata.data index of the // QByteArrayData being defined. This calculation relies on the // QByteArrayData::data() implementation returning simply "this + offset". - implOut << "#define QT_MOC_LITERAL(idx, ofs, len, table) \\" << endl - << " Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \\" << endl - << " offsetof(qt_meta_stringdata_all_t, stringdata##table) + ofs \\" << endl - << " - idx * sizeof(QByteArrayData) \\" << endl - << " )" << endl; + implOut << "#define QT_MOC_LITERAL(idx, ofs, len, table) \\" << Qt::endl + << " Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \\" << Qt::endl + << " offsetof(qt_meta_stringdata_all_t, stringdata##table) + ofs \\" << Qt::endl + << " - idx * sizeof(QByteArrayData) \\" << Qt::endl + << " )" << Qt::endl; - implOut << "static const qt_meta_stringdata_all_t qt_meta_stringdata_all = {" << endl; - implOut << " {" << endl; + implOut << "static const qt_meta_stringdata_all_t qt_meta_stringdata_all = {" << Qt::endl; + implOut << " {" << Qt::endl; int totalStringCount = 0; for (int i = 0; i < listVector.size(); ++i) { int idx = 0; for (int j = 0; j < listVector[i].size(); j++) { if (totalStringCount) - implOut << ',' << endl; + implOut << ',' << Qt::endl; const QByteArray &str = listVector[i].at(j); implOut << "QT_MOC_LITERAL(" << totalStringCount++ << ", " << idx << ", " << str.length() << ", " << i << ')'; idx += str.length() + 1; } } - implOut << endl << " }"; + implOut << Qt::endl << " }"; // // Build stringdata arrays @@ -1356,12 +1356,12 @@ bool generateTypeLibrary(QString typeLibFile, QString outname, for (const auto &l : listVector) { int col = 0; int len = 0; - implOut << ',' << endl; + implOut << ',' << Qt::endl; implOut << " \""; for (const auto &s : l) { len = s.length(); if (col && col + len >= 150) { - implOut << '"' << endl << " \""; + implOut << '"' << Qt::endl << " \""; col = 0; } else if (len && s.at(0) >= '0' && s.at(0) <= '9') { implOut << "\"\""; @@ -1371,7 +1371,7 @@ bool generateTypeLibrary(QString typeLibFile, QString outname, while (idx < s.length()) { if (idx > 0) { col = 0; - implOut << '"' << endl << " \""; + implOut << '"' << Qt::endl << " \""; } int spanLen = qMin(150, s.length() - idx); implOut << s.mid(idx, spanLen); @@ -1385,13 +1385,13 @@ bool generateTypeLibrary(QString typeLibFile, QString outname, implOut << '"'; } // Terminate stringdata struct - implOut << endl << "};" << endl; + implOut << Qt::endl << "};" << Qt::endl; - implOut << "#undef QT_MOC_LITERAL" << endl << endl; + implOut << "#undef QT_MOC_LITERAL" << Qt::endl << Qt::endl; classImplOut.flush(); copyFileToStream(&classImplFile, &implOut); - implOut << endl; + implOut << Qt::endl; } qax_deleteMetaObject(namespaceObject); @@ -1401,54 +1401,54 @@ bool generateTypeLibrary(QString typeLibFile, QString outname, if (declFile.isOpen()) { if (classes.size()) { - declOut << "// Actual coclasses" << endl; + declOut << "// Actual coclasses" << Qt::endl; declOut << classes; } if (inlines.size()) { - declOut << "// member function implementation" << endl; - declOut << "#ifndef QAX_DUMPCPP_" << libName.toUpper() << "_NOINLINES" << endl; - declOut << inlines << endl; - declOut << "#endif" << endl << endl; + declOut << "// member function implementation" << Qt::endl; + declOut << "#ifndef QAX_DUMPCPP_" << libName.toUpper() << "_NOINLINES" << Qt::endl; + declOut << inlines << Qt::endl; + declOut << "#endif" << Qt::endl << Qt::endl; } // close namespace - declOut << '}' << endl; - declOut << endl; + declOut << '}' << Qt::endl; + declOut << Qt::endl; // partial template specialization for qMetaTypeCreateHelper and qMetaTypeConstructHelper - declOut << "QT_BEGIN_NAMESPACE" << endl << endl; - declOut << "namespace QtMetaTypePrivate {" << endl; + declOut << "QT_BEGIN_NAMESPACE" << Qt::endl << Qt::endl; + declOut << "namespace QtMetaTypePrivate {" << Qt::endl; for (int t = 0; t < subtypes.count(); ++t) { QByteArray subType(subtypes.at(t)); - declOut << "template<>" << endl; - declOut << "struct QMetaTypeFunctionHelper<" << libName << "::" << subType << ", /* Accepted */ true> {" << endl; + declOut << "template<>" << Qt::endl; + declOut << "struct QMetaTypeFunctionHelper<" << libName << "::" << subType << ", /* Accepted */ true> {" << Qt::endl; - declOut << " static void Destruct(void *t)" << endl; - declOut << " {" << endl; - declOut << " Q_UNUSED(t)" << endl; // Silence MSVC that warns for POD types. - declOut << " static_cast<" << libName << "::" << subType << "*>(t)->" << libName << "::" << subType << "::~" << subType << "();" << endl; - declOut << " }" << endl; + declOut << " static void Destruct(void *t)" << Qt::endl; + declOut << " {" << Qt::endl; + declOut << " Q_UNUSED(t)" << Qt::endl; // Silence MSVC that warns for POD types. + declOut << " static_cast<" << libName << "::" << subType << "*>(t)->" << libName << "::" << subType << "::~" << subType << "();" << Qt::endl; + declOut << " }" << Qt::endl; - declOut << " static void *Construct(void *where, const void *t)" << endl; - declOut << " {" << endl; - declOut << " Q_ASSERT(!t);" << endl; - declOut << " Q_UNUSED(t)" << endl; // Silence warnings for release builds - declOut << " return new (where) " << libName << "::" << subType << ';' << endl; - declOut << " }" << endl; + declOut << " static void *Construct(void *where, const void *t)" << Qt::endl; + declOut << " {" << Qt::endl; + declOut << " Q_ASSERT(!t);" << Qt::endl; + declOut << " Q_UNUSED(t)" << Qt::endl; // Silence warnings for release builds + declOut << " return new (where) " << libName << "::" << subType << ';' << Qt::endl; + declOut << " }" << Qt::endl; - declOut << "#ifndef QT_NO_DATASTREAM" << endl; + declOut << "#ifndef QT_NO_DATASTREAM" << Qt::endl; - declOut << " static void Save(QDataStream &stream, const void *t) { stream << *static_cast<const " << libName << "::" << subType << "*>(t); }" << endl; - declOut << " static void Load(QDataStream &stream, void *t) { stream >> *static_cast<" << libName << "::" << subType << "*>(t); }" << endl; + declOut << " static void Save(QDataStream &stream, const void *t) { stream << *static_cast<const " << libName << "::" << subType << "*>(t); }" << Qt::endl; + declOut << " static void Load(QDataStream &stream, void *t) { stream >> *static_cast<" << libName << "::" << subType << "*>(t); }" << Qt::endl; - declOut << "#endif // QT_NO_DATASTREAM" << endl; + declOut << "#endif // QT_NO_DATASTREAM" << Qt::endl; - declOut << "};" << endl << endl; + declOut << "};" << Qt::endl << Qt::endl; } - declOut << "} // namespace QtMetaTypePrivate" << endl; - declOut << "QT_END_NAMESPACE" << endl << endl; - declOut << "#endif" << endl; - declOut << endl; + declOut << "} // namespace QtMetaTypePrivate" << Qt::endl; + declOut << "QT_END_NAMESPACE" << Qt::endl << Qt::endl; + declOut << "#endif" << Qt::endl; + declOut << Qt::endl; } typelib->Release(); |