Forum > QT

IsWayland value can be cached

(1/1)

AlexTP:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---function IsWayland: Boolean;var  APlatform: WideString;begin  Result := False;  QGuiApplication_platformName(@APlatform);  Result := APlatform = 'wayland';  // not QX11Info_isPlatformX11() and (GetEnvironmentVariable('XDG_SESSION_TYPE') = 'wayland');end; Can we cache the function res to a global variable, ie call the function only once? Now it's called 100 times from different places of Qt5 WS.

Navigation

[0] Message Index

Go to full version