PyQwt Module Reference

The following sections should be used in conjunction with the normal class documentation - only the differences specific to the Python bindings are documented here. Personally, I tend to use "man 3 qwtplot" and friends.

In these sections, is not yet implemented implies that the feature can be easily implemented if needed, is not implemented implies that the feature is not easily implemented, and is not Pythonic implies that the feature will not be implemented because it violates the Python philosophy (e.g. dangling pointers).

If a class is described as being fully implemented then all non-private member functions and all public class variables have been implemented.

Classes that are not mentioned have not yet been implemented. Sometimes, a sip interface file exists for classes, that are not documented in the man pages of the Qwt library. In this case, inclusion of the relevant interface file has been commented out in sip/qwt.sip. Let me know, if you have a real use for such a class.

The classes in the Qwt library have quite a few protected attributes. They are not yet available in Python (sip used to wrap protected member function, but not protected attributes). I will implement protected attributes on demand.

QwtArrowButton

QwtArrowButton is fully implemented.

QwtAutoScale

C++ declaration:
void adjust(double minVal, double maxVal, int reset = 0);
void adjust(double* x, int size, int reset = 0);
Python usage:
	autoScale.adjust(minVal, maxVal, reset = 0)
	autoScale.adjust(x, reset = 0)
The first form takes two Python floats and an integer boolean. The second form takes a list, tuple or NumPy array of Python floats and an integer boolean.

QwtCounter

QwtCounter is fully implemented.

QwtCurve

C++ declaration:
void setData(double* x, double* y, int size)
Python usage:
	curve.setData(x, y)
x and y can be any combination of lists, tuples and NumPy arrays of Python floats. All sequences are internally truncated to the length of the shortest sequence.

C++ declaration:
void setRawData(double* x, double* y, int size)
setRawData is not Pythonic.

C++ declaration:
int verifyRange(int& i1, int& i2);
Python usage:
	length, first, last = curve.verifyRange(i1, i2)

QwtDiMap

QwtDiMap is fully implemented.

QwtDblRange

QwtDblRange is fully implemented.

Qwt

Qwt is fully implemented.

QwtGrid

QwtGrid is fully implemented.

QwtKnob

QwtKnob is fully implemented. See QwtSliderBase.

QwtLegend

QwtLegend is fully implemented.

QwtLegendItem

QwtLegendItem is fully implemented.

QwtMarker

QwtMarker is fully implemented.

QwtPlot

C++ declaration:
void print(QPrinter &, const QwtPlotPrintFilter &);
void print(QPainter *, const QRect &, const QwtPlotPrintFilter &);
print has been renamed to printPlot in Python.

C++ declaration:
QArray<long> curveKeys() const;
curveKeys returns a list containing the keys of all curves.

C++ declaration:
long closestCurve(int xPos, int yPos, int& distance) const;
long closestCurve(int xPos, int yPos, int& distance,
		  double& xVal, double& yVal, int& index) const; 
Python usage:
	key, distance, xVal, yVal, index = plot.closestCurve(xPos, yPos)

C++ declaration:
bool setCurveData(long key, double *x, double *y, int size);
Python usage:
	plot.setCurveData(key, x, y)
key is an index to the curve and x and y are any combination of lists, tuples or NumPy arrays of Python floats. All sequences are internally truncated to the length of the shortest sequence.

C++ declaration:
bool setCurveRawData(long key, double* x, double* y, int size);
setCurveRawData is not Pythonic.

C++ declaration:
bool axisMargins(int axis, double& lowMargin, double& highMargin) const;
Python usage:
	valid, lowMargin, highMargin = plot.axisMargins(axis)
If the axis is valid, valid=1. If the axis is invalid, valid=0.

C++ declaration:
void axisLabelFormat(int axis, char& format, int& precision, int& width) const;
Python usage:
	format, precision, width = plot.axisLabelFormat(axis)

C++ declaration:
long closestMarker(int xPos, int yPos, int& distance) const;
Python usage:
	key, distance = plot.closestMarker(xPos, yPos)
closestMarker takes the x- and y-coordinates of a point and returns a tuple containing the key of the closest marker and the distance between the closest marker and the point.

C++ declaration:
QArray<long> markerKeys() const;
markerKeys returns a list containing the keys of all markers.

C++ declaration:
void markerPos(long key, double& x, double& y) const;
Python usage:
	x, y = plot.markerPos(key)
markerPos takes the key of a marker and returns a tuple containing the x- and y-coordinates.

QwtPlotCanvas

QwtPlotCanvas is fully implemented.

QwtPlotItem

QwtPlotItem is fully implemented.

QwtPlotMappedItem

QwtPlotMappedItem is fully implemented.

QwtPlotPrintFilter

QwtPlotPrintFilter is fully implemented.

QwtScale

C++ declaration:
void labelFormat(char& format, int& precision, int& width) const;
Python usage:
	format, precision, width = scale.labelFormat()

QwtScaleDiv

QwtScaleDiv is fully implemented.

QwtScaleDraw

QwtScaleDraw is fully implemented.

QwtScaleIf

QwtScaleIf is fully implemented.

QwtSliderBase

QwtSliderBase is fully implemented.

C++ declaration:
virtual void getScrollMode(const QPoint& point, int& scrollMode, int& direction) = 0;
Python usage:
	scrollMode, direction = sliderBase.getScrollMode(point)
See QwtKnob, QwtSlider and QwtWheel.

QwtSlider

QwtSlider is fully implemented. See QwtSliderBase.

QwtSpline

C++ declaration:
int recalc(double* x, double* y, int n, bool periodic = 0);
Python usage:
	errorCode = spline.recalc(x, y, periodic)
x and y are two sequences of Python floats or C doubles and periodic a boolean integer. The sequences can be a list, a tuple or a NumPy array and all sequences are internally truncated to the length of the shortest sequence.

C++ declaration:
void copyValues(int enable = 1);
copyValues is not Pythonic.

QwtSymbol

QwtSymbol is fully implemented.

QwtThermo

QwtThermo is fully implemented.

QwtWheel

QwtWheel is fully implemented. See QwtSliderBase.