Globals, UserInterface: improved the detection of the Qt tools.

Fri, 16 Nov 2018 20:00:03 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Fri, 16 Nov 2018 20:00:03 +0100
changeset 6589
613426e62983
parent 6588
a77723d4060f
child 6590
8cad6f50ff4c

Globals, UserInterface: improved the detection of the Qt tools.

Documentation/Help/source.qch file | annotate | diff | comparison | revisions
Documentation/Source/eric6.UI.UserInterface.html file | annotate | diff | comparison | revisions
Globals/__init__.py file | annotate | diff | comparison | revisions
UI/UserInterface.py file | annotate | diff | comparison | revisions
Binary file Documentation/Help/source.qch has changed
--- a/Documentation/Source/eric6.UI.UserInterface.html	Mon Nov 12 19:48:08 2018 +0100
+++ b/Documentation/Source/eric6.UI.UserInterface.html	Fri Nov 16 20:00:03 2018 +0100
@@ -238,7 +238,7 @@
 <td>Private slot to start the Qt-Assistant executable.</td>
 </tr><tr>
 <td><a href="#UserInterface.__assistant4">__assistant4</a></td>
-<td>Private slot to start the Qt-Assistant 4 executable.</td>
+<td>Private slot to start the Qt-Assistant 4/5 executable.</td>
 </tr><tr>
 <td><a href="#UserInterface.__checkActions">__checkActions</a></td>
 <td>Private slot to check some actions for their enable/disable status.</td>
@@ -301,7 +301,7 @@
 <td>Private slot to start the Qt-Designer executable.</td>
 </tr><tr>
 <td><a href="#UserInterface.__designer4">__designer4</a></td>
-<td>Private slot to start the Qt-Designer 4 executable.</td>
+<td>Private slot to start the Qt-Designer 4/5 executable.</td>
 </tr><tr>
 <td><a href="#UserInterface.__editPixmap">__editPixmap</a></td>
 <td>Private slot to show a pixmap in a dialog.</td>
@@ -379,7 +379,7 @@
 <td>Private slot to start the Qt-Linguist executable.</td>
 </tr><tr>
 <td><a href="#UserInterface.__linguist4">__linguist4</a></td>
-<td>Private slot to start the Qt-Linguist 4 executable.</td>
+<td>Private slot to start the Qt-Linguist 4/5 executable.</td>
 </tr><tr>
 <td><a href="#UserInterface.__loadSessionFromFile">__loadSessionFromFile</a></td>
 <td>Private slot to load a session from disk.</td>
@@ -1001,18 +1001,18 @@
 <p>
         Private slot to start the Qt-Assistant executable.
 </p><dl>
-<dt><i>home</i></dt>
+<dt><i>home</i> (str)</dt>
 <dd>
-full pathname of a file to display (string)
-</dd><dt><i>version</i></dt>
+full pathname of a file to display
+</dd><dt><i>version</i> (int)</dt>
 <dd>
-indication for the requested version (Qt 4) (integer)
+indication for the requested version (4 = Qt 4/5)
 </dd>
 </dl><a NAME="UserInterface.__assistant4" ID="UserInterface.__assistant4"></a>
 <h4>UserInterface.__assistant4</h4>
 <b>__assistant4</b>(<i></i>)
 <p>
-        Private slot to start the Qt-Assistant 4 executable.
+        Private slot to start the Qt-Assistant 4/5 executable.
 </p><a NAME="UserInterface.__checkActions" ID="UserInterface.__checkActions"></a>
 <h4>UserInterface.__checkActions</h4>
 <b>__checkActions</b>(<i>editor</i>)
@@ -1159,18 +1159,18 @@
 <p>
         Private slot to start the Qt-Designer executable.
 </p><dl>
-<dt><i>fn</i></dt>
+<dt><i>fn</i> (str)</dt>
 <dd>
 filename of the form to be opened
-</dd><dt><i>version</i></dt>
+</dd><dt><i>version</i> (int)</dt>
 <dd>
-indication for the requested version (Qt 4) (integer)
+indication for the requested version (4 = Qt 4/5)
 </dd>
 </dl><a NAME="UserInterface.__designer4" ID="UserInterface.__designer4"></a>
 <h4>UserInterface.__designer4</h4>
 <b>__designer4</b>(<i></i>)
 <p>
-        Private slot to start the Qt-Designer 4 executable.
+        Private slot to start the Qt-Designer 4/5 executable.
 </p><a NAME="UserInterface.__editPixmap" ID="UserInterface.__editPixmap"></a>
 <h4>UserInterface.__editPixmap</h4>
 <b>__editPixmap</b>(<i>fn=""</i>)
@@ -1335,18 +1335,18 @@
 <p>
         Private slot to start the Qt-Linguist executable.
 </p><dl>
