[PyQt] designer segfaults on startup after installing libpythonplugin.so and custom widget

Glen W. Mabey Glen.Mabey at swri.org
Mon Feb 4 17:45:02 GMT 2008


Hello,

I am creating a designer plugin widget for matplotlib.

I am able to import the python source file (included below) that subclasses
QtDesigner.QPyDesignerCustomWidgetPlugin without errors.  However, when
I run designer, it segfaults.

Python 2.5.1
qt 4.3.3
pyqt 4.3.3

Is there something obvious I'm missing?

Any suggestions for how to proceed?

Thanks,
Glen



from PyQt4 import QtGui, QtDesigner
from SigExp.gui.mplwidget import MatplotlibWidget

#from mplwidgetpluginicon import _logo_pixmap

class PyAnalogClockPlugin(QtDesigner.QPyDesignerCustomWidgetPlugin):
   #_logo_pixmap = QtGui.QPixmap(_logo_16x16_xpm)

    def __init__(self, parent = None):
        QtDesigner.QPyDesignerCustomWidgetPlugin.__init__(self)
        self.initialized = False

    def initialize(self, core):
        if self.initialized:
            return

        self.initialized = True

    def isInitialized(self):
        return self.initialized

    def createWidget(self, parent):
        return MatplotlibWidget(parent)

    def name(self):
        return "MatplotlibWidget"

   #def group(self):
   #    return "PyQt Examples"

    def icon(self):
   #    return QtGui.QIcon(_logo_pixmap)
        return QtGui.QIcon()

    def toolTip(self):
        return ""

    def whatsThis(self):
        return ""

    def isContainer(self):
        return False

    def domXml(self):
        return ( '<widget class="MatplotlibWidget" name=\"MatplotlibWidget\">\n'
                 ' <property name=\"toolTip\" >\n'
                 '  <string>A matplotlib canvas</string>\n'
                 ' </property>\n'
                 ' <property name=\"whatsThis\" >\n'
                 '  <string>A MATLAB-like 2-D plotting facility.</string>\n'
                 ' </property>\n'
                 '</widget>\n' )

    def includeFile(self):
        return "SigExp.gui.mplwidget"


More information about the PyQt mailing list