All Classes Functions Variables Typedefs Enumerations Enumerator Pages
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