QWT API (中文) 7.3.0
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
qwt_plot_layout.h
1/******************************************************************************
2 * Qwt Widget Library
3 * Copyright (C) 1997 Josef Wilgen
4 * Copyright (C) 2002 Uwe Rathmann
5 *
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 *
9 * Modified by ChenZongYan in 2024 <czy.t@163.com>
10 * Summary of major modifications (see ChangeLog.md for full history):
11 * 1. CMake build system & C++11 throughout.
12 * 2. Core panner/ zoomer refactored:
13 * - QwtPanner -> QwtCachePanner (pixmap-cache version)
14 * - New real-time QwtPlotPanner derived from QwtPicker.
15 * 3. Zoomer supports multi-axis.
16 * 4. Parasite-plot framework:
17 * - QwtFigure, QwtPlotParasiteLayout, QwtPlotTransparentCanvas,
18 * - QwtPlotScaleEventDispatcher, built-in pan/zoom on axis.
19 * 5. New picker: QwtPlotSeriesDataPicker (works with date axis).
20 * 6. Raster & color-map extensions:
21 * - QwtGridRasterData (2-D table + interpolation)
22 * - QwtLinearColorMap::stopColors(), stopPos() API rename.
23 * 7. Bar-chart: expose pen/brush control.
24 * 8. Amalgamated build: single QwtPlot.h / QwtPlot.cpp pair in src-amalgamate.
25 ******************************************************************************/
26
27#ifndef QWT_PLOT_LAYOUT_H
28#define QWT_PLOT_LAYOUT_H
29
30#include "qwt_global.h"
31#include "qwt_plot.h"
32#include "qwt_axis_id.h"
34
42class QWT_EXPORT QwtPlotLayout
43{
44public:
49 enum Option
50 {
54 AlignScales = 0x01,
55
60 IgnoreScrollbars = 0x02,
61
65 IgnoreFrames = 0x04,
66
70 IgnoreLegend = 0x08,
71
75 IgnoreTitle = 0x10,
76
80 IgnoreFooter = 0x20
81 };
82
83 Q_DECLARE_FLAGS(Options, Option)
84
85 explicit QwtPlotLayout();
86 virtual ~QwtPlotLayout();
87
88 void setCanvasMargin(int margin, int axis = -1);
89 int canvasMargin(int axisId) const;
90
91 void setAlignCanvasToScales(bool);
92 void setAlignCanvasToScale(int axisId, bool);
93 bool alignCanvasToScale(int axisId) const;
94
95 void setSpacing(int);
96 int spacing() const;
97
98 void setLegendPosition(QwtPlot::LegendPosition pos, double ratio);
99 void setLegendPosition(QwtPlot::LegendPosition pos);
100 QwtPlot::LegendPosition legendPosition() const;
101
102 void setLegendRatio(double ratio);
103 double legendRatio() const;
104
105 virtual QSize minimumSizeHint(const QwtPlot*) const;
106 virtual void activate(const QwtPlot* plot, const QRectF& plotRect, Options options = Options());
107 virtual void invalidate();
108
109 QRectF titleRect() const;
110 QRectF footerRect() const;
111 QRectF legendRect() const;
112 QRectF scaleRect(QwtAxisId) const;
113 QRectF canvasRect() const;
114
115protected:
116 void setTitleRect(const QRectF&);
117 void setFooterRect(const QRectF&);
118 void setLegendRect(const QRectF&);
119 void setScaleRect(QwtAxisId, const QRectF&);
120 void setCanvasRect(const QRectF&);
121 QwtPlotLayoutEngine* layoutEngine();
122 void doActivate(const QwtPlot* plot, const QRectF& plotRect, Options options = Options());
123
124private:
125 QwtPlotLayout(const QwtPlotLayout&) = delete;
126 QwtPlotLayout& operator=(const QwtPlotLayout&) = delete;
127
128 QWT_DECLARE_PRIVATE(QwtPlotLayout)
129};
130
131Q_DECLARE_OPERATORS_FOR_FLAGS(QwtPlotLayout::Options)
132
133#endif
Layout engine for QwtPlot components
Definition qwt_plot_layout_engine.h:21
Layout engine for QwtPlot
Definition qwt_plot_layout.h:43
Option
Options to configure the plot layout engine
Definition qwt_plot_layout.h:50
A 2-D plotting widget
Definition qwt_plot.h:99
LegendPosition
Position of the legend, relative to the canvas
Definition qwt_plot.h:116