Commit Graph

5 Commits

Author SHA1 Message Date
Marcus Tillmanns
218f07bdef Lua: Bind lifetime of LuaEngine
We want to make sure that the LuaEngine is deleted when the plugin
is removed.

We also derive LuaEngine from QObject so we can use it as a guard in
QObject::connect calls.

Change-Id: I6b0568f11bee283f880ede9432b2a9fe83014758
Reviewed-by: David Schulz <david.schulz@qt.io>
2024-05-03 12:43:55 +00:00
Marcus Tillmanns
9f99cf80f0 Lua: Fix soft loading
Previously the LuaEngine::loadPlugin() function tried to fully setup the
lua interpreter. This was called before the dependencies of a lua plugin
were fully soft loaded. Therefore the dependent lua packages had not
been registered yet.

This patch changes that to where the packages and lua libraries are only
loaded right before the actual setup call is done. This also allows us
to safely load the plugin spec without giving it access to all the
functionality directly.

In the future we could show and ask the user before we load the plugin
whether he agrees to give it the requested access.

Change-Id: Ibf3e81db54e2ba94473e8ecf2650dcf2e97f1360
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2024-04-23 11:05:21 +00:00
Marcus Tillmanns
bc5b67909c Lua: Cleanup code style
Change-Id: I7d8713c87a097f113c5b9d04104f3948b691dbf9
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2024-04-23 06:50:22 +00:00
Marcus Tillmanns
f91d071c66 Lua: Clean up pass
Fixing constness, removing unused function, adding LuaEngine::variadicToStringList

Change-Id: If567ac83c04e5ce6f973c819f303c9cb790b3948
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2024-04-19 13:54:11 +00:00
Marcus Tillmanns
6e3aab5f1b Lua: Add Lua plugin support
Adds basic support for writing Plugins using the lua scripting language.
Lua Plugins are registered just as native plugins are and can be enabled
or disabled via the plugin dialog.

see src/plugins/lua/README.md for further details.

Change-Id: I9f4d15e9632c46e1c6c132bcd0bbcdd70b150640
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2024-04-16 13:11:18 +00:00