diff options
| author | Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> | 2023-10-02 14:07:40 +0200 |
|---|---|---|
| committer | Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> | 2023-10-02 18:20:53 +0200 |
| commit | 0f98cb69d4e8a2beec64102abef97b46aa7626ba (patch) | |
| tree | fabe55d998e7190e0d3b8ccbf5f9b30693b00662 /sources/pyside-tools/project/project_data.py | |
| parent | 0a1710429333001fbf5a96cdc9043f9ec2f559ba (diff) | |
Android Deployment: Identify Qt modules from generated Python files
- This patch adds an extra step to check the existence of Python files
generated from `pyside6-uic` and `pyside6-qrc` for identifying the
imported Qt modules in the application.
This only applies when the application has a .pyproject file. When
the project does not have a .pyproject file, all the Python files
in the application are checked for Qt module imports.
The .pyproject file does not consider the generated Python files and
hence the need of this patch.
- For pyside6-deploy, this patch is irrelevant because Nuitka identifies
all the required Python files of the project.
Task-number: PYSIDE-1612
Pick-to: 6.6
Change-Id: Ic9a2812c42226b6baebab1b23fac8e410910578e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/pyside-tools/project/project_data.py')
| -rw-r--r-- | sources/pyside-tools/project/project_data.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/sources/pyside-tools/project/project_data.py b/sources/pyside-tools/project/project_data.py index 4cd30c42b..b8d27f33e 100644 --- a/sources/pyside-tools/project/project_data.py +++ b/sources/pyside-tools/project/project_data.py @@ -29,6 +29,10 @@ class ProjectData: # Python files self.main_file: Path = None self._python_files: List[Path] = [] + # ui files + self._ui_files: List[Path] = [] + # qrc files + self._qrc_files: List[Path] = [] with project_file.open("r") as pyf: pyproject = json.load(pyf) @@ -44,6 +48,11 @@ class ProjectData: if file.stem == "main": self.main_file = file self._python_files.append(file) + elif file.suffix == ".ui": + self._ui_files.append(file) + elif file.suffix == ".qrc": + self._qrc_files.append(file) + if not self.main_file: self._find_main_file() @@ -68,6 +77,14 @@ class ProjectData: return self._python_files @property + def ui_files(self): + return self._ui_files + + @property + def qrc_files(self): + return self._qrc_files + + @property def qml_files(self): return self._qml_files |
