QWT
7.0.1
Loading...
Searching...
No Matches
src
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
53
class
QWT_EXPORT
QwtLegendData
54
{
55
public
:
57
enum
Mode
58
{
60
ReadOnly
,
61
63
Clickable
,
64
66
Checkable
67
};
68
70
enum
Role
71
{
72
// The value is a Mode
73
ModeRole,
74
75
// The value is a title
76
TitleRole,
77
78
// The value is an icon
79
IconRole,
80
81
// Values < UserRole are reserved for internal use
82
UserRole = 32
83
};
84
85
QwtLegendData
();
86
~QwtLegendData
();
87
88
void
setValues(
const
QMap< int, QVariant >
& );
89
const
QMap< int, QVariant >
& values()
const
;
90
91
void
setValue(
int
role,
const
QVariant& );
92
QVariant value(
int
role )
const
;
93
94
bool
hasRole(
int
role )
const
;
95
bool
isValid()
const
;
96
97
QwtGraphic
icon()
const
;
98
QwtText
title()
const
;
99
Mode mode()
const
;
100
101
private
:
102
QMap< int, QVariant >
m_map;
103
};
104
105
#endif
QMap< int, QVariant >
QwtGraphic
A paint device for scalable graphics.
Definition
qwt_graphic.h:93
QwtLegendData
Attributes of an entry on a legend.
Definition
qwt_legend_data.h:54
QwtLegendData::Role
Role
Identifier how to interpret a QVariant.
Definition
qwt_legend_data.h:71
QwtLegendData::Mode
Mode
Mode defining how a legend entry interacts.
Definition
qwt_legend_data.h:58
QwtLegendData::Clickable
@ Clickable
The legend item is clickable, like a push button.
Definition
qwt_legend_data.h:63
QwtLegendData::ReadOnly
@ ReadOnly
The legend item is not interactive, like a label.
Definition
qwt_legend_data.h:60
QwtText
A class representing a text.
Definition
qwt_text.h:69
Generated by
1.9.8