-<dt><i>fn</i></dt>
+<dt><i>fn</i> (str)</dt>
 <dd>
 filename of the translation file to be opened
-</dd><dt><i>version</i></dt>
+</dd><dt><i>version</i> (int)</dt>
 <dd>
-indication for the requested version (Qt 4) (integer)
+indication for the requested version (4 = Qt 4/5)
 </dd>
 </dl><a NAME="UserInterface.__linguist4" ID="UserInterface.__linguist4"></a>
 <h4>UserInterface.__linguist4</h4>
 <b>__linguist4</b>(<i>fn=None</i>)
 <p>
-        Private slot to start the Qt-Linguist 4 executable.
+        Private slot to start the Qt-Linguist 4/5 executable.
 </p><dl>
 <dt><i>fn</i></dt>
 <dd>
@@ -2386,8 +2386,8 @@
 <h4>UserInterface.getOriginalPathString</h4>
 <b>getOriginalPathString</b>(<i></i>)
 <p>
-        Public method to get the original PATH environment variable (i.e.
-        before modifications by eric6 and PyQt5)
+        Public method to get the original PATH environment variable
+        (i.e. before modifications by eric6 and PyQt5).
 </p><dl>
 <dt>Returns:</dt>
 <dd>
--- a/Globals/__init__.py	Mon Nov 12 19:48:08 2018 +0100
+++ b/Globals/__init__.py	Fri Nov 16 20:00:03 2018 +0100
@@ -278,12 +278,21 @@
             path = modDir
         
         if not path:
-            # step 2.2: check for the pyqt5-tools wheel (Windows only)
             import distutils.sysconfig
+            # step 2.2.1: check for the pyqt5-tools wheel (new variant)
+            # (Windows only)
             pyqt5ToolsPath = os.path.join(
-                distutils.sysconfig.get_python_lib(True), "pyqt5-tools")
+                distutils.sysconfig.get_python_lib(True), "pyqt5_tools")
             if os.path.exists(os.path.join(pyqt5ToolsPath, "designer.exe")):
                 path = pyqt5ToolsPath
+            if not path:
+                # step 2.2.2: check for the pyqt5-tools wheel (old variant)
+                # (Windows only)
+                pyqt5ToolsPath = os.path.join(
+                    distutils.sysconfig.get_python_lib(True), "pyqt5-tools")
+                if os.path.exists(os.path.join(pyqt5ToolsPath,
+                                               "designer.exe")):
+                    path = pyqt5ToolsPath
     
     if not path:
         # step 3: get the path from Qt
--- a/UI/UserInterface.py	Mon Nov 12 19:48:08 2018 +0100
+++ b/UI/UserInterface.py	Fri Nov 16 20:00:03 2018 +0100
@@ -4568,7 +4568,9 @@
         Private slot to start the Qt-Designer executable.
         
         @param fn filename of the form to be opened
-        @param version indication for the requested version (Qt 4) (integer)
+        @type str
+        @param version indication for the requested version (4 = Qt 4/5)
+        @type int
         """
         if fn is not None and version == 0:
             # determine version from file, if not specified
@@ -4644,7 +4646,7 @@
         
     def __designer4(self):
         """
-        Private slot to start the Qt-Designer 4 executable.
+        Private slot to start the Qt-Designer 4/5 executable.
         """
         self.__designer(version=4)
         
@@ -4653,7 +4655,9 @@
         Private slot to start the Qt-Linguist executable.
         
         @param fn filename of the translation file to be opened
-        @param version indication for the requested version (Qt 4) (integer)
+        @type str
+        @param version indication for the requested version (4 = Qt 4/5)
+        @type int
         """
         if version < 4:
             E5MessageBox.information(
@@ -4713,7 +4717,7 @@
     @pyqtSlot(str)
     def __linguist4(self, fn=None):
         """
-        Private slot to start the Qt-Linguist 4 executable.
+        Private slot to start the Qt-Linguist 4/5 executable.
         
         @param fn filename of the translation file to be opened
         """
@@ -4723,8 +4727,10 @@
         """
         Private slot to start the Qt-Assistant executable.
         
-        @param home full pathname of a file to display (string)
-        @param version indication for the requested version (Qt 4) (integer)
+        @param home full pathname of a file to display
+        @type str
+        @param version indication for the requested version (4 = Qt 4/5)
+        @type int
         """
         if version < 4:
             E5MessageBox.information(
@@ -4762,7 +4768,7 @@
         
     def __assistant4(self):
         """
-        Private slot to start the Qt-Assistant 4 executable.
+        Private slot to start the Qt-Assistant 4/5 executable.
         """
         self.__assistant(version=4)
     

eric ide

mercurial