Lua: Add Utils.pid

Change-Id: I2f598639b0ebc77216e0286b59445e91967fabe0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Marcus Tillmanns
2024-07-16 14:36:04 +02:00
parent 4a7c8d9ec5
commit 26d91b3ead
2 changed files with 5 additions and 0 deletions

View File

@@ -81,6 +81,8 @@ void addUtilsModule()
utils["waitms"] = wrap(utils["waitms_cb"]); utils["waitms"] = wrap(utils["waitms_cb"]);
utils["pid"] = QCoreApplication::applicationPid();
auto hostOsInfoType = utils.new_usertype<HostOsInfo>("HostOsInfo"); auto hostOsInfoType = utils.new_usertype<HostOsInfo>("HostOsInfo");
hostOsInfoType["isWindowsHost"] = &HostOsInfo::isWindowsHost; hostOsInfoType["isWindowsHost"] = &HostOsInfo::isWindowsHost;
hostOsInfoType["isMacHost"] = &HostOsInfo::isMacHost; hostOsInfoType["isMacHost"] = &HostOsInfo::isMacHost;

View File

@@ -2,6 +2,9 @@
local utils = {} local utils = {}
---The Process ID of Qt Creator.
utils.pid = 0
---Suspends the current coroutine for the given amount of milliseconds. Call `a.wait` on the returned value to get the result. ---Suspends the current coroutine for the given amount of milliseconds. Call `a.wait` on the returned value to get the result.
---@param ms number The amount of milliseconds to wait. ---@param ms number The amount of milliseconds to wait.
function utils.waitms(ms) end function utils.waitms(ms) end