PDA

View Full Version : Qt4 designer on RPi no module named qwt_plot



chris22
18th February 2013, 10:41
Hi I have been going around in circles on this problem and Im looking for help.

I have Qt4 designer running on the latest version of raspbian on a rasbperry pi. This is ready complied Qt4 so I have not built it like other examples I have found on the forum.

Using pyuic4 to generate python GUI scripts from the UI file works OK until I try and use the Qwt widgets within QT 4 designer.

The last line in the generated gui script 'from qwt_plot import QwtPlot' causes the calling python script to give an error 'ImportError: No module named qwt_plot'

Checking /usr/include/qwt-qt4 , this folder shows qwt_plot.h

Trying a plot GUI directly from python, using Eli Bendersky's qwt_dataplot.pyw this calls QwtPlot and no problems.

I am now out of my depth and would appreciate help

thanks

ChrisW67
18th February 2013, 22:18
The module is not called "qwt_plot", from Eli Bendersky's qwt_dataplot.pyw:


import PyQt4.Qwt5 as Qwt

// and later
self.plot = Qwt.QwtPlot(self)


The include file in /usr/include/qwt-qt4 is for C++ programs and has nothing (directly) to do with Python program.s

cmoman
16th June 2013, 05:57
One way to resolve this is to create a file in the same directory called qwt_plot.py
In that file, place the line
from PyQt.Qwt5 import QwtPlot

that will allow the line
self.qwtPlot = QwtPlot(self.centralwidget)
to find and instantiate the class