QwtPlotPrintFilter Class Reference

List of all members.

Detailed Description

A base class for plot print filters.

A print filter can be used to customize QwtPlot::print().

Deprecated:
In Qwt 5.0 the design of QwtPlot allows/recommends writing individual QwtPlotItems, that are not known to QwtPlotPrintFilter. So this concept is outdated and QwtPlotPrintFilter will be removed/replaced in Qwt 6.x.

Definition at line 30 of file qwt_plot_printfilter.h.

Public Types

enum  Options {
  PrintMargin = 1,
  PrintTitle = 2,
  PrintLegend = 4,
  PrintGrid = 8,
  PrintCanvasBackground = 16,
  PrintWidgetBackground = 32,
  PrintAll = ~PrintWidgetBackground
}
enum  Item {
  Title,
  Legend,
  Curve,
  CurveSymbol,
  Marker,
  MarkerSymbol,
  MajorGrid,
  MinorGrid,
  CanvasBackground,
  AxisScale,
  AxisTitle,
  WidgetBackground
}

Public Member Functions

 QwtPlotPrintFilter ()
virtual ~QwtPlotPrintFilter ()
virtual QColor color (const QColor &, Item item) const
virtual QFont font (const QFont &, Item item) const
void setOptions (int options)
int options () const
virtual void apply (QwtPlot *) const
virtual void reset (QwtPlot *) const
virtual void apply (QwtPlotItem *) const
virtual void reset (QwtPlotItem *) const


Member Enumeration Documentation

enum QwtPlotPrintFilter::Options

Print options.

Enumerator:
PrintMargin 
PrintTitle 
PrintLegend 
PrintGrid 
PrintCanvasBackground 
PrintWidgetBackground 
PrintAll 

Definition at line 34 of file qwt_plot_printfilter.h.

enum QwtPlotPrintFilter::Item

Print items.

Enumerator:
Title 
Legend 
Curve 
CurveSymbol 
Marker 
MarkerSymbol 
MajorGrid 
MinorGrid 
CanvasBackground 
AxisScale 
AxisTitle 
WidgetBackground 

Definition at line 47 of file qwt_plot_printfilter.h.


Constructor & Destructor Documentation

QwtPlotPrintFilter::QwtPlotPrintFilter (  )  [explicit]

Sets filter options to PrintAll

Definition at line 82 of file qwt_plot_printfilter.cpp.

QwtPlotPrintFilter::~QwtPlotPrintFilter (  )  [virtual]

Destructor.

Definition at line 88 of file qwt_plot_printfilter.cpp.


Member Function Documentation

QColor QwtPlotPrintFilter::color ( const QColor &  c,
Item  item 
) const [virtual]

Modifies a color for printing.

Parameters:
c Color to be modified
item Type of item where the color belongs
Returns:
Modified color.
In case of !(QwtPlotPrintFilter::options() & PrintBackground) MajorGrid is modified to Qt::darkGray, MinorGrid to Qt::gray. All other colors are returned unmodified.

Definition at line 124 of file qwt_plot_printfilter.cpp.

References MajorGrid, MinorGrid, options(), and PrintCanvasBackground.

Referenced by apply().

QFont QwtPlotPrintFilter::font ( const QFont &  f,
Item  item 
) const [virtual]

Modifies a font for printing.

Parameters:
f Font to be modified
item Type of item where the font belongs
All fonts are returned unmodified

Definition at line 148 of file qwt_plot_printfilter.cpp.

Referenced by apply().

void QwtPlotPrintFilter::setOptions ( int  options  ) 

Set plot print options.

Parameters:
options Or'd QwtPlotPrintFilter::Options values
See also:
options()

Definition at line 99 of file qwt_plot_printfilter.cpp.

int QwtPlotPrintFilter::options (  )  const

Get plot print options.

See also:
setOptions()

Definition at line 108 of file qwt_plot_printfilter.cpp.

Referenced by color(), QwtPlot::drawItems(), QwtPlot::print(), and QwtPlot::printCanvas().

void QwtPlotPrintFilter::apply ( QwtPlot plot  )  const [virtual]

Change color and fonts of a plot

See also:
apply

Definition at line 157 of file qwt_plot_printfilter.cpp.

References QwtPlot::autoReplot(), QwtPlot::axisCnt, AxisScale, AxisTitle, QwtPlot::axisWidget(), QwtSymbol::brush(), CanvasBackground, QwtPlot::canvasBackground(), QwtText::color(), color(), Curve, CurveSymbol, QwtText::font(), font(), QwtPlotDict::itemList(), Legend, QwtPlot::legend(), QwtLegend::legendItems(), QwtText::PaintUsingTextColor, QwtText::PaintUsingTextFont, QwtSymbol::pen(), QwtPlot::setAutoReplot(), QwtSymbol::setBrush(), QwtPlot::setCanvasBackground(), QwtText::setColor(), QwtText::setFont(), QwtSymbol::setPen(), QwtText::testPaintAttribute(), QwtScaleWidget::title(), Title, QwtPlot::titleLabel(), and WidgetBackground.

Referenced by QwtPlot::print().

void QwtPlotPrintFilter::reset ( QwtPlot plot  )  const [virtual]

Reset color and fonts of a plot

See also:
apply

Definition at line 366 of file qwt_plot_printfilter.cpp.

References QwtPlot::autoReplot(), QwtPlot::axisCnt, QwtPlot::axisWidget(), QwtSymbol::brush(), QwtLegend::find(), QwtPlotDict::itemList(), QwtPlot::legend(), QwtLegend::legendItems(), QwtText::PaintUsingTextFont, QwtSymbol::pen(), QwtPlot::setAutoReplot(), QwtSymbol::setBrush(), QwtPlot::setCanvasBackground(), QwtText::setColor(), QwtSymbol::setPen(), QwtScaleWidget::setTitle(), QwtTextLabel::text(), and QwtPlot::titleLabel().

Referenced by QwtPlot::print().


Generated on Sun Jul 22 11:26:57 2007 for Qwt User's Guide by  doxygen 1.5.2