Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a0d8a40

Browse filesBrowse files
jdpagepauldotknopf
authored andcommitted
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.
1 parent 4287317 commit a0d8a40
Copy full SHA for a0d8a40

File tree

Expand file treeCollapse file tree

1 file changed

+4
-8
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-8
lines changed

‎src/native/QmlNet/Hosting/CoreHost.cpp

Copy file name to clipboardExpand all lines: src/native/QmlNet/Hosting/CoreHost.cpp
+4-8Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,10 @@ int CoreHost::run(QGuiApplication& app, QQmlApplicationEngine& engine, runCallba
143143
execArgs.push_back("exec");
144144
execArgs.push_back(runContext.managedExe);
145145

146-
QString appPtr;
147-
appPtr.asprintf("%llu", (quintptr)&app);
148-
QString enginePtr;
149-
enginePtr.asprintf("%llu", (quintptr)&engine);
150-
QString callbackPtr;
151-
callbackPtr.asprintf("%llu", (quintptr)runCallback);
152-
QString exportedSymbolPointer;
153-
exportedSymbolPointer.asprintf("%llu", (quintptr)getExportedFunction);
146+
auto appPtr = QString::number((qintptr)&app);
147+
auto enginePtr = QString::number((quintptr)&engine);
148+
auto callbackPtr = QString::number((quintptr)runCallback);
149+
auto exportedSymbolPointer = QString::number((quintptr)&getExportedFunction);
154150

155151
execArgs.push_back(appPtr);
156152
execArgs.push_back(enginePtr);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.