qwt_legend_label.h
/******************************************************************************
* Qwt Widget Library
* Copyright (C) 1997 Josef Wilgen
* Copyright (C) 2002 Uwe Rathmann
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the Qwt License, Version 1.0
*****************************************************************************/
#ifndef QWT_LEGEND_LABEL_H
#define QWT_LEGEND_LABEL_H
#include "qwt_global.h"
#include "qwt_text_label.h"
#include "qwt_legend_data.h"
class QwtText;
class QWT_EXPORT QwtLegendLabel : public QwtTextLabel
{
Q_OBJECT
public:
explicit QwtLegendLabel( QWidget* parent = 0 );
virtual ~QwtLegendLabel();
void setData( const QwtLegendData& );
const QwtLegendData& data() const;
void setItemMode( QwtLegendData::Mode );
QwtLegendData::Mode itemMode() const;
void setSpacing( int spacing );
int spacing() const;
virtual void setText( const QwtText& ) QWT_OVERRIDE;
void setIcon( const QPixmap& );
QPixmap icon() const;
virtual QSize sizeHint() const QWT_OVERRIDE;
bool isChecked() const;
public Q_SLOTS:
void setChecked( bool on );
Q_SIGNALS:
void clicked();
void pressed();
void released();
void checked( bool );
protected:
void setDown( bool );
bool isDown() const;
virtual void paintEvent( QPaintEvent* ) QWT_OVERRIDE;
virtual void mousePressEvent( QMouseEvent* ) QWT_OVERRIDE;
virtual void mouseReleaseEvent( QMouseEvent* ) QWT_OVERRIDE;
virtual void keyPressEvent( QKeyEvent* ) QWT_OVERRIDE;
virtual void keyReleaseEvent( QKeyEvent* ) QWT_OVERRIDE;
private:
class PrivateData;
PrivateData* m_data;
};
#endif
QwtLegendData
Attributes of an entry on a legend.
Definition: qwt_legend_data.h:37
QwtLegendData::Mode
Mode
Mode defining how a legend entry interacts.
Definition: qwt_legend_data.h:41
QwtLegendLabel
A widget representing something on a QwtLegend.
Definition: qwt_legend_label.h:23
QwtLegendLabel::checked
void checked(bool)
Signal, when the legend item has been toggled.
QwtLegendLabel::released
void released()
Signal, when the legend item has been released.
QwtLegendLabel::clicked
void clicked()
Signal, when the legend item has been clicked.
QwtLegendLabel::pressed
void pressed()
Signal, when the legend item has been pressed.
QwtText
A class representing a text.
Definition: qwt_text.h:52
QwtTextLabel
A Widget which displays a QwtText.
Definition: qwt_text_label.h:27
QwtTextLabel::sizeHint
virtual QSize sizeHint() const override
Return a size hint.
Definition: qwt_text_label.cpp:172
QwtTextLabel::setText
void setText(const QString &, QwtText::TextFormat textFormat=QwtText::AutoText)
Definition: qwt_text_label.cpp:96
QwtTextLabel::paintEvent
virtual void paintEvent(QPaintEvent *) override
Definition: qwt_text_label.cpp:236