Qwt User's Guide 6.0.1

- Main Page
- Related Pages
- Classes
- Files

- File List

# qwt_plot_canvas.h

    00001 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
    00002  * Qwt Widget Library
    00003  * Copyright (C) 1997   Josef Wilgen
    00004  * Copyright (C) 2002   Uwe Rathmann
    00005  *
    00006  * This library is free software; you can redistribute it and/or
    00007  * modify it under the terms of the Qwt License, Version 1.0
    00008  *****************************************************************************/
    00009
    00010 #ifndef QWT_PLOT_CANVAS_H
    00011 #define QWT_PLOT_CANVAS_H
    00012
    00013 #include "qwt_global.h"
    00014 #include <qframe.h>
    00015 #include <qpen.h>
    00016 #include <qpainterpath.h>
    00017 #include <qbitmap.h>
    00018
    00019 class QwtPlot;
    00020 class QPixmap;
    00021
    00026 class QWT_EXPORT QwtPlotCanvas : public QFrame
    00027 {
    00028     Q_OBJECT
    00029
    00030 public:
    00031
    00039     enum PaintAttribute
    00040     {
    00052         BackingStore = 1,
    00053
    00069         Opaque       = 2,
    00070
    00086         HackStyledBackground = 4,
    00087
    00094         ImmediatePaint = 8
    00095     };
    00096
    00098     typedef QFlags<PaintAttribute> PaintAttributes;
    00099
    00118     enum FocusIndicator
    00119     {
    00120         NoFocusIndicator,
    00121         CanvasFocusIndicator,
    00122         ItemFocusIndicator
    00123     };
    00124
    00125     explicit QwtPlotCanvas( QwtPlot * );
    00126     virtual ~QwtPlotCanvas();
    00127
    00128     QwtPlot *plot();
    00129     const QwtPlot *plot() const;
    00130
    00131     void setFocusIndicator( FocusIndicator );
    00132     FocusIndicator focusIndicator() const;
    00133
    00134     void setBorderRadius( double );
    00135     double borderRadius() const;
    00136
    00137     QPainterPath borderPath( const QRect &rect ) const;
    00138     QBitmap borderMask( const QSize & ) const;
    00139
    00140     void setPaintAttribute( PaintAttribute, bool on = true );
    00141     bool testPaintAttribute( PaintAttribute ) const;
    00142
    00143     const QPixmap *backingStore() const;
    00144     void invalidateBackingStore();
    00145
    00146     void replot();
    00147
    00148     virtual bool event( QEvent * );
    00149
    00150 protected:
    00151     virtual void paintEvent( QPaintEvent * );
    00152     virtual void resizeEvent( QResizeEvent * );
    00153
    00154     virtual void drawFocusIndicator( QPainter * );
    00155     virtual void drawBorder( QPainter * );
    00156
    00157     void updateStyleSheetInfo();
    00158
    00159 private:
    00160     void drawCanvas( QPainter *, bool withBackground );
    00161
    00162     class PrivateData;
    00163     PrivateData *d_data;
    00164 };
    00165
    00166 Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPlotCanvas::PaintAttributes )
    00167
    00168 #endif