diff options
author | Eike Ziller <eike.ziller@qt.io> | 2018-09-12 15:01:46 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2018-09-14 09:46:29 +0000 |
commit | 876ff8853f42b4ea6fae60adf994f531898cba57 (patch) | |
tree | e0a7e9fc9d6694b1d8a4660a89d4478e5c0caf36 /tests | |
parent | 6452612845d7edebbef26a0d2b483c129ab3a073 (diff) |
Fix encapsulation of plugins
Fixes that triggering "About Python Extensions" action resulted in
python runtime error "TypeError: must be type, not None" when
referencing PySide2.QtWidgets.
To improve encapsulation of plugins, all modules that they loaded
were deleted after their main.py finished running. This breaks
if these modules were accessed later e.g. triggered by actions.
Instead of this hack, ensure encapsulation of plugins by making them
actual Python packages.
Qt Creator's python extension path is added to python's module search
path, and extensions are simply imported as packages.
The python extension's main.py simply becomes a standard python
module __init__.py.
This also means that python extensions can depend on, and use other
python extensions' functionality by importing them with "import".
Change-Id: Ibe74c24e337b321007f5fa19c97bd35a5c1f0375
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/testextension/__init__.py (renamed from tests/testextension/main.py) | 0 |
1 files changed, 0 insertions, 0 deletions
diff --git a/tests/testextension/main.py b/tests/testextension/__init__.py index 0c3f988..0c3f988 100644 --- a/tests/testextension/main.py +++ b/tests/testextension/__init__.py |