Lua: Fix build

Change-Id: I908495a3e0f3ebb03291aed9256a50678320b4ee
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Stenger
2024-07-29 06:51:12 +02:00
parent d487237b6b
commit c325777477
2 changed files with 2 additions and 2 deletions

View File

@@ -394,7 +394,7 @@ QStringList variadicToStringList(const sol::variadic_args &vargs)
size_t l; size_t l;
const char *s = luaL_tolstring(vargs.lua_state(), int(i), &l); const char *s = luaL_tolstring(vargs.lua_state(), int(i), &l);
if (s != nullptr) if (s != nullptr)
strings.append(QString::fromUtf8(s, l).replace('\0', "\\0")); strings.append(QString::fromUtf8(s, l).replace(QLatin1Char('\0'), "\\0"));
} }
return strings; return strings;

View File

@@ -129,7 +129,7 @@ sol::usertype<T> runtimeObject(sol::state_view lua)
void registerUiBindings() void registerUiBindings()
{ {
LuaEngine::registerProvider("Qt.Gui", [](sol::state_view lua) { registerProvider("Qt.Gui", [](sol::state_view lua) {
runtimeObject<QObject>(lua); runtimeObject<QObject>(lua);
runtimeObject<QWidget, QObject>(lua); runtimeObject<QWidget, QObject>(lua);
runtimeObject<QDialog, QWidget, QObject>(lua); runtimeObject<QDialog, QWidget, QObject>(lua);