Public Member Functions | |
~QwtGuardedPainter () | |
QPainter * | begin (QwtPlotCanvas *canvas) |
void | end () |
virtual bool | eventFilter (QObject *, QEvent *event) |
Definition at line 77 of file qwt_plot_curve.cpp.
QwtGuardedPainter::~QwtGuardedPainter | ( | ) | [inline] |
QPainter* QwtGuardedPainter::begin | ( | QwtPlotCanvas * | canvas ) | [inline] |
Definition at line 85 of file qwt_plot_curve.cpp.
Referenced by QwtPlotCurve::draw().
{ _canvas = canvas; QMap<QwtPlotCanvas *, QPainter *>::iterator it = _map.find(_canvas); if ( it == _map.end() ) { QPainter *painter = new QPainter(_canvas); painter->setClipping(true); painter->setClipRect(_canvas->contentsRect()); it = _map.insert(_canvas, painter); _canvas->installEventFilter(this); } #if QT_VERSION < 0x040000 return it.data(); #else return it.value(); #endif }
void QwtGuardedPainter::end | ( | ) | [inline] |
Definition at line 106 of file qwt_plot_curve.cpp.
Referenced by eventFilter(), and ~QwtGuardedPainter().
{ if ( _canvas ) { QMap<QwtPlotCanvas *, QPainter *>::iterator it = _map.find(_canvas); if ( it != _map.end() ) { _canvas->removeEventFilter(this); #if QT_VERSION < 0x040000 delete it.data(); #else delete it.value(); #endif _map.erase(it); } } }
virtual bool QwtGuardedPainter::eventFilter | ( | QObject * | , |
QEvent * | event | ||
) | [inline, virtual] |
Definition at line 125 of file qwt_plot_curve.cpp.
References end().
{ if ( event->type() == QEvent::Paint ) end(); return false; }