Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2021-07-01 14:17:49 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2021-07-06 06:45:37 +0000
commit401c8134dd84e3ad271c6a0a1e6248cf090d7fe4 (patch)
treece2a2ad39d9f4cbe077059325f85b3794c164945 /sources/pyside-tools/pyside_tool.py
parent9daa6fd5497226733d74490c03990e8d5a88d8d2 (diff)
Pyside6/Qt Designer: Fix Python code preview not working on UNIX
Qt Designer as bundled by PySide6 was unable to find the uic binary in the libexec directory of the bundled Qt since that was only copied when QtWebEngine was built and the rcc/uic binaries were copied into the main directory. Also, libexec existed as a file containing qt.conf, which was created by a copy statement not checking for the target directory. Fix that by actually creating a libexec directory for uic, rcc and QtWebEngineProcess. Patch the executables accordingly. Add checks before copying qt.conf. Adapt pyside-tool to use libexec. The Windows code path remains the same, everything uses main directory there. Change-Id: I0c9f46fb776ed0315eecb6ed00202ea8d8f17fe2 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/pyside-tools/pyside_tool.py')
-rw-r--r--sources/pyside-tools/pyside_tool.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/sources/pyside-tools/pyside_tool.py b/sources/pyside-tools/pyside_tool.py
index 1819a3ffb..dd6a5bd21 100644
--- a/sources/pyside-tools/pyside_tool.py
+++ b/sources/pyside-tools/pyside_tool.py
@@ -57,13 +57,15 @@ def main():
sys.exit(subprocess.call(command))
-def qt_tool_wrapper(qt_tool, args):
+def qt_tool_wrapper(qt_tool, args, libexec=False):
# Taking care of pyside6-uic, pyside6-rcc, and pyside6-designer
# listed as an entrypoint in setup.py
- pyside_dir = os.path.dirname(ref_mod.__file__)
- exe = os.path.join(pyside_dir, qt_tool)
-
- cmd = [exe] + args
+ pyside_dir = Path(ref_mod.__file__).resolve().parent
+ if libexec and sys.platform != "win32":
+ exe = pyside_dir / 'Qt' / 'libexec' / qt_tool
+ else:
+ exe = pyside_dir / qt_tool
+ cmd = [os.fspath(exe)] + args
proc = Popen(cmd, stderr=PIPE)
out, err = proc.communicate()
if err:
@@ -74,11 +76,11 @@ def qt_tool_wrapper(qt_tool, args):
def uic():
- qt_tool_wrapper("uic", ['-g', 'python'] + sys.argv[1:])
+ qt_tool_wrapper("uic", ['-g', 'python'] + sys.argv[1:], True)
def rcc():
- qt_tool_wrapper("rcc", ['-g', 'python'] + sys.argv[1:])
+ qt_tool_wrapper("rcc", ['-g', 'python'] + sys.argv[1:], True)
def assistant():