qwt_plot_canvas.h
/* -*- 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_PLOT_CANVAS_H
#define QWT_PLOT_CANVAS_H
#include "qwt_global.h"
#include <qframe.h>
#include <qpainterpath.h>
class QwtPlot;
class QPixmap;
class QWT_EXPORT QwtPlotCanvas : public QFrame
{
Q_OBJECT
Q_PROPERTY( double borderRadius READ borderRadius WRITE setBorderRadius )
public:
enum PaintAttribute
{
BackingStore = 1,
Opaque = 2,
HackStyledBackground = 4,
ImmediatePaint = 8
};
typedef QFlags<PaintAttribute> PaintAttributes;
enum FocusIndicator
{
NoFocusIndicator,
CanvasFocusIndicator,
ItemFocusIndicator
};
explicit QwtPlotCanvas( QwtPlot * = NULL );
virtual ~QwtPlotCanvas();
QwtPlot *plot();
const QwtPlot *plot() const;
void setFocusIndicator( FocusIndicator );
FocusIndicator focusIndicator() const;
void setBorderRadius( double );
double borderRadius() const;
void setPaintAttribute( PaintAttribute, bool on = true );
bool testPaintAttribute( PaintAttribute ) const;
const QPixmap *backingStore() const;
void invalidateBackingStore();
virtual bool event( QEvent * );
Q_INVOKABLE QPainterPath borderPath( const QRect & ) const;
public Q_SLOTS:
void replot();
protected:
virtual void paintEvent( QPaintEvent * );
virtual void resizeEvent( QResizeEvent * );
virtual void drawFocusIndicator( QPainter * );
virtual void drawBorder( QPainter * );
void updateStyleSheetInfo();
private:
void drawCanvas( QPainter *, bool withBackground );
class PrivateData;
PrivateData *d_data;
};
Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPlotCanvas::PaintAttributes )
#endif
QwtPlotCanvas::PaintAttribute
PaintAttribute
Paint attributes.
Definition: qwt_plot_canvas.h:43
QwtPlot
A 2-D plotting widget.
Definition: qwt_plot.h:76
QwtPlotCanvas::PaintAttributes
QFlags< PaintAttribute > PaintAttributes
Paint attributes.
Definition: qwt_plot_canvas.h:101
QwtPlotCanvas::NoFocusIndicator
@ NoFocusIndicator
Don't paint a focus indicator.
Definition: qwt_plot_canvas.h:112
QwtPlotCanvas::CanvasFocusIndicator
@ CanvasFocusIndicator
Definition: qwt_plot_canvas.h:118
QwtPlotCanvas::FocusIndicator
FocusIndicator
Focus indicator The default setting is NoFocusIndicator.
Definition: qwt_plot_canvas.h:110
QwtPlotCanvas
Canvas of a QwtPlot.
Definition: qwt_plot_canvas.h:28