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
*****************************************************************************/
10
#ifndef QWT_PLOT_LAYOUT_H
11
#define QWT_PLOT_LAYOUT_H
13
#include "qwt_global.h"
17
\brief Layout engine for QwtPlot.
19
It is used by the QwtPlot widget to organize its internal widgets
20
or by QwtPlot::print() to render its content to a QPaintDevice like
21
a QPrinter, QPixmap/QImage or QSvgRenderer.
24
class QWT_EXPORT QwtPlotLayout
28
Options to configure the plot layout engine
33
Ignore the dimension of the scrollbars. There are no
34
scrollbars, when the plot is rendered to a paint device
37
Ignore all frames. QwtPlot::print() doesn't paint them.
54
explicit QwtPlotLayout();
55
virtual ~QwtPlotLayout();
60
void setCanvasMargin(int margin, int axis = -1);
61
int canvasMargin(int axis) const;
63
void setAlignCanvasToScales(bool);
64
bool alignCanvasToScales() const;
69
void setLegendPosition(QwtPlot::LegendPosition pos, double ratio);
70
void setLegendPosition(QwtPlot::LegendPosition pos);
71
QwtPlot::LegendPosition legendPosition() const;
73
void setLegendRatio(double ratio);
74
double legendRatio() const;
76
virtual QSize minimumSizeHint(const QwtPlot *) const;
78
virtual void activate(const QwtPlot *,
79
const QRect &rect, int options = 0);
81
virtual void invalidate();
83
const QRect &titleRect() const;
84
const QRect &legendRect() const;
85
const QRect &scaleRect(int axis) const;
86
const QRect &canvasRect() const;
92
QRect layoutLegend(int options, const QRect &) const;
93
QRect alignLegend(const QRect &canvasRect,
94
const QRect &legendRect) const;
96
void expandLineBreaks(int options, const QRect &rect,
97
int &dimTitle, int dimAxes[QwtPlot::axisCnt]) const;
99
void alignScales(int options, QRect &canvasRect,
100
QRect scaleRect[QwtPlot::axisCnt]) const;