QWT API (中文) 7.0.1
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
qwt_legend_label.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_LABEL_H
28#define QWT_LEGEND_LABEL_H
29
30#include "qwt_global.h"
31#include "qwt_text_label.h"
32#include "qwt_legend_data.h"
33
34class QwtText;
35
52class QWT_EXPORT QwtLegendLabel : public QwtTextLabel
53{
54 Q_OBJECT
55 public:
56 // Constructor for QwtLegendLabel
57 explicit QwtLegendLabel( QWidget* parent = 0 );
58
59 // Destructor for QwtLegendLabel
60 virtual ~QwtLegendLabel();
61
62 // Set the legend data
63 void setData( const QwtLegendData& );
64
65 // Return the legend data
66 const QwtLegendData& data() const;
67
68 // Set the item mode
69 void setItemMode( QwtLegendData::Mode );
70
71 // Return the item mode
72 QwtLegendData::Mode itemMode() const;
73
74 // Set the spacing between icon and text
75 void setSpacing( int spacing );
76
77 // Return the spacing
78 int spacing() const;
79
80 // Set the text label
81 virtual void setText( const QwtText& ) override;
82
83 // Set the icon
84 void setIcon( const QPixmap& );
85
86 // Return the icon
87 QPixmap icon() const;
88
89 // Return the size hint
90 virtual QSize sizeHint() const override;
91
92 // Return whether the item is checked
93 bool isChecked() const;
94
95 public Q_SLOTS:
96 // Set whether the item is checked
97 void setChecked( bool on );
98
99 Q_SIGNALS:
108 void clicked();
109
118 void pressed();
119
128 void released();
129
140 void checked( bool );
141
142 protected:
144 void setDown( bool );
145
147 bool isDown() const;
148
150 virtual void paintEvent( QPaintEvent* ) override;
151
153 virtual void mousePressEvent( QMouseEvent* ) override;
154
156 virtual void mouseReleaseEvent( QMouseEvent* ) override;
157
159 virtual void keyPressEvent( QKeyEvent* ) override;
160
162 virtual void keyReleaseEvent( QKeyEvent* ) override;
163
164 private:
165 class PrivateData;
166 PrivateData* m_data;
167};
168
169#endif
图例条目的属性
Definition qwt_legend_data.h:60
Mode
定义图例条目如何交互的模式
Definition qwt_legend_data.h:71
表示 QwtLegend 上某个条目的控件
Definition qwt_legend_label.h:53
void checked(bool)
当图例项状态切换时发出的信号
void released()
当图例项被释放时发出的信号
void clicked()
当图例项被点击时发出的信号
void pressed()
当图例项被按下时发出的信号
显示 QwtText 的控件
Definition qwt_text_label.h:55
virtual QSize sizeHint() const override
返回大小提示
Definition qwt_text_label.cpp:302
void setText(const QString &, QwtText::TextFormat textFormat=QwtText::AutoText)
更改标签的文本,保留所有其他 QwtText 属性
Definition qwt_text_label.cpp:150
virtual void paintEvent(QPaintEvent *) override
Paint event handler
Definition qwt_text_label.cpp:394
表示文本的类
Definition qwt_text.h:93