qwt 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 will not be implemented, either because it cannot be or because it is not appropriate.

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 available in Python (sip wraps protected member function, but does not wrap protected attributes).

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.

QwtColorFilter - QwtFltrDim - QwtFltrGray - QwtFilterInv

QwtColorFilter, QwtFltrDim, QwtFltrGray and QwtFilterInv are fully implemented.

QwtCounter

QwtCounter is fully implemented.

QwtCurve

C++ declaration:
void setData(double* x, double* y, int size)
void setData(double* x, double* y, double* e, int size);
Python usage:
	curve.setData(x, y)
	curve.setData(x, y, e)
x, y and e 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)
void setRawData(double* x, double* y, double* e, int size);
setRawData is not implemented, because it really clashes with the Python philosophy.

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.

QwtLegend

QwtLegend is fully implemented.

QwtLegendItem

QwtLegendItem is fully implemented.

QwtMarker

QwtMarker is fully implemented.

QwtPixFrame

QwtPixFrame is fully implemented.

QwtPlot

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

C++ declaration:
bool setCurveData(long key, double *x, double *y, int size);
bool setCurveData(long key, double *x, double *y, double *e, int size);
Python usage:
	plot.setCurveData(key, x, y)
	plot.setCurveData(key, x, y, e)
key is an index to the curve and x, y and e 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);
bool setCurveRawData(long key, double* x, double* y, double* e, int size);
setCurveRawData is not implemented, because it really clashes with the Python philosophy.

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:
QArray<long> curveKeys() const;
curveKeys returns a list containing the keys of all curves.

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) const;
Python usage:
	format, precision = 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 enableLegend(bool flag);
Python usage:
	plot.enableLegend(flag, key = -1)
enableLegend takes a boolean integer and an optional curve key as argument. If no curve key is given, the legend items of all curves are enabled or disabled depending on the value of flag. If a curve key is given, only the legend of the specified curve is enabled or disabled. This feature is not (yet?) implemented in the Qwt CVS.

QwtScale

C++ declaration:
void enableTitle(bool flag);
enableTitle is not implemented, the C++ code is missing.

void labelFormat(char& format, int& precision)
Python usage:
	format, precision = scale.labelFormat()

QwtScaleDiv

QwtScaleDiv is fully implemented.

QwtScaleIf

QwtScaleIf is fully implemented.

QwtSliderBase

QwtBaseSlider is fully implemented.

C++ declaration:
virtual void getScrollMode(const QPoint& point, int& scrollMode, int& scrollDirection) = 0;
This works, but do not ask me how. This holds also for QwtKnob, QwtSlider and QwtWheel.

QwtSlider

QwtSlider is fully implemented.

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 implemented, because it clashes with the Python philosophy.

QwtThermo

QwtThermo is fully implemented.

QwtSymbol

QwtSymbol is fully implemented.

QwtWheel

QwtWheel is fully implemented.