diff --git a/ovos_workshop/resource_files.py b/ovos_workshop/resource_files.py index d576dc05..ce22a8fe 100644 --- a/ovos_workshop/resource_files.py +++ b/ovos_workshop/resource_files.py @@ -268,6 +268,10 @@ def _read(self) -> str: class QmlFile(ResourceFile): def _locate(self): """ QML files are special because we do not want to walk the directory """ + config = Configuration() + enclosure_config = config.get("gui") or {} + qt_version_target = enclosure_config.get("qt_version", 5) + file_path = None if self.resource_name.endswith(self.resource_type.file_extension): file_name = self.resource_name @@ -296,6 +300,12 @@ def _locate(self): if file_path is None: LOG.error(f"Could not find resource file {file_name}") + # Will be used to load the correct UI file for the target Qt version + # TODO: Remove this when we drop Qt5 support + if qt_version_target == 6: + if "ui/" in str(file_path): + file_path = Path(str(file_path).replace("ui/", "ui6/")) + return file_path def load(self):