[Eric] QT Designer & Plugins on PyQT

Сергей Гринько sergey.grinko at gmail.com
Tue Jun 9 10:08:21 BST 2009


I use Eric 4.3.4
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.
Example:

# Set a specified environment variable with a directory name.
def setEnvironment(env, var_name, dir_name):
    # Convert the relative directory name to an absolute one.
    dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), dir_name)

    # Remove any existing value so that we have a controlled environment.
    idx = env.indexOf(QtCore.QRegExp("^%s=.*" % var_name,
QtCore.Qt.CaseInsensitive))

    if idx >= 0:
        env.removeAt(idx)

    env << "%s=%s" % (var_name, dir)

# Tell Qt Designer where it can find the directory containing the plugins
and
# Python where it can find the widgets.
env = QtCore.QProcess.systemEnvironment()
setEnvironment(env, "PYQTDESIGNERPATH", "python")
setEnvironment(env, "PYTHONPATH", "widgets")

# Start Designer.
designer = QtCore.QProcess()
designer.setEnvironment(env)
....
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/eric/attachments/20090609/51251a5b/attachment.html


More information about the Eric mailing list