[Qgis-developer] Qwt widgets in Qgis

Barry Rowlingson b.rowlingson at lancaster.ac.uk
Sun May 11 05:48:35 EDT 2008


   I just noticed that Qgis (0.10.0-Io, Windows XP) seems to have the Qwt
widget stuff included, including Python bindings.  Thought this might be
useful, so I started playing with it in a Python command line.  Qwt lets
me do stuff like this to get a blank X-Y plot - this works fine from a
DOS command-line Python:

    from PyQt4.QtCore import *
    from PyQt4.QtGui import *
    app=QApplication([])
    import PyQt4.Qwt5
    myPlot = PyQt4.Qwt5.QwtPlot()
    myPlot.show()

   but if I try that from the QGis Python console (actually, just the
last three lines, don't do QApplication() from the console), Qgis
crashes out when I call QwtPlot() to instantiate a plot object.

   There's some differences: my command-line python is 2.5.1 and my qgis
python is 2.5.2. Versions of Qwt5 are the same (5.0.2) and my pythons
are getting Qwt5 from the right places - Qgis gets it from its python
folder, and command-line python gets it from C:\\Python25\\blahblabla.

   Does this happen to anyone else on this or other platforms?  And also,
is there a guarantee that Qwt will be available in Qgis releases?  It
does look handy for scientific applications - not just the plots, there
are some useful widgets in there too (floating point sliders ftw!).

Barry

#irc: spacedman


More information about the Qgis-developer mailing list