Qwt User's Guide 6.2.0

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
10 #ifndef QWT_LEGEND_DATA_H
11 #define QWT_LEGEND_DATA_H
12
13 #include "qwt_global.h"
14
15 #include <qvariant.h>
16 #include <qmap.h>
17
18 class QwtText;
19 class QwtGraphic;
20
36 class QWT_EXPORT QwtLegendData
37 {
38 public:
40 enum Mode
41 {
43 ReadOnly,
44
46 Clickable,
47
49 Checkable
50 };
51
53 enum Role
54 {
55 // The value is a Mode
56 ModeRole,
57
58 // The value is a title
59 TitleRole,
60
61 // The value is an icon
62 IconRole,
63
64 // Values < UserRole are reserved for internal use
65 UserRole = 32
66 };
67
68 QwtLegendData();
69 ~QwtLegendData();
70
71 void setValues( const QMap< int, QVariant >& );
72 const QMap< int, QVariant >& values() const;
73
74 void setValue( int role, const QVariant& );
75 QVariant value( int role ) const;
76
77 bool hasRole( int role ) const;
78 bool isValid() const;
79
80 QwtGraphic icon() const;
81 QwtText title() const;
82 Mode mode() const;
83
84 private:
85 QMap< int, QVariant > m_map;
86 };
87
88 #endif
QMap< int, QVariant >
QwtGraphic
A paint device for scalable graphics.
Definition: qwt_graphic.h:76
QwtLegendData
Attributes of an entry on a legend.
Definition: qwt_legend_data.h:37
QwtLegendData::Role
Role
Identifier how to interpret a QVariant.
Definition: qwt_legend_data.h:54
QwtLegendData::Mode
Mode
Mode defining how a legend entry interacts.
Definition: qwt_legend_data.h:41
QwtLegendData::Clickable
@ Clickable
The legend item is clickable, like a push button.
Definition: qwt_legend_data.h:46
QwtLegendData::ReadOnly
@ ReadOnly
The legend item is not interactive, like a label.
Definition: qwt_legend_data.h:43
QwtText
A class representing a text.
Definition: qwt_text.h:52