Replace usage of QString::asprintf for new Qt

Qt5 removed the instance method QString::asprintf, and later replaced
it with a static method of the same name, causing CoreHost to compile,
but pass empty strings to the managed entry point.

The static QString::number method is available in both Qt4 and Qt5,
and as a bonus the overload should resolve to the appropriate pointer
length for the target.
This commit is contained in:
Jonathan David Page 2020-04-23 12:31:14 -04:00 committed by Paul Knopf
parent 4287317ec0
commit a0d8a403c3

View file

@ -143,14 +143,10 @@ int CoreHost::run(QGuiApplication& app, QQmlApplicationEngine& engine, runCallba
execArgs.push_back("exec");
execArgs.push_back(runContext.managedExe);
QString appPtr;
appPtr.asprintf("%llu", (quintptr)&app);
QString enginePtr;
enginePtr.asprintf("%llu", (quintptr)&engine);
QString callbackPtr;
callbackPtr.asprintf("%llu", (quintptr)runCallback);
QString exportedSymbolPointer;
exportedSymbolPointer.asprintf("%llu", (quintptr)getExportedFunction);
auto appPtr = QString::number((qintptr)&app);
auto enginePtr = QString::number((quintptr)&engine);
auto callbackPtr = QString::number((quintptr)runCallback);
auto exportedSymbolPointer = QString::number((quintptr)&getExportedFunction);
execArgs.push_back(appPtr);
execArgs.push_back(enginePtr);