matplotlib widget & QtDesigner

5,296 views
Skip to first unread message

sebastian06

unread,
Oct 5, 2010, 3:45:47 PM10/5/10
to python(x,y)
Hi guys,

I use pythonxy at work and at home. Since I can not use Ubuntu 10.04
during my job, I have to stick to WindowsXP.
And here is my problem. When I start the QtDesigner from the Python,
the designer has the very easy to use matplotlib widget.
At home, where I have only Spyder (no PythonXY ...), I start the
QtDesigner from there, this widget is missing in the designer widget
box. Is there a way to integrate the matplotlib widget in the same way
it was done for the windows software or do I have to create the widget
by myself. And can I add it to the widget toolbox?

Thanks for your help,

Sebastian

Pierre Raybaut

unread,
Oct 6, 2010, 3:00:11 PM10/6/10
to python(x,y)
Hi,

You may directly use the Matplotlib Qt Designer plugin which is
shipped with Python(x,y).
It is located here: "C:\Python26\Lib\site-packages\PyQt4\plugins
\designer\python".

On your linux machine, create an environment variable called
PYQTDESIGNERPATH, and set it to the directory containing
'matplotlibplugin.py'. That's all!

For more information on how to create Qt Designer plugins for PyQt4:
http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/pyqt4ref.html#writing-qt-designer-plugins

Cheers,
Pierre

sebastian06

unread,
Oct 9, 2010, 5:08:51 AM10/9/10
to python(x,y)
Hi Pierre,

thanks for the hint, but it still does not work. Here is what I did

PYQTDESIGNERPATH=/home/sebi/Applications/QtDesigner_Plugins (--> here
is matplotlibplugin-py located in Linux)
export PYQTDESIGNERPATH
echo PYQTDESIGNERPATH
...
PYQTDESIGNERPATH=/home/sebi/Applications/QtDesigner_Plugins

This looks fine to me, but when I start the Qt Designer, there is
matplotlibplugin widget. And if I log off & on again, the environment
variable is gone ...

Any idea, what I did wrong?

Cheers,

Sebi

On Oct 6, 9:00 pm, Pierre Raybaut <cont...@pythonxy.com> wrote:
> Hi,
>
> You may directly use the Matplotlib Qt Designer plugin which is
> shipped with Python(x,y).
> It is located here: "C:\Python26\Lib\site-packages\PyQt4\plugins
> \designer\python".
>
> On your linux machine, create an environment variable called
> PYQTDESIGNERPATH, and set it to the directory containing
> 'matplotlibplugin.py'. That's all!
>
> For more information on how to create Qt Designer plugins for PyQt4:http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/pyqt4ref.html#w...

Pierre Raybaut

unread,
Oct 9, 2010, 5:21:10 AM10/9/10
to python(x,y)
Actually you have to add this environment variable in your .bashrc
configuration file (or .cshrc depending on your terminal): this way,
it will be taken into account the next time you log in. If you only
add it in a terminal, it will have no effect on other terminals and on
Qt Designer if you are executing it from a system menu shortcut.

To simply test this, you'll have to execute Qt Designer just after
adding the environment variable, i.e. in the same terminal.

Pierre

sebastian06

unread,
Oct 10, 2010, 4:03:23 AM10/10/10
to python(x,y)
Hi Pierre,

this is what I also found out and i addes the following lines to
my .profile and .bashrc file

...
# Add a directory to PYTHONPATH
export PYTHONPATH=/home/sebi/Appilcations/QtDesigner_Plugins:
$PYTHONPATH
# Add a directory to QTDESIGNERPATH
export QTDESIGNERPATH=/home/sebi/Appications/QtDesigner_Plugins:
$PYTHONPATH

This directory contains the matplotlibplugin.py

Now both environment variables are there right after loggin in.

But unfortunately the widget just refuses to show up inside the
QtDesigner.

Cheers,

Sebi
Reply all
Reply to author
Forward
0 new messages