QWT API (中文)
7.3.0
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
src
plot
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
35
class
QwtText
;
36
class
QwtGraphic
;
37
48
class
QWT_EXPORT
QwtLegendData
49
{
50
public
:
54
enum
Mode
55
{
59
ReadOnly
,
60
64
Clickable
,
65
69
Checkable
70
};
71
75
enum
Role
76
{
80
ModeRole
,
81
85
TitleRole
,
86
90
IconRole
,
91
95
UserRole = 32
96
};
97
98
// Constructor
99
QwtLegendData
();
100
// Copy constructor
101
QwtLegendData
(
const
QwtLegendData
&);
102
// Move constructor
103
QwtLegendData
(
QwtLegendData
&&) noexcept = default;
104
// Destructor
105
~
QwtLegendData
();
106
// Copy assignment
107
QwtLegendData
& operator=(const
QwtLegendData
&);
108
// Move assignment
109
QwtLegendData
& operator=(
QwtLegendData
&&) noexcept = default;
110
111
// Set all values
112
void
setValues(const
QMap
<
int
, QVariant >&);
113
// Return all values
114
const
QMap
<
int
, QVariant >& values() const;
115
116
// Set a value for a specific role
117
void
setValue(
int
role, const QVariant&);
118
// Return the value for a specific role
119
QVariant value(
int
role) const;
120
121
// Check if a value exists for a specific role
122
bool
hasRole(
int
role) const;
123
// Check if the legend data is valid
124
bool
isValid() const;
125
126
// Return the icon
127
QwtGraphic
icon() const;
128
// Return the title
129
QwtText
title() const;
130
// Return the mode
131
Mode
mode() const;
132
133
private:
134
QMap
<
int
, QVariant > m_map;
135
};
136
137
#endif
QMap
Definition
qwt_raster_data.h:40
QwtGraphic
A paint device for scalable graphics
Definition
qwt_graphic.h:85
QwtLegendData
Attributes of an entry on a legend
Definition
qwt_legend_data.h:49
QwtLegendData::Role
Role
Identifier how to interpret a QVariant
Definition
qwt_legend_data.h:76
QwtLegendData::ModeRole
@ ModeRole
The value is a Mode
Definition
qwt_legend_data.h:80
QwtLegendData::TitleRole
@ TitleRole
The value is a title
Definition
qwt_legend_data.h:85
QwtLegendData::IconRole
@ IconRole
The value is an icon
Definition
qwt_legend_data.h:90
QwtLegendData::Mode
Mode
Mode defining how a legend entry interacts
Definition
qwt_legend_data.h:55
QwtLegendData::Clickable
@ Clickable
The legend item is clickable, like a push button
Definition
qwt_legend_data.h:64
QwtLegendData::ReadOnly
@ ReadOnly
The legend item is not interactive, like a label
Definition
qwt_legend_data.h:59
QwtLegendData::QwtLegendData
QwtLegendData(const QwtLegendData &)
Copy constructor
QwtText
A class representing a text
Definition
qwt_text.h:70
制作者
1.9.8