QWT API (中文) 7.0.1
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
qwt_legend_data.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_LEGEND_DATA_H
28#define QWT_LEGEND_DATA_H
29
30#include "qwt_global.h"
31
32#include <qvariant.h>
33#include <qmap.h>
34
35class QwtText;
36class QwtGraphic;
37
59class QWT_EXPORT QwtLegendData
60{
61 public:
70 enum Mode
71 {
81
91
100 Checkable
101 };
102
111 enum Role
112 {
122
132
142
151 UserRole = 32
152 };
153
154 // Constructor
156 // Destructor
158
159 // Set all values
160 void setValues( const QMap< int, QVariant >& );
161 // Return all values
162 const QMap< int, QVariant >& values() const;
163
164 // Set a value for a specific role
165 void setValue( int role, const QVariant& );
166 // Return the value for a specific role
167 QVariant value( int role ) const;
168
169 // Check if a value exists for a specific role
170 bool hasRole( int role ) const;
171 // Check if the legend data is valid
172 bool isValid() const;
173
174 // Return the icon
175 QwtGraphic icon() const;
176 // Return the title
177 QwtText title() const;
178 // Return the mode
179 Mode mode() const;
180
181 private:
183};
184
185#endif
可缩放图形的绘制设备
Definition qwt_graphic.h:128
图例条目的属性
Definition qwt_legend_data.h:60
Role
如何解释 QVariant 的标识符
Definition qwt_legend_data.h:112
@ ModeRole
值是 Mode
Definition qwt_legend_data.h:121
@ TitleRole
值是标题
Definition qwt_legend_data.h:131
@ IconRole
值是图标
Definition qwt_legend_data.h:141
Mode
定义图例条目如何交互的模式
Definition qwt_legend_data.h:71
@ Clickable
图例项可点击,如按钮
Definition qwt_legend_data.h:90
@ ReadOnly
图例项不可交互,如标签
Definition qwt_legend_data.h:80
表示文本的类
Definition qwt_text.h:93