.TH "QwtLegendItem" 3 "Mon Aug 1 2011" "Version 5.2.2" "Qwt User's Guide" \" -*- nroff -*- .ad l .nh .SH NAME QwtLegendItem \- .PP A legend label. .SH SYNOPSIS .br .PP .PP \fC#include \fP .PP Inherits \fBQwtTextLabel\fP. .SS "Public Types" .in +1c .ti -1c .RI "enum \fBIdentifierMode\fP { \fBNoIdentifier\fP = 0, \fBShowLine\fP = 1, \fBShowSymbol\fP = 2, \fBShowText\fP = 4 }" .br .in -1c .SS "Public Slots" .in +1c .ti -1c .RI "void \fBclear\fP ()" .br .ti -1c .RI "void \fBsetChecked\fP (bool on)" .br .ti -1c .RI "void \fBsetText\fP (const QString &, \fBQwtText::TextFormat\fP textFormat=QwtText::AutoText)" .br .in -1c .SS "Signals" .in +1c .ti -1c .RI "void \fBchecked\fP (bool)" .br .ti -1c .RI "void \fBclicked\fP ()" .br .ti -1c .RI "void \fBpressed\fP ()" .br .ti -1c .RI "void \fBreleased\fP ()" .br .in -1c .SS "Public Member Functions" .in +1c .ti -1c .RI "const QPen & \fBcurvePen\fP () const " .br .ti -1c .RI "virtual void \fBdrawIdentifier\fP (QPainter *, const QRect &) const " .br .ti -1c .RI "virtual void \fBdrawItem\fP (QPainter *p, const QRect &) const " .br .ti -1c .RI "virtual int \fBheightForWidth\fP (int) const " .br .ti -1c .RI "int \fBidentifierMode\fP () const " .br .ti -1c .RI "int \fBidentifierWidth\fP () const " .br .ti -1c .RI "int \fBindent\fP () const " .br .ti -1c .RI "bool \fBisChecked\fP () const " .br .ti -1c .RI "\fBQwtLegend::LegendItemMode\fP \fBitemMode\fP () const " .br .ti -1c .RI "int \fBmargin\fP () const " .br .ti -1c .RI "virtual QSize \fBminimumSizeHint\fP () const " .br .ti -1c .RI "\fBQwtLegendItem\fP (QWidget *parent=0)" .br .ti -1c .RI "\fBQwtLegendItem\fP (const \fBQwtSymbol\fP &, const QPen &, const \fBQwtText\fP &, QWidget *parent=0)" .br .ti -1c .RI "void \fBsetCurvePen\fP (const QPen &)" .br .ti -1c .RI "void \fBsetIdentifierMode\fP (int)" .br .ti -1c .RI "void \fBsetIdentifierWidth\fP (int width)" .br .ti -1c .RI "void \fBsetIndent\fP (int)" .br .ti -1c .RI "void \fBsetItemMode\fP (\fBQwtLegend::LegendItemMode\fP)" .br .ti -1c .RI "void \fBsetMargin\fP (int)" .br .ti -1c .RI "void \fBsetSpacing\fP (int spacing)" .br .ti -1c .RI "void \fBsetSymbol\fP (const \fBQwtSymbol\fP &)" .br .ti -1c .RI "virtual void \fBsetText\fP (const \fBQwtText\fP &)" .br .ti -1c .RI "virtual QSize \fBsizeHint\fP () const " .br .ti -1c .RI "int \fBspacing\fP () const " .br .ti -1c .RI "const \fBQwtSymbol\fP & \fBsymbol\fP () const " .br .ti -1c .RI "const \fBQwtText\fP & \fBtext\fP () const " .br .ti -1c .RI "QRect \fBtextRect\fP () const " .br .ti -1c .RI "virtual \fB~QwtLegendItem\fP ()" .br .in -1c .SS "Protected Member Functions" .in +1c .ti -1c .RI "virtual void \fBdrawContents\fP (QPainter *)" .br .ti -1c .RI "virtual void \fBdrawText\fP (QPainter *, const QRect &)" .br .ti -1c .RI "bool \fBisDown\fP () const " .br .ti -1c .RI "virtual void \fBkeyPressEvent\fP (QKeyEvent *)" .br .ti -1c .RI "virtual void \fBkeyReleaseEvent\fP (QKeyEvent *)" .br .ti -1c .RI "virtual void \fBmousePressEvent\fP (QMouseEvent *)" .br .ti -1c .RI "virtual void \fBmouseReleaseEvent\fP (QMouseEvent *)" .br .ti -1c .RI "virtual void \fBpaintEvent\fP (QPaintEvent *)" .br .ti -1c .RI "void \fBsetDown\fP (bool)" .br .in -1c .SH "Detailed Description" .PP A legend label. \fBQwtLegendItem\fP 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. .PP \fBSee also:\fP .RS 4 \fBQwtLegend\fP, \fBQwtPlotCurve\fP .RE .PP .SH "Member Enumeration Documentation" .PP .SS "enum \fBQwtLegendItem::IdentifierMode\fP" .PP Identifier mode. Default is ShowLine | ShowText .PP \fBSee also:\fP .RS 4 \fBidentifierMode()\fP, \fBsetIdentifierMode()\fP .RE .PP .SH "Constructor & Destructor Documentation" .PP .SS "QwtLegendItem::QwtLegendItem (QWidget *parent = \fC0\fP)\fC [explicit]\fP"\fBParameters:\fP .RS 4 \fIparent\fP Parent widget .RE .PP .SS "QwtLegendItem::QwtLegendItem (const \fBQwtSymbol\fP &symbol, const QPen &curvePen, const \fBQwtText\fP &text, QWidget *parent = \fC0\fP)\fC [explicit]\fP"\fBParameters:\fP .RS 4 \fIsymbol\fP Curve symbol .br \fIcurvePen\fP Curve pen .br \fItext\fP Label text .br \fIparent\fP Parent widget .RE .PP .SS "QwtLegendItem::~QwtLegendItem ()\fC [virtual]\fP" .PP Destructor. .SH "Member Function Documentation" .PP .SS "void QwtLegendItem::checked (bool)\fC [signal]\fP" .PP Signal, when the legend item has been toggled. .SS "void QwtTextLabel::clear ()\fC [slot, inherited]\fP" .PP Clear the text and all \fBQwtText\fP attributes. .SS "void QwtLegendItem::clicked ()\fC [signal]\fP" .PP Signal, when the legend item has been clicked. .SS "const QPen & QwtLegendItem::curvePen () const"\fBReturns:\fP .RS 4 The curve pen. .RE .PP \fBSee also:\fP .RS 4 \fBsetCurvePen()\fP .RE .PP .SS "void QwtTextLabel::drawContents (QPainter *painter)\fC [protected, virtual, inherited]\fP" .PP Redraw the text and focus indicator. .SS "void QwtLegendItem::drawIdentifier (QPainter *painter, const QRect &rect) const\fC [virtual]\fP"Paint the identifier to a given rect. .PP \fBParameters:\fP .RS 4 \fIpainter\fP Painter .br \fIrect\fP Rect where to paint .RE .PP .SS "void QwtLegendItem::drawItem (QPainter *painter, const QRect &rect) const\fC [virtual]\fP"Draw the legend item to a given rect. .PP \fBParameters:\fP .RS 4 \fIpainter\fP Painter .br \fIrect\fP Rect where to paint the button .RE .PP .SS "void QwtLegendItem::drawText (QPainter *painter, const QRect &textRect)\fC [protected, virtual]\fP" .PP Redraw the text. .PP Reimplemented from \fBQwtTextLabel\fP. .SS "int QwtTextLabel::heightForWidth (intwidth) const\fC [virtual, inherited]\fP"Returns the preferred height for this widget, given the width. .PP \fBParameters:\fP .RS 4 \fIwidth\fP Width .RE .PP .SS "int QwtLegendItem::identifierMode () const"Or'd values of IdentifierMode. .PP \fBSee also:\fP .RS 4 \fBsetIdentifierMode()\fP, \fBIdentifierMode\fP .RE .PP .SS "int QwtLegendItem::identifierWidth () const"Return the width of the identifier .PP \fBSee also:\fP .RS 4 \fBsetIdentifierWidth()\fP .RE .PP .SS "int QwtTextLabel::indent () const\fC [inherited]\fP" .PP Return label's text indent in pixels. .SS "bool QwtLegendItem::isChecked () const" .PP Return true, if the item is checked. .SS "bool QwtLegendItem::isDown () const\fC [protected]\fP" .PP Return true, if the item is down. .SS "\fBQwtLegend::LegendItemMode\fP QwtLegendItem::itemMode () const"Return the item mode .PP \fBSee also:\fP .RS 4 \fBsetItemMode()\fP .RE .PP .SS "void QwtLegendItem::keyPressEvent (QKeyEvent *e)\fC [protected, virtual]\fP" .PP Handle key press events. .SS "void QwtLegendItem::keyReleaseEvent (QKeyEvent *e)\fC [protected, virtual]\fP" .PP Handle key release events. .SS "int QwtTextLabel::margin () const\fC [inherited]\fP" .PP Return label's text indent in pixels. .SS "QSize QwtTextLabel::minimumSizeHint () const\fC [virtual, inherited]\fP" .PP Return a minimum size hint. .SS "void QwtLegendItem::mousePressEvent (QMouseEvent *e)\fC [protected, virtual]\fP" .PP Handle mouse press events. .SS "void QwtLegendItem::mouseReleaseEvent (QMouseEvent *e)\fC [protected, virtual]\fP" .PP Handle mouse release events. .SS "void QwtLegendItem::paintEvent (QPaintEvent *e)\fC [protected, virtual]\fP" .PP Paint event. .PP Reimplemented from \fBQwtTextLabel\fP. .SS "void QwtLegendItem::pressed ()\fC [signal]\fP" .PP Signal, when the legend item has been pressed. .SS "void QwtLegendItem::released ()\fC [signal]\fP" .PP Signal, when the legend item has been relased. .SS "void QwtLegendItem::setChecked (boolon)\fC [slot]\fP"Check/Uncheck a the item .PP \fBParameters:\fP .RS 4 \fIon\fP check/uncheck .RE .PP \fBSee also:\fP .RS 4 \fBsetItemMode()\fP .RE .PP .SS "void QwtLegendItem::setCurvePen (const QPen &pen)"Set curve pen. .PP \fBParameters:\fP .RS 4 \fIpen\fP Curve pen .RE .PP \fBSee also:\fP .RS 4 \fBcurvePen()\fP .RE .PP .SS "void QwtLegendItem::setDown (booldown)\fC [protected]\fP" .PP Set the item being down. .SS "void QwtLegendItem::setIdentifierMode (intmode)"Set identifier mode. Default is ShowLine | ShowText. .PP \fBParameters:\fP .RS 4 \fImode\fP Or'd values of IdentifierMode .RE .PP \fBSee also:\fP .RS 4 \fBidentifierMode()\fP .RE .PP .SS "void QwtLegendItem::setIdentifierWidth (intwidth)"Set the width for the identifier Default is 8 pixels .PP \fBParameters:\fP .RS 4 \fIwidth\fP New width .RE .PP \fBSee also:\fP .RS 4 \fBidentifierMode()\fP, \fBidentifierWidth()\fP .RE .PP .SS "void QwtTextLabel::setIndent (intindent)\fC [inherited]\fP"Set label's text indent in pixels .PP \fBParameters:\fP .RS 4 \fIindent\fP Indentation in pixels .RE .PP .SS "void QwtLegendItem::setItemMode (\fBQwtLegend::LegendItemMode\fPmode)"Set the item mode The default is QwtLegend::ReadOnlyItem .PP \fBParameters:\fP .RS 4 \fImode\fP Item mode .RE .PP \fBSee also:\fP .RS 4 \fBitemMode()\fP .RE .PP .SS "void QwtTextLabel::setMargin (intmargin)\fC [inherited]\fP"Set label's margin in pixels .PP \fBParameters:\fP .RS 4 \fImargin\fP Margin in pixels .RE .PP .SS "void QwtLegendItem::setSpacing (intspacing)"Change the spacing .PP \fBParameters:\fP .RS 4 \fIspacing\fP Spacing .RE .PP \fBSee also:\fP .RS 4 \fBspacing()\fP, \fBidentifierWidth()\fP, \fBQwtTextLabel::margin()\fP .RE .PP .SS "void QwtLegendItem::setSymbol (const \fBQwtSymbol\fP &symbol)"Set curve symbol. .PP \fBParameters:\fP .RS 4 \fIsymbol\fP Symbol .RE .PP \fBSee also:\fP .RS 4 \fBsymbol()\fP .RE .PP .SS "void QwtLegendItem::setText (const \fBQwtText\fP &text)\fC [virtual]\fP"Set the text to the legend item .PP \fBParameters:\fP .RS 4 \fItext\fP Text label .RE .PP \fBSee also:\fP .RS 4 \fBQwtTextLabel::text()\fP .RE .PP .PP Reimplemented from \fBQwtTextLabel\fP. .SS "void QwtTextLabel::setText (const QString &text, \fBQwtText::TextFormat\fPtextFormat = \fCQwtText::AutoText\fP)\fC [slot, inherited]\fP"Change the label's text, keeping all other \fBQwtText\fP attributes .PP \fBParameters:\fP .RS 4 \fItext\fP New text .br \fItextFormat\fP Format of text .RE .PP \fBSee also:\fP .RS 4 \fBQwtText\fP .RE .PP .SS "QSize QwtLegendItem::sizeHint () const\fC [virtual]\fP" .PP Return a size hint. .PP Reimplemented from \fBQwtTextLabel\fP. .SS "int QwtLegendItem::spacing () const"Return the spacing .PP \fBSee also:\fP .RS 4 \fBsetSpacing()\fP, \fBidentifierWidth()\fP, \fBQwtTextLabel::margin()\fP .RE .PP .SS "const \fBQwtSymbol\fP & QwtLegendItem::symbol () const"\fBReturns:\fP .RS 4 The curve symbol. .RE .PP \fBSee also:\fP .RS 4 \fBsetSymbol()\fP .RE .PP .SS "const \fBQwtText\fP & QwtTextLabel::text () const\fC [inherited]\fP" .PP Return the text. .SS "QRect QwtTextLabel::textRect () const\fC [inherited]\fP"Calculate the rect for the text in widget coordinates .PP \fBReturns:\fP .RS 4 Text rect .RE .PP .SH "Author" .PP Generated automatically by Doxygen for Qwt User's Guide from the source code.