Loading...
Searching...
No Matches
qwt_plot_abstract_canvas.h
/******************************************************************************
* 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_ABSTRACT_CANVAS_H
#define QWT_PLOT_ABSTRACT_CANVAS_H
#include "qwt_global.h"
#include <qframe.h>
class QwtPlot;
class QWT_EXPORT QwtPlotAbstractCanvas
{
public:
enum FocusIndicator
{
NoFocusIndicator,
CanvasFocusIndicator,
ItemFocusIndicator
};
explicit QwtPlotAbstractCanvas( QWidget* canvasWidget );
virtual ~QwtPlotAbstractCanvas();
QwtPlot* plot();
const QwtPlot* plot() const;
void setFocusIndicator( FocusIndicator );
FocusIndicator focusIndicator() const;
void setBorderRadius( double );
double borderRadius() const;
protected:
QWidget* canvasWidget();
const QWidget* canvasWidget() const;
virtual void drawFocusIndicator( QPainter* );
virtual void drawBorder( QPainter* );
virtual void drawBackground( QPainter* );
void fillBackground( QPainter* );
void drawCanvas( QPainter* );
void drawStyled( QPainter*, bool );
void drawUnstyled( QPainter* );
QPainterPath canvasBorderPath( const QRect& rect ) const;
void updateStyleSheetInfo();
private:
Q_DISABLE_COPY(QwtPlotAbstractCanvas)
class PrivateData;
PrivateData* m_data;
};
class QWT_EXPORT QwtPlotAbstractGLCanvas : public QwtPlotAbstractCanvas
{
public:
enum PaintAttribute
{
BackingStore = 1,
ImmediatePaint = 8,
};
Q_DECLARE_FLAGS( PaintAttributes, PaintAttribute )
explicit QwtPlotAbstractGLCanvas( QWidget* canvasWidget );
virtual ~QwtPlotAbstractGLCanvas();
void setPaintAttribute( PaintAttribute, bool on = true );
bool testPaintAttribute( PaintAttribute ) const;
void setFrameStyle( int style );
int frameStyle() const;
void setFrameShadow( QFrame::Shadow );
QFrame::Shadow frameShadow() const;
void setFrameShape( QFrame::Shape );
QFrame::Shape frameShape() const;
void setLineWidth( int );
int lineWidth() const;
void setMidLineWidth( int );
int midLineWidth() const;
int frameWidth() const;
QRect frameRect() const;
virtual void invalidateBackingStore() = 0;
protected:
void replot();
void draw( QPainter* );
private:
virtual void clearBackingStore() = 0;
class PrivateData;
PrivateData* m_data;
};
Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPlotAbstractGLCanvas::PaintAttributes )
#endif
QwtPlotAbstractCanvas
Base class for all type of plot canvases.
Definition qwt_plot_abstract_canvas.h:22
QwtPlotAbstractCanvas::FocusIndicator
FocusIndicator
Focus indicator The default setting is NoFocusIndicator.
Definition qwt_plot_abstract_canvas.h:31
QwtPlotAbstractCanvas::NoFocusIndicator
@ NoFocusIndicator
Don't paint a focus indicator.
Definition qwt_plot_abstract_canvas.h:33
QwtPlotAbstractCanvas::CanvasFocusIndicator
@ CanvasFocusIndicator
Definition qwt_plot_abstract_canvas.h:39
QwtPlotAbstractGLCanvas
Base class of QwtPlotOpenGLCanvas and QwtPlotGLCanvas.
Definition qwt_plot_abstract_canvas.h:88
QwtPlotAbstractGLCanvas::invalidateBackingStore
virtual void invalidateBackingStore()=0
Invalidate the internal backing store.
QwtPlotAbstractGLCanvas::PaintAttribute
PaintAttribute
Paint attributes.
Definition qwt_plot_abstract_canvas.h:98
QwtPlotAbstractGLCanvas::PaintAttributes
QFlags< PaintAttribute > PaintAttributes
Paint attributes.
Definition qwt_plot_abstract_canvas.h:122
QwtPlot
A 2-D plotting widget.
Definition qwt_plot.h:79