Main Page
Related Pages
+
Namespaces
Namespace List
+
Namespace Members
+
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
+
Variables
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
+
Enumerations
a
b
c
d
e
g
i
l
m
o
p
r
s
t
v
+
Enumerator
a
b
c
d
e
f
g
i
l
m
n
o
p
r
s
t
u
v
x
y
+
Classes
Class List
Class Hierarchy
+
Class Members
+
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Variables
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Typedefs
_
a
b
c
d
e
f
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
+
Enumerations
a
b
c
d
e
f
g
h
i
k
l
m
o
p
r
s
t
u
w
+
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
y
+
Properties
a
b
c
d
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
+
Related Functions
:
a
b
c
d
e
f
g
i
m
o
q
r
s
v
w
+
Files
File List
+
File Members
+
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
+
Variables
_
a
b
c
d
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
+
Typedefs
a
b
c
d
e
f
g
h
i
k
l
m
n
p
q
r
s
t
u
v
w
x
z
+
Enumerations
a
b
c
d
e
f
h
i
k
l
n
o
r
t
u
v
x
+
Enumerator
b
c
d
e
f
h
i
k
l
m
n
o
p
r
t
u
v
w
x
+
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
3rdparty
qwt
src
qwt_legend_data.cpp
Go to the documentation of this file.
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
10
#include "
qwt_legend_data.h
"
11
#include "
qwt_text.h
"
12
#include "
qwt_graphic.h
"
13
15
QwtLegendData::QwtLegendData
()
16
{
17
}
18
20
QwtLegendData::~QwtLegendData
()
21
{
22
}
23
33
void
QwtLegendData::setValues
(
const
QMap< int, QVariant >
& map )
34
{
35
m_map
= map;
36
}
37
42
const
QMap< int, QVariant >
&
QwtLegendData::values
()
const
43
{
44
return
m_map
;
45
}
46
51
bool
QwtLegendData::hasRole
(
int
role )
const
52
{
53
return
m_map
.contains( role );
54
}
55
64
void
QwtLegendData::setValue
(
int
role,
const
QVariant&
data
)
65
{
66
m_map
[role] =
data
;
67
}
68
73
QVariant
QwtLegendData::value
(
int
role )
const
74
{
75
if
( !
m_map
.contains( role ) )
76
return
QVariant();
77
78
return
m_map
[role];
79
}
80
82
bool
QwtLegendData::isValid
()
const
83
{
84
return
!
m_map
.isEmpty();
85
}
86
88
QwtText
QwtLegendData::title
()
const
89
{
90
QwtText
text;
91
92
const
QVariant titleValue =
value
(
QwtLegendData::TitleRole
);
93
if
( titleValue.canConvert<
QwtText
>() )
94
{
95
text = qvariant_cast<
QwtText
>( titleValue );
96
}
97
else
if
( titleValue.canConvert< QString >() )
98
{
99
text.
setText
( qvariant_cast< QString >( titleValue ) );
100
}
101
102
return
text;
103
}
104
106
QwtGraphic
QwtLegendData::icon
()
const
107
{
108
const
QVariant iconValue =
value
(
QwtLegendData::IconRole
);
109
110
QwtGraphic
graphic;
111
if
( iconValue.canConvert<
QwtGraphic
>() )
112
{
113
graphic = qvariant_cast<
QwtGraphic
>( iconValue );
114
}
115
116
return
graphic;
117
}
118
120
QwtLegendData::Mode
QwtLegendData::mode
()
const
121
{
122
const
QVariant modeValue =
value
(
QwtLegendData::ModeRole
);
123
if
( modeValue.canConvert<
int
>() )
124
{
125
const
int
mode
= qvariant_cast<
int
>( modeValue );
126
return
static_cast<
QwtLegendData::Mode
>
(
mode
);
127
}
128
129
return
QwtLegendData::ReadOnly
;
130
}
131
QwtLegendData::isValid
bool isValid() const
Definition:
qwt_legend_data.cpp:82
QwtLegendData::ModeRole
Definition:
qwt_legend_data.h:56
QwtText::setText
void setText(const QString &, QwtText::TextFormat textFormat=AutoText)
Definition:
qwt_text.cpp:277
QwtLegendData::setValues
void setValues(const QMap< int, QVariant > &)
Definition:
qwt_legend_data.cpp:33
QwtLegendData::icon
QwtGraphic icon() const
Definition:
qwt_legend_data.cpp:106
QwtLegendData::IconRole
Definition:
qwt_legend_data.h:62
QwtLegendData::ReadOnly
The legend item is not interactive, like a label.
Definition:
qwt_legend_data.h:43
QwtLegendData::m_map
QMap< int, QVariant > m_map
Definition:
qwt_legend_data.h:85
QwtLegendData::values
const QMap< int, QVariant > & values() const
Definition:
qwt_legend_data.cpp:42
QwtLegendData::title
QwtText title() const
Definition:
qwt_legend_data.cpp:88
QwtLegendData::~QwtLegendData
~QwtLegendData()
Destructor.
Definition:
qwt_legend_data.cpp:20
QwtLegendData::QwtLegendData
QwtLegendData()
Constructor.
Definition:
qwt_legend_data.cpp:15
QwtText
A class representing a text.
Definition:
qwt_text.h:51
QwtGraphic
A paint device for scalable graphics.
Definition:
qwt_graphic.h:75
QwtLegendData::TitleRole
Definition:
qwt_legend_data.h:59
qwt_legend_data.h
QwtLegendData::mode
Mode mode() const
Definition:
qwt_legend_data.cpp:120
QwtLegendData::setValue
void setValue(int role, const QVariant &)
Definition:
qwt_legend_data.cpp:64
QwtLegendData::value
QVariant value(int role) const
Definition:
qwt_legend_data.cpp:73
qwt_text.h
mqtt_test.data
dictionary data
Definition:
mqtt_test.py:22
QwtLegendData::Mode
Mode
Mode defining how a legend entry interacts.
Definition:
qwt_legend_data.h:40
qwt_graphic.h
QwtLegendData::hasRole
bool hasRole(int role) const
Definition:
qwt_legend_data.cpp:51
data
Definition:
format.h:895
QMap< int, QVariant >
plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Jun 19 2023 03:01:38