-
Notifications
You must be signed in to change notification settings - Fork 0
/
qt_designer.pyw
executable file
·31 lines (22 loc) · 1.36 KB
/
qt_designer.pyw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env python3
"""Author: Victor Varvariuc <[email protected]>"""
import os, sys, subprocess
curDir = os.path.dirname(os.path.abspath(__file__))
params = list(sys.argv) # copy list
params[0] = 'designer'
widgetsDir = os.path.join(curDir, 'wic', 'widgets')
os.chdir(widgetsDir)
# path for python custom widgets and plugins for designer
os.putenv('PYQTDESIGNERPATH', widgetsDir)
#os.putenv('PATH', os.getenv('PATH', '') + ';' + os.path.dirname(sys.executable)) # http://code.activestate.com/recipes/577233-adding-the-directory-of-the-python-executable-to-t/
retcode = subprocess.Popen(params)
"""
http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/designer.html#writing-qt-designer-plugins
>The PYQTDESIGNERPATH environment variable specifies the set of directories to search for plugins.
Directory names are separated by a path separator (a semi-colon on Windows and a colon on other platforms).
If a directory name is empty (ie. there are consecutive path separators or a leading or trailing path
separator) then a set of default directories is automatically inserted at that point.
The default directories are the python subdirectory of each directory that Designer
searches for its own plugins. If the environment variable is not set then only the default
directories are searched. If a file's basename does not end with plugin then it is ignored.
"""