Qwt User's Guide 5.2.2
|
A legend label. More...
#include <qwt_legend_item.h>
Public Types | |
enum | IdentifierMode { NoIdentifier = 0, ShowLine = 1, ShowSymbol = 2, ShowText = 4 } |
Public Slots | |
void | clear () |
void | setChecked (bool on) |
void | setText (const QString &, QwtText::TextFormat textFormat=QwtText::AutoText) |
Signals | |
void | checked (bool) |
void | clicked () |
void | pressed () |
void | released () |
Public Member Functions | |
const QPen & | curvePen () const |
virtual void | drawIdentifier (QPainter *, const QRect &) const |
virtual void | drawItem (QPainter *p, const QRect &) const |
virtual int | heightForWidth (int) const |
int | identifierMode () const |
int | identifierWidth () const |
int | indent () const |
bool | isChecked () const |
QwtLegend::LegendItemMode | itemMode () const |
int | margin () const |
virtual QSize | minimumSizeHint () const |
QwtLegendItem (QWidget *parent=0) | |
QwtLegendItem (const QwtSymbol &, const QPen &, const QwtText &, QWidget *parent=0) | |
void | setCurvePen (const QPen &) |
void | setIdentifierMode (int) |
void | setIdentifierWidth (int width) |
void | setIndent (int) |
void | setItemMode (QwtLegend::LegendItemMode) |
void | setMargin (int) |
void | setSpacing (int spacing) |
void | setSymbol (const QwtSymbol &) |
virtual void | setText (const QwtText &) |
virtual QSize | sizeHint () const |
int | spacing () const |
const QwtSymbol & | symbol () const |
const QwtText & | text () const |
QRect | textRect () const |
virtual | ~QwtLegendItem () |
Protected Member Functions | |
virtual void | drawContents (QPainter *) |
virtual void | drawText (QPainter *, const QRect &) |
bool | isDown () const |
virtual void | keyPressEvent (QKeyEvent *) |
virtual void | keyReleaseEvent (QKeyEvent *) |
virtual void | mousePressEvent (QMouseEvent *) |
virtual void | mouseReleaseEvent (QMouseEvent *) |
virtual void | paintEvent (QPaintEvent *) |
void | setDown (bool) |
A legend label.
QwtLegendItem represents a curve on a legend. It displays an curve identifier with an explaining text. The identifier might be a combination of curve symbol and line. In readonly mode it behaves like a label, otherwise like an unstylish push button.
QwtLegendItem::QwtLegendItem | ( | QWidget * | parent = 0 | ) | [explicit] |
parent | Parent widget |
QwtLegendItem::QwtLegendItem | ( | const QwtSymbol & | symbol, |
const QPen & | curvePen, | ||
const QwtText & | text, | ||
QWidget * | parent = 0 |
||
) | [explicit] |
symbol | Curve symbol |
curvePen | Curve pen |
text | Label text |
parent | Parent widget |
QwtLegendItem::~QwtLegendItem | ( | ) | [virtual] |
Destructor.
void QwtLegendItem::checked | ( | bool | ) | [signal] |
Signal, when the legend item has been toggled.
void QwtTextLabel::clear | ( | ) | [slot, inherited] |
Clear the text and all QwtText attributes.
void QwtLegendItem::clicked | ( | ) | [signal] |
Signal, when the legend item has been clicked.
const QPen & QwtLegendItem::curvePen | ( | ) | const |
void QwtTextLabel::drawContents | ( | QPainter * | painter | ) | [protected, virtual, inherited] |
Redraw the text and focus indicator.
void QwtLegendItem::drawIdentifier | ( | QPainter * | painter, |
const QRect & | rect | ||
) | const [virtual] |
Paint the identifier to a given rect.
painter | Painter |
rect | Rect where to paint |
void QwtLegendItem::drawItem | ( | QPainter * | painter, |
const QRect & | rect | ||
) | const [virtual] |
Draw the legend item to a given rect.
painter | Painter |
rect | Rect where to paint the button |
void QwtLegendItem::drawText | ( | QPainter * | painter, |
const QRect & | textRect | ||
) | [protected, virtual] |
Redraw the text.
Reimplemented from QwtTextLabel.
int QwtTextLabel::heightForWidth | ( | int | width | ) | const [virtual, inherited] |
Returns the preferred height for this widget, given the width.
width | Width |
int QwtLegendItem::identifierMode | ( | ) | const |
Or'd values of IdentifierMode.
int QwtLegendItem::identifierWidth | ( | ) | const |
Return the width of the identifier
int QwtTextLabel::indent | ( | ) | const [inherited] |
Return label's text indent in pixels.
bool QwtLegendItem::isChecked | ( | ) | const |
Return true, if the item is checked.
bool QwtLegendItem::isDown | ( | ) | const [protected] |
Return true, if the item is down.
QwtLegend::LegendItemMode QwtLegendItem::itemMode | ( | ) | const |
Return the item mode
void QwtLegendItem::keyPressEvent | ( | QKeyEvent * | e | ) | [protected, virtual] |
Handle key press events.
void QwtLegendItem::keyReleaseEvent | ( | QKeyEvent * | e | ) | [protected, virtual] |
Handle key release events.
int QwtTextLabel::margin | ( | ) | const [inherited] |
Return label's text indent in pixels.
QSize QwtTextLabel::minimumSizeHint | ( | ) | const [virtual, inherited] |
Return a minimum size hint.
void QwtLegendItem::mousePressEvent | ( | QMouseEvent * | e | ) | [protected, virtual] |
Handle mouse press events.
void QwtLegendItem::mouseReleaseEvent | ( | QMouseEvent * | e | ) | [protected, virtual] |
Handle mouse release events.
void QwtLegendItem::paintEvent | ( | QPaintEvent * | e | ) | [protected, virtual] |
Paint event.
Reimplemented from QwtTextLabel.
void QwtLegendItem::pressed | ( | ) | [signal] |
Signal, when the legend item has been pressed.
void QwtLegendItem::released | ( | ) | [signal] |
Signal, when the legend item has been relased.
void QwtLegendItem::setChecked | ( | bool | on | ) | [slot] |
void QwtLegendItem::setCurvePen | ( | const QPen & | pen | ) |
void QwtLegendItem::setDown | ( | bool | down | ) | [protected] |
Set the item being down.
void QwtLegendItem::setIdentifierMode | ( | int | mode | ) |
Set identifier mode. Default is ShowLine | ShowText.
mode | Or'd values of IdentifierMode |
void QwtLegendItem::setIdentifierWidth | ( | int | width | ) |
Set the width for the identifier Default is 8 pixels
width | New width |
void QwtTextLabel::setIndent | ( | int | indent | ) | [inherited] |
Set label's text indent in pixels
indent | Indentation in pixels |
void QwtLegendItem::setItemMode | ( | QwtLegend::LegendItemMode | mode | ) |
Set the item mode The default is QwtLegend::ReadOnlyItem
mode | Item mode |
void QwtTextLabel::setMargin | ( | int | margin | ) | [inherited] |
Set label's margin in pixels
margin | Margin in pixels |
void QwtLegendItem::setSpacing | ( | int | spacing | ) |
Change the spacing
spacing | Spacing |
void QwtLegendItem::setSymbol | ( | const QwtSymbol & | symbol | ) |
void QwtLegendItem::setText | ( | const QwtText & | text | ) | [virtual] |
Set the text to the legend item
text | Text label |
Reimplemented from QwtTextLabel.
void QwtTextLabel::setText | ( | const QString & | text, |
QwtText::TextFormat | textFormat = QwtText::AutoText |
||
) | [slot, inherited] |
QSize QwtLegendItem::sizeHint | ( | ) | const [virtual] |
Return a size hint.
Reimplemented from QwtTextLabel.
int QwtLegendItem::spacing | ( | ) | const |
Return the spacing
const QwtSymbol & QwtLegendItem::symbol | ( | ) | const |
const QwtText & QwtTextLabel::text | ( | ) | const [inherited] |
Return the text.
QRect QwtTextLabel::textRect | ( | ) | const [inherited] |
Calculate the rect for the text in widget coordinates