Commit c96458cf authored by Bryant's avatar Bryant

Update Qwt to 6.1.

We also document how we got the source code and keep our modifications out of the Qwt directory.
parent 2e4ac6be
This folder contains the various required libraries for QGC to compile. They are distributed with the codebase to ease development.
# Qwt
Qt Widgets for Technical Applications
Version: 6.1
Source obtained: `svn checkout svn://svn.code.sf.net/p/qwt/code/branches/qwt-6.1 qwt`
Contents of `/libs/qwt` is the contents of the `/src` directory from the Qwt repository.
qwt.pri file is custom made to compile all necessary Qwt code in with QGC.
######################################################################
# Automatically generated by qmake (2.01a) Wed Feb 10 11:43:43 2010
######################################################################
QWTSRCDIR = libs/qwt
DEPENDPATH += $$QWTSRCDIR
INCLUDEPATH += $$QWTSRCDIR
# Input
HEADERS += $$QWTSRCDIR/qwt.h \
$$QWTSRCDIR/qwt_abstract_legend.h \
$$QWTSRCDIR/qwt_abstract_scale.h \
$$QWTSRCDIR/qwt_abstract_scale_draw.h \
$$QWTSRCDIR/qwt_abstract_slider.h \
$$QWTSRCDIR/qwt_analog_clock.h \
$$QWTSRCDIR/qwt_arrow_button.h \
$$QWTSRCDIR/qwt_clipper.h \
$$QWTSRCDIR/qwt_color_map.h \
$$QWTSRCDIR/qwt_compass.h \
$$QWTSRCDIR/qwt_compass_rose.h \
$$QWTSRCDIR/qwt_counter.h \
$$QWTSRCDIR/qwt_curve_fitter.h \
$$QWTSRCDIR/qwt_dial.h \
$$QWTSRCDIR/qwt_dial_needle.h \
$$QWTSRCDIR/qwt_dyngrid_layout.h \
$$QWTSRCDIR/qwt_event_pattern.h \
$$QWTSRCDIR/qwt_global.h \
$$QWTSRCDIR/qwt_graphic.h \
$$QWTSRCDIR/qwt_interval.h \
$$QWTSRCDIR/qwt_knob.h \
$$QWTSRCDIR/qwt_legend.h \
$$QWTSRCDIR/qwt_legend_data.h \
$$QWTSRCDIR/qwt_legend_label.h \
$$QWTSRCDIR/qwt_magnifier.h \
$$QWTSRCDIR/qwt_math.h \
$$QWTSRCDIR/qwt_null_paintdevice.h \
$$QWTSRCDIR/qwt_painter.h \
$$QWTSRCDIR/qwt_painter_command.h \
$$QWTSRCDIR/qwt_panner.h \
$$QWTSRCDIR/qwt_picker.h \
$$QWTSRCDIR/qwt_picker_machine.h \
$$QWTSRCDIR/qwt_pixel_matrix.h \
$$QWTSRCDIR/qwt_plot.h \
$$QWTSRCDIR/qwt_plot_canvas.h \
$$QWTSRCDIR/qwt_plot_curve.h \
$$QWTSRCDIR/qwt_plot_dict.h \
$$QWTSRCDIR/qwt_plot_grid.h \
$$QWTSRCDIR/qwt_plot_item.h \
$$QWTSRCDIR/qwt_plot_layout.h \
$$QWTSRCDIR/qwt_plot_magnifier.h \
$$QWTSRCDIR/qwt_plot_marker.h \
$$QWTSRCDIR/qwt_plot_panner.h \
$$QWTSRCDIR/qwt_plot_picker.h \
$$QWTSRCDIR/qwt_plot_rasteritem.h \
$$QWTSRCDIR/qwt_plot_scaleitem.h \
$$QWTSRCDIR/qwt_plot_seriesitem.h \
$$QWTSRCDIR/qwt_plot_spectrogram.h \
$$QWTSRCDIR/qwt_plot_svgitem.h \
$$QWTSRCDIR/qwt_plot_zoomer.h \
$$QWTSRCDIR/qwt_point_mapper.h \
$$QWTSRCDIR/qwt_point_data.h \
$$QWTSRCDIR/qwt_raster_data.h \
$$QWTSRCDIR/qwt_round_scale_draw.h \
$$QWTSRCDIR/qwt_scale_div.h \
$$QWTSRCDIR/qwt_scale_draw.h \
$$QWTSRCDIR/qwt_scale_engine.h \
$$QWTSRCDIR/qwt_scale_map.h \
$$QWTSRCDIR/qwt_scale_widget.h \
$$QWTSRCDIR/qwt_series_data.h \
$$QWTSRCDIR/qwt_slider.h \
$$QWTSRCDIR/qwt_spline.h \
$$QWTSRCDIR/qwt_symbol.h \
$$QWTSRCDIR/qwt_text.h \
$$QWTSRCDIR/qwt_text_engine.h \
$$QWTSRCDIR/qwt_text_label.h \
$$QWTSRCDIR/qwt_thermo.h \
$$QWTSRCDIR/qwt_transform.h \
$$QWTSRCDIR/qwt_wheel.h \
$$QWTSRCDIR/qwt_widget_overlay.h
SOURCES += $$QWTSRCDIR/qwt_abstract_legend.cpp \
$$QWTSRCDIR/qwt_abstract_scale.cpp \
$$QWTSRCDIR/qwt_abstract_scale_draw.cpp \
$$QWTSRCDIR/qwt_abstract_slider.cpp \
$$QWTSRCDIR/qwt_analog_clock.cpp \
$$QWTSRCDIR/qwt_arrow_button.cpp \
$$QWTSRCDIR/qwt_clipper.cpp \
$$QWTSRCDIR/qwt_color_map.cpp \
$$QWTSRCDIR/qwt_compass.cpp \
$$QWTSRCDIR/qwt_compass_rose.cpp \
$$QWTSRCDIR/qwt_counter.cpp \
$$QWTSRCDIR/qwt_curve_fitter.cpp \
$$QWTSRCDIR/qwt_dial.cpp \
$$QWTSRCDIR/qwt_dial_needle.cpp \
$$QWTSRCDIR/qwt_dyngrid_layout.cpp \
$$QWTSRCDIR/qwt_event_pattern.cpp \
$$QWTSRCDIR/qwt_graphic.cpp \
$$QWTSRCDIR/qwt_interval.cpp \
$$QWTSRCDIR/qwt_knob.cpp \
$$QWTSRCDIR/qwt_legend.cpp \
$$QWTSRCDIR/qwt_legend_data.cpp \
$$QWTSRCDIR/qwt_legend_label.cpp \
$$QWTSRCDIR/qwt_magnifier.cpp \
$$QWTSRCDIR/qwt_math.cpp \
$$QWTSRCDIR/qwt_null_paintdevice.cpp \
$$QWTSRCDIR/qwt_painter.cpp \
$$QWTSRCDIR/qwt_painter_command.cpp \
$$QWTSRCDIR/qwt_panner.cpp \
$$QWTSRCDIR/qwt_picker.cpp \
$$QWTSRCDIR/qwt_picker_machine.cpp \
$$QWTSRCDIR/qwt_pixel_matrix.cpp \
$$QWTSRCDIR/qwt_plot.cpp \
$$QWTSRCDIR/qwt_plot_axis.cpp \
$$QWTSRCDIR/qwt_plot_canvas.cpp \
$$QWTSRCDIR/qwt_plot_curve.cpp \
$$QWTSRCDIR/qwt_plot_dict.cpp \
$$QWTSRCDIR/qwt_plot_grid.cpp \
$$QWTSRCDIR/qwt_plot_item.cpp \
$$QWTSRCDIR/qwt_plot_layout.cpp \
$$QWTSRCDIR/qwt_plot_magnifier.cpp \
$$QWTSRCDIR/qwt_plot_marker.cpp \
$$QWTSRCDIR/qwt_plot_panner.cpp \
$$QWTSRCDIR/qwt_plot_picker.cpp \
$$QWTSRCDIR/qwt_plot_rasteritem.cpp \
$$QWTSRCDIR/qwt_plot_scaleitem.cpp \
$$QWTSRCDIR/qwt_plot_seriesitem.cpp \
$$QWTSRCDIR/qwt_plot_spectrogram.cpp \
$$QWTSRCDIR/qwt_plot_svgitem.cpp \
$$QWTSRCDIR/qwt_plot_xml.cpp \
$$QWTSRCDIR/qwt_plot_zoomer.cpp \
$$QWTSRCDIR/qwt_point_mapper.cpp \
$$QWTSRCDIR/qwt_point_data.cpp \
$$QWTSRCDIR/qwt_raster_data.cpp \
$$QWTSRCDIR/qwt_round_scale_draw.cpp \
$$QWTSRCDIR/qwt_scale_div.cpp \
$$QWTSRCDIR/qwt_scale_draw.cpp \
$$QWTSRCDIR/qwt_scale_engine.cpp \
$$QWTSRCDIR/qwt_scale_map.cpp \
$$QWTSRCDIR/qwt_scale_widget.cpp \
$$QWTSRCDIR/qwt_series_data.cpp \
$$QWTSRCDIR/qwt_slider.cpp \
$$QWTSRCDIR/qwt_spline.cpp \
$$QWTSRCDIR/qwt_symbol.cpp \
$$QWTSRCDIR/qwt_text.cpp \
$$QWTSRCDIR/qwt_text_engine.cpp \
$$QWTSRCDIR/qwt_text_label.cpp \
$$QWTSRCDIR/qwt_thermo.cpp \
$$QWTSRCDIR/qwt_transform.cpp \
$$QWTSRCDIR/qwt_wheel.cpp \
$$QWTSRCDIR/qwt_widget_overlay.cpp
/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
* Qwt Widget Library
* Copyright (C) 1997 Josef Wilgen
* Copyright (C) 2002 Uwe Rathmann
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the Qwt License, Version 1.0
*****************************************************************************/
#include "qwt_abstract_legend.h"
/*!
Constructor
\param parent Parent widget
*/
QwtAbstractLegend::QwtAbstractLegend( QWidget *parent ):
QFrame( parent )
{
}
//! Destructor
QwtAbstractLegend::~QwtAbstractLegend()
{
}
/*!
Return the extent, that is needed for elements to scroll
the legend ( usually scrollbars ),
\param orientation Orientation
\return Extent of the corresponding scroll element
*/
int QwtAbstractLegend::scrollExtent( Qt::Orientation orientation ) const
{
Q_UNUSED( orientation );
return 0;
}
/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
* Qwt Widget Library
* Copyright (C) 1997 Josef Wilgen
* Copyright (C) 2002 Uwe Rathmann
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the Qwt License, Version 1.0
*****************************************************************************/
#ifndef QWT_ABSTRACT_LEGEND_H
#define QWT_ABSTRACT_LEGEND_H
#include "qwt_global.h"
#include "qwt_legend_data.h"
#include <qframe.h>
#include <qlist.h>
class QVariant;
/*!
\brief Abstract base class for legend widgets
Legends, that need to be under control of the QwtPlot layout system
need to be derived from QwtAbstractLegend.
\note Other type of legends can be implemented by connecting to
the QwtPlot::legendDataChanged() signal. But as these legends
are unknown to the plot layout system the layout code
( on screen and for QwtPlotRenderer ) need to be organized
in application code.
\sa QwtLegend
*/
class QWT_EXPORT QwtAbstractLegend : public QFrame
{
Q_OBJECT
public:
explicit QwtAbstractLegend( QWidget *parent = NULL );
virtual ~QwtAbstractLegend();
/*!
Render the legend into a given rectangle.
\param painter Painter
\param rect Bounding rectangle
\param fillBackground When true, fill rect with the widget background
\sa renderLegend() is used by QwtPlotRenderer
*/
virtual void renderLegend( QPainter *painter,
const QRectF &rect, bool fillBackground ) const = 0;
//! \return True, when no plot item is inserted
virtual bool isEmpty() const = 0;
virtual int scrollExtent( Qt::Orientation ) const;
public Q_SLOTS:
/*!
\brief Update the entries for a plot item
\param itemInfo Info about an item
\param data List of legend entry attributes for the item
*/
virtual void updateLegend( const QVariant &itemInfo,
const QList<QwtLegendData> &data ) = 0;
};
#endif
This diff is collapsed.
......@@ -11,50 +11,85 @@
#define QWT_ABSTRACT_SCALE_H
#include "qwt_global.h"
#include <qwidget.h>
class QwtScaleEngine;
class QwtAbstractScaleDraw;
class QwtScaleDiv;
class QwtScaleMap;
class QwtDoubleInterval;
class QwtInterval;
/*!
\brief An abstract base class for classes containing a scale
\brief An abstract base class for widgets having a scale
QwtAbstractScale is used to provide classes with a QwtScaleDraw,
and a QwtScaleDiv. The QwtScaleDiv might be set explicitely
or calculated by a QwtScaleEngine.
The scale of an QwtAbstractScale is determined by a QwtScaleDiv
definition, that contains the boundaries and the ticks of the scale.
The scale is painted using a QwtScaleDraw object.
The scale division might be assigned explicitly - but usually
it is calculated from the boundaries using a QwtScaleEngine.
The scale engine also decides the type of transformation of the scale
( linear, logarithmic ... ).
*/
class QWT_EXPORT QwtAbstractScale
class QWT_EXPORT QwtAbstractScale: public QWidget
{
Q_OBJECT
Q_PROPERTY( double lowerBound READ lowerBound WRITE setLowerBound )
Q_PROPERTY( double upperBound READ upperBound WRITE setUpperBound )
Q_PROPERTY( int scaleMaxMajor READ scaleMaxMajor WRITE setScaleMaxMajor )
Q_PROPERTY( int scaleMaxMinor READ scaleMaxMinor WRITE setScaleMaxMinor )
Q_PROPERTY( double scaleStepSize READ scaleStepSize WRITE setScaleStepSize )
public:
QwtAbstractScale();
QwtAbstractScale( QWidget *parent = NULL );
virtual ~QwtAbstractScale();
void setScale(double vmin, double vmax, double step = 0.0);
void setScale(const QwtDoubleInterval &, double step = 0.0);
void setScale(const QwtScaleDiv &s);
void setScale( double lowerBound, double upperBound );
void setScale( const QwtInterval & );
void setScale( const QwtScaleDiv & );
const QwtScaleDiv& scaleDiv() const;
void setAutoScale();
bool autoScale() const;
void setLowerBound( double value );
double lowerBound() const;
void setScaleMaxMajor( int ticks);
void setUpperBound( double value );
double upperBound() const;
void setScaleStepSize( double stepSize );
double scaleStepSize() const;
void setScaleMaxMajor( int ticks );
int scaleMaxMinor() const;
void setScaleMaxMinor( int ticks);
void setScaleMaxMinor( int ticks );
int scaleMaxMajor() const;
void setScaleEngine(QwtScaleEngine *);
void setScaleEngine( QwtScaleEngine * );
const QwtScaleEngine *scaleEngine() const;
QwtScaleEngine *scaleEngine();
int transform( double ) const;
double invTransform( int ) const;
bool isInverted() const;
double minimum() const;
double maximum() const;
const QwtScaleMap &scaleMap() const;
protected:
void rescale(double vmin, double vmax, double step = 0.0);
void rescale( double lowerBound,
double upperBound, double stepSize );
void setAbstractScaleDraw( QwtAbstractScaleDraw * );
void setAbstractScaleDraw(QwtAbstractScaleDraw *);
const QwtAbstractScaleDraw *abstractScaleDraw() const;
QwtAbstractScaleDraw *abstractScaleDraw();
......
This diff is collapsed.
......@@ -14,15 +14,10 @@
#include "qwt_scale_div.h"
#include "qwt_text.h"
#if QT_VERSION < 0x040000
class QColorGroup;
#else
class QPalette;
#endif
class QPainter;
class QFont;
class QwtScaleTransformation;
class QwtTransform;
class QwtScaleMap;
/*!
......@@ -31,8 +26,7 @@ class QwtScaleMap;
QwtAbstractScaleDraw can be used to draw linear or logarithmic scales.
After a scale division has been specified as a QwtScaleDiv object
using QwtAbstractScaleDraw::setScaleDiv(const QwtScaleDiv &s),
the scale can be drawn with the QwtAbstractScaleDraw::draw() member.
using setScaleDiv(), the scale can be drawn with the draw() member.
*/
class QWT_EXPORT QwtAbstractScaleDraw
{
......@@ -40,66 +34,66 @@ public:
/*!
Components of a scale
\sa enableComponent(), hasComponent
*/
enum ScaleComponent
{
//! Backbone = the line where the ticks are located
Backbone = 0x01,
- Backbone
- Ticks
- Labels
\sa QwtAbstractScaleDraw::enableComponent,
QwtAbstractScaleDraw::hasComponent
*/
//! Ticks
Ticks = 0x02,
enum ScaleComponent {
Backbone = 1,
Ticks = 2,
Labels = 4
//! Labels
Labels = 0x04
};
//! Scale components
typedef QFlags<ScaleComponent> ScaleComponents;
QwtAbstractScaleDraw();
QwtAbstractScaleDraw( const QwtAbstractScaleDraw & );
virtual ~QwtAbstractScaleDraw();
QwtAbstractScaleDraw &operator=(const QwtAbstractScaleDraw &);
void setScaleDiv(const QwtScaleDiv &s);
void setScaleDiv( const QwtScaleDiv &s );
const QwtScaleDiv& scaleDiv() const;
void setTransformation(QwtScaleTransformation *);
const QwtScaleMap &map() const;
void setTransformation( QwtTransform * );
const QwtScaleMap &scaleMap() const;
QwtScaleMap &scaleMap();
void enableComponent(ScaleComponent, bool enable = true);
bool hasComponent(ScaleComponent) const;
void enableComponent( ScaleComponent, bool enable = true );
bool hasComponent( ScaleComponent ) const;
void setTickLength(QwtScaleDiv::TickType, int length);
int tickLength(QwtScaleDiv::TickType) const;
int majTickLength() const;
void setTickLength( QwtScaleDiv::TickType, double length );
double tickLength( QwtScaleDiv::TickType ) const;
double maxTickLength() const;
void setSpacing(int margin);
int spacing() const;
void setSpacing( double margin );
double spacing() const;
#if QT_VERSION < 0x040000
virtual void draw(QPainter *, const QColorGroup &) const;
#else
virtual void draw(QPainter *, const QPalette &) const;
#endif
void setPenWidth( int width );
int penWidth() const;
virtual void draw( QPainter *, const QPalette & ) const;
virtual QwtText label(double) const;
virtual QwtText label( double ) const;
/*!
Calculate the extent
The extent is the distcance from the baseline to the outermost
The extent is the distance from the baseline to the outermost
pixel of the scale draw in opposite to its orientation.
It is at least minimumExtent() pixels.
\param font Font used for drawing the tick labels
\return Number of pixels
\sa setMinimumExtent(), minimumExtent()
*/
virtual int extent(const QPen &, const QFont &) const = 0;
virtual double extent( const QFont &font ) const = 0;
void setMinimumExtent(int);
int minimumExtent() const;
QwtScaleMap &scaleMap();
void setMinimumExtent( double );
double minimumExtent() const;
protected:
/*!
......@@ -107,11 +101,11 @@ protected:
\param painter Painter
\param value Value of the tick
\param len Lenght of the tick
\param len Length of the tick
\sa drawBackbone(), drawLabel()
*/
virtual void drawTick(QPainter *painter, double value, int len) const = 0;
virtual void drawTick( QPainter *painter, double value, double len ) const = 0;
/*!
Draws the baseline of the scale
......@@ -119,7 +113,7 @@ protected:
\sa drawTick(), drawLabel()
*/
virtual void drawBackbone(QPainter *painter) const = 0;
virtual void drawBackbone( QPainter *painter ) const = 0;
/*!
Draws the label for a major scale tick
......@@ -127,19 +121,21 @@ protected:
\param painter Painter
\param value Value
\sa drawTick, drawBackbone
\sa drawTick(), drawBackbone()
*/
virtual void drawLabel(QPainter *painter, double value) const = 0;
virtual void drawLabel( QPainter *painter, double value ) const = 0;
void invalidateCache();
const QwtText &tickLabel(const QFont &, double value) const;
const QwtText &tickLabel( const QFont &, double value ) const;
private:
int operator==(const QwtAbstractScaleDraw &) const;
int operator!=(const QwtAbstractScaleDraw &) const;
QwtAbstractScaleDraw( const QwtAbstractScaleDraw & );
QwtAbstractScaleDraw &operator=( const QwtAbstractScaleDraw & );
class PrivateData;
PrivateData *d_data;
};
Q_DECLARE_OPERATORS_FOR_FLAGS( QwtAbstractScaleDraw::ScaleComponents )
#endif
This diff is collapsed.
......@@ -10,112 +10,95 @@
#ifndef QWT_ABSTRACT_SLIDER_H
#define QWT_ABSTRACT_SLIDER_H
#include <qwidget.h>
#include "qwt_global.h"
#include "qwt_double_range.h"
#include "qwt_abstract_scale.h"
/*!
\brief An abstract base class for slider widgets
QwtAbstractSlider is a base class for
slider widgets. It handles mouse events
and updates the slider's value accordingly. Derived classes
only have to implement the getValue() and
getScrollMode() members, and should react to a
valueChange(), which normally requires repainting.
\brief An abstract base class for slider widgets with a scale
A slider widget displays a value according to a scale.
The class is designed as a common super class for widgets like
QwtKnob, QwtDial and QwtSlider.
When the slider is nor readOnly() its value can be modified
by keyboard, mouse and wheel inputs.
The range of the slider is divided into a number of steps from
which the value increments according to user inputs depend.
Only for linear scales the number of steps correspond with
a fixed step size.
*/
class QWT_EXPORT QwtAbstractSlider : public QWidget, public QwtDoubleRange
class QWT_EXPORT QwtAbstractSlider: public QwtAbstractScale
{
Q_OBJECT
Q_PROPERTY( double value READ value WRITE setValue )
Q_PROPERTY( uint totalSteps READ totalSteps WRITE setTotalSteps )
Q_PROPERTY( uint singleSteps READ singleSteps WRITE setSingleSteps )
Q_PROPERTY( uint pageSteps READ pageSteps WRITE setPageSteps )
Q_PROPERTY( bool stepAlignment READ stepAlignment WRITE setStepAlignment )
Q_PROPERTY( bool readOnly READ isReadOnly WRITE setReadOnly )
Q_PROPERTY( bool valid READ isValid WRITE setValid )
Q_PROPERTY( double mass READ mass WRITE setMass )
#ifndef Q_MOC_RUN // Qt3 moc
#define QWT_PROPERTY Q_PROPERTY
Q_PROPERTY( Orientation orientation
READ orientation WRITE setOrientation )
#else // Qt4 moc
// MOC_SKIP_BEGIN
Q_PROPERTY( Qt::Orientation orientation
READ orientation WRITE setOrientation )
// MOC_SKIP_END
#endif
Q_PROPERTY( bool tracking READ isTracking WRITE setTracking )
Q_PROPERTY( bool wrapping READ wrapping WRITE setWrapping )
Q_PROPERTY( bool invertedControls READ invertedControls WRITE setInvertedControls )
public:
/*!
Scroll mode
\sa getScrollMode()
*/
enum ScrollMode {
ScrNone,
ScrMouse,
ScrTimer,
ScrDirect,
ScrPage
};
explicit QwtAbstractSlider(Qt::Orientation, QWidget *parent = NULL);
explicit QwtAbstractSlider( QWidget *parent = NULL );
virtual ~QwtAbstractSlider();
void setUpdateTime(int t);
void stopMoving();
void setTracking(bool enable);
void setValid( bool );
bool isValid() const;
virtual void setMass(double val);
virtual double mass() const;
double value() const;
#if QT_VERSION >= 0x040000
virtual void setOrientation(Qt::Orientation o);
Qt::Orientation orientation() const;
#else
virtual void setOrientation(Orientation o);
Orientation orientation() const;
#endif
void setWrapping( bool );
bool wrapping() const;
bool isReadOnly() const;
void setTotalSteps( uint );
uint totalSteps() const;