QWT 7.0.1
Loading...
Searching...
No Matches
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
39class QWT_EXPORT QwtLegendLabel : public QwtTextLabel
40{
41 Q_OBJECT
42 public:
43 explicit QwtLegendLabel( QWidget* parent = 0 );
44 virtual ~QwtLegendLabel();
45
46 void setData( const QwtLegendData& );
47 const QwtLegendData& data() const;
48
49 void setItemMode( QwtLegendData::Mode );
50 QwtLegendData::Mode itemMode() const;
51
52 void setSpacing( int spacing );
53 int spacing() const;
54
55 virtual void setText( const QwtText& ) QWT_OVERRIDE;
56
57 void setIcon( const QPixmap& );
58 QPixmap icon() const;
59
60 virtual QSize sizeHint() const QWT_OVERRIDE;
61
62 bool isChecked() const;
63
64 public Q_SLOTS:
65 void setChecked( bool on );
66
67 Q_SIGNALS:
69 void clicked();
70
72 void pressed();
73
75 void released();
76
78 void checked( bool );
79
80 protected:
81 void setDown( bool );
82 bool isDown() const;
83
84 virtual void paintEvent( QPaintEvent* ) QWT_OVERRIDE;
85 virtual void mousePressEvent( QMouseEvent* ) QWT_OVERRIDE;
86 virtual void mouseReleaseEvent( QMouseEvent* ) QWT_OVERRIDE;
87 virtual void keyPressEvent( QKeyEvent* ) QWT_OVERRIDE;
88 virtual void keyReleaseEvent( QKeyEvent* ) QWT_OVERRIDE;
89
90 private:
91 class PrivateData;
92 PrivateData* m_data;
93};
94
95#endif
Attributes of an entry on a legend.
Definition qwt_legend_data.h:54
Mode
Mode defining how a legend entry interacts.
Definition qwt_legend_data.h:58
A widget representing something on a QwtLegend.
Definition qwt_legend_label.h:40
void checked(bool)
Signal, when the legend item has been toggled.
void released()
Signal, when the legend item has been released.
void clicked()
Signal, when the legend item has been clicked.
void pressed()
Signal, when the legend item has been pressed.
A Widget which displays a QwtText.
Definition qwt_text_label.h:44
void setText(const QString &, QwtText::TextFormat textFormat=QwtText::AutoText)
Change the label's text, keeping all other QwtText attributes.
Definition qwt_text_label.cpp:109
virtual void paintEvent(QPaintEvent *) QWT_OVERRIDE
Qt paint event.
Definition qwt_text_label.cpp:247
virtual QSize sizeHint() const QWT_OVERRIDE
Return a size hint.
Definition qwt_text_label.cpp:184
A class representing a text.
Definition qwt_text.h:69