src/eric7/SystemUtilities/QtUtilities.py

branch
eric7
changeset 10158
b5aadedf4214
parent 9653
e67609152c5e
child 10249
77b4c59c76d9
--- a/src/eric7/SystemUtilities/QtUtilities.py	Thu Aug 17 14:47:52 2023 +0200
+++ b/src/eric7/SystemUtilities/QtUtilities.py	Fri Aug 25 10:49:39 2023 +0200
@@ -182,6 +182,50 @@
     return ("open", newArgs)
 
 
+def hasQtDesigner():
+    """
+    Function to check for the availabilility of Qt-Designer tool.
+
+    @return flag indicating the availability of the Qt-Designer tool
+    @rtype bool
+    """
+    if OSUtilities.isWindowsPlatform():
+        designerExe = os.path.join(
+            getQtBinariesPath(),
+            "{0}.exe".format(generateQtToolName("designer")),
+        )
+    elif OSUtilities.isMacPlatform():
+        designerExe = getQtMacBundle("designer")
+    else:
+        designerExe = os.path.join(
+            getQtBinariesPath(),
+            generateQtToolName("designer"),
+        )
+    return os.path.exists(designerExe)
+
+
+def hasQtLinguist():
+    """
+    Function to check for the availabilility of Qt-Linguist tool.
+
+    @return flag indicating the availability of the Qt-Linguist tool
+    @rtype bool
+    """
+    if OSUtilities.isWindowsPlatform():
+        linguistExe = os.path.join(
+            getQtBinariesPath(),
+            "{0}.exe".format(generateQtToolName("linguist")),
+        )
+    elif OSUtilities.isMacPlatform():
+        linguistExe = getQtMacBundle("linguist")
+    else:
+        linguistExe = os.path.join(
+            getQtBinariesPath(),
+            generateQtToolName("linguist"),
+        )
+    return os.path.exists(linguistExe)
+
+
 ###############################################################################
 ## PyQt utility functions below
 ###############################################################################

eric ide

mercurial