aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside-tools/deploy_lib/config.py
diff options
context:
space:
mode:
authorShyamnath Premnadh <Shyamnath.Premnadh@qt.io>2023-10-12 09:33:46 +0200
committerShyamnath Premnadh <Shyamnath.Premnadh@qt.io>2023-12-04 13:06:22 +0100
commit75ce3916f291179ed68cdc78f147e30fb7fbaf68 (patch)
treefcd2f80daf79bb3d9df50871afcbac2722b60988 /sources/pyside-tools/deploy_lib/config.py
parenteeda9bf8522ba49cb542398d8e01046ea62e2aa2 (diff)
Deployment: Add icon for application
- For Android deployment, by default kivy's icon is used when the application is deployed. This patch makes use of PySide icon as the default for all applications created with pyside6-android-deploy. - Icon formats accepted by Nutika windows: .ico macOS: .icns (contains a 128x128 .png file) linux: all standard image formats. We use .jpg - For Desktop deployment - change the option --linux-onefile-icon to --linux-icon. Both are the same. - Add icon options for macOS and Windows. - Adapt deployment test accordingly. - As an addition, add a default value to the --config-file option so that it picks up the one in the project directory automatically, if it exists. It aligns with the desktop deployment tool as per 6337e4a306babdb4015c248a14ad734b320ed2c1 - As another extra, remove an unused typing import from config.py Pick-to: 6.6 Task-number: PYSIDE-1612 Change-Id: Ia67ea96f94ddffe4bc65652f91c8b394c4e56a33 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/pyside-tools/deploy_lib/config.py')
-rw-r--r--sources/pyside-tools/deploy_lib/config.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/sources/pyside-tools/deploy_lib/config.py b/sources/pyside-tools/deploy_lib/config.py
index 57eec3d1f..81de8b2c6 100644
--- a/sources/pyside-tools/deploy_lib/config.py
+++ b/sources/pyside-tools/deploy_lib/config.py
@@ -6,11 +6,11 @@ import logging
import warnings
from configparser import ConfigParser
from pathlib import Path
-from typing import List
from project import ProjectData
from .commands import run_qmlimportscanner
+from . import DEFAULT_APP_ICON
# Some QML plugins like QtCore are excluded from this list as they don't contribute much to
# executable size. Excluding them saves the extra processing of checking for them in files
@@ -82,6 +82,13 @@ class Config(BaseConfig):
self.title = self.get_value("app", "title")
+ # set application icon
+ config_icon = self.get_value("app", "icon")
+ if config_icon:
+ self.icon = str(Path(config_icon).resolve())
+ else:
+ self.icon = DEFAULT_APP_ICON
+
self.project_dir = None
if self.get_value("app", "project_dir"):
self.project_dir = Path(self.get_value("app", "project_dir")).absolute()
@@ -167,6 +174,15 @@ class Config(BaseConfig):
self.set_value("app", "title", title)
@property
+ def icon(self):
+ return self._icon
+
+ @icon.setter
+ def icon(self, icon):
+ self._icon = icon
+ self.set_value("app", "icon", icon)
+
+ @property
def source_file(self):
return self._source_file