I suggest to add at the level of the project, two new properties:
<br> 1) "PYQTDESIGNERPATH" - the way the search module plug-ins for QT-Designer (custom widgets)
<br> 2) "PYTHONPATH" - module search path for the realization of QT-Designer (custom widgets)
<br>
<br> The module UserInterface.py in class UserInterface method
__designer () add the code reads these properties and changing
environment. <br> Example:
<br><br>import os<br>...<br>class UserInterface(KQMainWindow):<br> ...<br> # Set a specified environment variable with a directory name.<br> def setEnvDesigner(self, var_name, dir_name):<br> # Convert the relative directory name to an absolute one.<br>
os.putenv(var_name, os.path.join(self.project.ppath, dir_name))<br> <br> def __designer(self, fn = None, version = 0):<br> ...<br> # Tell Qt Designer where it can find the directory containing the plugins and<br>
# Python where it can find the widgets.<br> # "kernel/UI/widgets/plugins" - sample path (must be read from the properties of the project)<br> # "kernel/UI/widgets" - sample path (must be read from the properties of the project)<br>
self.setEnvDesigner("PYQTDESIGNERPATH", "kernel/UI/widgets/plugins")<br> self.setEnvDesigner("PYTHONPATH", "kernel/UI/widgets")<br> #<br> proc = QProcess()<br>
if not proc.startDetached(designer, args):<br> KQMessageBox.critical(self,<br> self.trUtf8('Process Generation Error'),<br> self.trUtf8(<br> '<p>Could not start Qt-Designer.<br>'<br>
'Ensure that it is available as <b>%1</b>.</p>'<br> ).arg(designer))<br><br><div style="text-align: left;" id="result_box" dir="ltr">Following these changes, everything works well.</div>
<br><div class="gmail_quote">9 ษภฮั 2009 ว. 13:08 ะฯฬฺุฯืมิลฬุ ๓ลาวลส ็าษฮุหฯ <span dir="ltr"><<a href="mailto:sergey.grinko@gmail.com">sergey.grinko@gmail.com</a>></span> ฮมะษำมฬ:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I use Eric 4.3.4<br>How to make it possible to start with QT Designer,
designate the path search directory containing the plugins and Python
where it can find the widgets.<br>Example:<br><br># Set a specified environment variable with a directory name.<br>def setEnvironment(env, var_name, dir_name):<br> # Convert the relative directory name to an absolute one.<br>
dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), dir_name)<br><br> # Remove any existing value so that we have a controlled environment.<br> idx = env.indexOf(QtCore.QRegExp("^%s=.*" % var_name, QtCore.Qt.CaseInsensitive))<br>
<br> if idx >= 0:<br> env.removeAt(idx)<br><br> env << "%s=%s" % (var_name, dir)<br><br># Tell Qt Designer where it can find the directory containing the plugins and<br># Python where it can find the widgets.<br>
env = QtCore.QProcess.systemEnvironment()<br>setEnvironment(env, "PYQTDESIGNERPATH", "python")<br>setEnvironment(env, "PYTHONPATH", "widgets")<br><br># Start Designer.<br>designer = QtCore.QProcess()<br>
designer.setEnvironment(env)<br>....<br><br>
</blockquote></div><br><br clear="all"><br>-- <br>๓ ีืมึลฮษลอ ็าษฮุหฯ ๓ลาวลส<br>Email: <a href="mailto:sergey.grinko@gmail.com">sergey.grinko@gmail.com</a><br>