---
name: "QwtLegendLabel"
section: "3"
platform: "linux"
package: "libqwt-doc"
version: "6.1.4-2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/QwtLegendLabel"
---

# QwtLegendLabel(3)

A widget representing something on a QwtLegend.

## NAME

QwtLegendLabel - A widget representing something on a **QwtLegend**.

## SYNOPSIS

`#include <qwt_legend_label.h>`

Inherits **QwtTextLabel**.

### Public Slots

void **setChecked** (bool on)\

### Signals

void **clicked** ()\
 Signal, when the legend item has been clicked.  void **pressed** ()\
 Signal, when the legend item has been pressed.  void **released** ()\
 Signal, when the legend item has been released.  void **checked** (bool)\
 Signal, when the legend item has been toggled.

### Public Member Functions

**QwtLegendLabel** (QWidget \*parent=0)\
 virtual **~QwtLegendLabel** ()\
 Destructor.  void **setData** (const **QwtLegendData** &)\
 const **QwtLegendData** & **data** () const\
 void **setItemMode** (**QwtLegendData::Mode**)\
 **QwtLegendData::Mode** **itemMode** () const\
 void **setSpacing** (int **spacing**)\
 Change the spacing between icon and text.  int **spacing** () const\
 virtual void **setText** (const **QwtText** &)\
 void **setIcon** (const QPixmap &)\
 QPixmap **icon** () const\
 virtual QSize **sizeHint** () const\
 Return a size hint.  bool **isChecked** () const\
 Return true, if the item is checked.

### Protected Member Functions

void **setDown** (bool)\
 Set the item being down.  bool **isDown** () const\
 Return true, if the item is down.  virtual void **paintEvent** (QPaintEvent \*)\
 Paint event.  virtual void **mousePressEvent** (QMouseEvent \*)\
 Handle mouse press events.  virtual void **mouseReleaseEvent** (QMouseEvent \*)\
 Handle mouse release events.  virtual void **keyPressEvent** (QKeyEvent \*)\
 Handle key press events.  virtual void **keyReleaseEvent** (QKeyEvent \*)\
 Handle key release events.

## Detailed Description

A widget representing something on a **QwtLegend**.

## Constructor & Destructor Documentation

### QwtLegendLabel::QwtLegendLabel (QWidget \* parent = `0`)` [explicit]`

**Parameters:**

*parent* Parent widget

## Member Function Documentation

### const QwtLegendData & QwtLegendLabel::data () const

**Returns:**

Attributes of the label

**See also:**

**setData()**, **QwtPlotItem::legendData()**

### QPixmap QwtLegendLabel::icon () const

**Returns:**

Pixmap representing a plot item

**See also:**

**setIcon()**

### QwtLegendData::Mode QwtLegendLabel::itemMode () const

**Returns:**

Item mode

**See also:**

**setItemMode()**

### void QwtLegendLabel::setChecked (bool on)` [slot]`

Check/Uncheck a the item

**Parameters:**

*on* check/uncheck

**See also:**

**setItemMode()**

### void QwtLegendLabel::setData (const QwtLegendData & legendData)

Set the attributes of the legend label

**Parameters:**

*legendData* Attributes of the label

**See also:**

**data()**

### void QwtLegendLabel::setIcon (const QPixmap & icon)

Assign the icon

**Parameters:**

*icon* Pixmap representing a plot item

**See also:**

**icon()**, **QwtPlotItem::legendIcon()**

### void QwtLegendLabel::setItemMode (QwtLegendData::Mode mode)

Set the item mode The default is **QwtLegendData::ReadOnly**

**Parameters:**

*mode* Item mode

**See also:**

**itemMode()**

### void QwtLegendLabel::setSpacing (int spacing)

Change the spacing between icon and text.

**Parameters:**

*spacing* Spacing

**See also:**

**spacing()**, **QwtTextLabel::margin()**

### void QwtLegendLabel::setText (const QwtText & text)` [virtual]`

Set the text to the legend item

**Parameters:**

*text* Text label

**See also:**

**QwtTextLabel::text()**

Reimplemented from **QwtTextLabel**.

### int QwtLegendLabel::spacing () const

**Returns:**

Spacing between icon and text

**See also:**

**setSpacing()**, **QwtTextLabel::margin()**

## Author

Generated automatically by Doxygen for Qwt User's Guide from the source code.
