1
/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
3
* Copyright (C) 1997 Josef Wilgen
4
* Copyright (C) 2002 Uwe Rathmann
6
* This library is free software; you can redistribute it and/or
7
* modify it under the terms of the Qwt License, Version 1.0
8
*****************************************************************************/
12
#ifndef QWT_PLOT_CANVAS_H
13
#define QWT_PLOT_CANVAS_H
17
#include "qwt_global.h"
23
\brief Canvas of a QwtPlot.
28
class QWT_EXPORT QwtPlotCanvas : public QFrame
36
\brief Paint attributes
39
Paint double buffered and reuse the content of the pixmap buffer
40
for some spontaneous repaints that happen when a plot gets unhidden,
41
deiconified or changes the focus.
42
Disabling the cache will improve the performance for
43
incremental paints (using QwtPlotCurve::draw).
46
Suppress system background repaints and paint it together with
48
Painting packed might avoid flickering for expensive repaints,
49
when there is a notable gap between painting the background
50
and the plot contents.
52
The default setting enables PaintCached and PaintPacked
54
\sa setPaintAttribute(), testPaintAttribute(), paintCache()
63
\brief Focus indicator
66
Don't paint a focus indicator
68
- CanvasFocusIndicator\n
69
The focus is related to the complete canvas.
70
Paint the focus indicator using paintFocus()
72
- ItemFocusIndicator\n
73
The focus is related to an item (curve, point, ...) on
74
the canvas. It is up to the application to display a
75
focus indication using f.e. highlighting.
77
\sa setFocusIndicator(), focusIndicator(), paintFocus()
87
void setFocusIndicator(FocusIndicator);
88
FocusIndicator focusIndicator() const;
90
void setPaintAttribute(PaintAttribute, bool on = true);
91
bool testPaintAttribute(PaintAttribute) const;
93
QPixmap *paintCache();
94
const QPixmap *paintCache() const;
95
void invalidatePaintCache();
98
explicit QwtPlotCanvas(QwtPlot *);
99
virtual ~QwtPlotCanvas();
101
virtual void hideEvent(QHideEvent *);
103
virtual void paintEvent(QPaintEvent *);
105
virtual void drawContents(QPainter *);
106
virtual void drawFocusIndicator(QPainter *);
108
void drawCanvas(QPainter *painter = NULL);
111
void setSystemBackground(bool);