QwtPlotTextLabel.3 3.89 KB
.TH "QwtPlotTextLabel" 3 "Sat Jan 26 2013" "Version 6.1-rc3" "Qwt User's Guide" \" -*- nroff -*-
.ad l
.nh
.SH NAME
QwtPlotTextLabel \- 
.PP
A plot item, which displays a text label\&.  

.SH SYNOPSIS
.br
.PP
.PP
\fC#include <qwt_plot_textlabel\&.h>\fP
.PP
Inherits \fBQwtPlotItem\fP\&.
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBQwtPlotTextLabel\fP ()"
.br
.RI "\fIConstructor\&. \fP"
.ti -1c
.RI "virtual \fB~QwtPlotTextLabel\fP ()"
.br
.RI "\fIDestructor\&. \fP"
.ti -1c
.RI "virtual int \fBrtti\fP () const "
.br
.ti -1c
.RI "void \fBsetText\fP (const \fBQwtText\fP &)"
.br
.ti -1c
.RI "\fBQwtText\fP \fBtext\fP () const "
.br
.ti -1c
.RI "void \fBsetMargin\fP (int \fBmargin\fP)"
.br
.ti -1c
.RI "int \fBmargin\fP () const "
.br
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "virtual void \fBdraw\fP (QPainter *, const \fBQwtScaleMap\fP &, const \fBQwtScaleMap\fP &, const QRectF &) const "
.br
.ti -1c
.RI "void \fBinvalidateCache\fP ()"
.br
.RI "\fIInvalidate all internal cache\&. \fP"
.in -1c
.SS "Additional Inherited Members"
.SH "Detailed Description"
.PP 
A plot item, which displays a text label\&. 

\fBQwtPlotTextLabel\fP displays a text label aligned to the plot canvas\&.
.PP
In opposite to \fBQwtPlotMarker\fP the position of the label is unrelated to plot coordinates\&.
.PP
As drawing a text is an expensive operation the label is cached in a pixmap to speed up replots\&.
.PP
\fBExample\fP
.RS 4
The following code shows how to add a title\&.
.RE
.PP
.PP
.nf
    QwtText title( "Plot Title" );
    title.setRenderFlags( Qt::AlignHCenter | Qt::AlignTop );

    QFont font;
    font.setBold( true );
    title.setFont( font );

    QwtPlotTextLabel *titleItem = new QwtPlotTextLabel();
    titleItem->setText( title );
    titleItem->attach( this );
.fi
.PP
.PP
\fBSee Also:\fP
.RS 4
\fBQwtPlotMarker\fP 
.RE
.PP

.SH "Constructor & Destructor Documentation"
.PP 
.SS "QwtPlotTextLabel::QwtPlotTextLabel ()"

.PP
Constructor\&. Initializes an text label with an empty text
.PP
Sets the following item attributes:
.PP
.IP "\(bu" 2
\fBQwtPlotItem::AutoScale\fP: true
.IP "\(bu" 2
\fBQwtPlotItem::Legend\fP: false
.PP
.PP
The z value is initialized by 150
.PP
\fBSee Also:\fP
.RS 4
\fBQwtPlotItem::setItemAttribute()\fP, \fBQwtPlotItem::setZ()\fP 
.RE
.PP

.SH "Member Function Documentation"
.PP 
.SS "void QwtPlotTextLabel::draw (QPainter *painter, const \fBQwtScaleMap\fP &xMap, const \fBQwtScaleMap\fP &yMap, const QRectF &canvasRect) const\fC [protected]\fP, \fC [virtual]\fP"
Draw the text label
.PP
\fBParameters:\fP
.RS 4
\fIpainter\fP Painter 
.br
\fIxMap\fP x Scale Map 
.br
\fIyMap\fP y Scale Map 
.br
\fIcanvasRect\fP Contents rectangle of the canvas in painter coordinates 
.RE
.PP

.PP
Implements \fBQwtPlotItem\fP\&.
.SS "int QwtPlotTextLabel::margin () const"
\fBReturns:\fP
.RS 4
Margin added to the contentsMargins() of the canvas 
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBsetMargin()\fP 
.RE
.PP

.SS "int QwtPlotTextLabel::rtti () const\fC [virtual]\fP"
\fBReturns:\fP
.RS 4
\fBQwtPlotItem::Rtti_PlotTextLabel\fP 
.RE
.PP

.PP
Reimplemented from \fBQwtPlotItem\fP\&.
.SS "void QwtPlotTextLabel::setMargin (intmargin)"
Set the margin
.PP
The margin is the distance between the contentsRect() of the plot canvas and the rectangle where the label can be displayed
.PP
\fBParameters:\fP
.RS 4
\fImargin\fP Margin
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBmargin()\fP 
.RE
.PP

.SS "void QwtPlotTextLabel::setText (const \fBQwtText\fP &text)"
Set the text
.PP
The label will be aligned to the plot canvas according to the alignment flags of text\&.
.PP
\fBParameters:\fP
.RS 4
\fItext\fP Text to be displayed
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBtext()\fP, \fBQwtText::renderFlags()\fP 
.RE
.PP

.SS "\fBQwtText\fP QwtPlotTextLabel::text () const"
\fBReturns:\fP
.RS 4
Text to be displayed 
.RE
.PP
\fBSee Also:\fP
.RS 4
\fBsetText()\fP 
.RE
.PP


.SH "Author"
.PP 
Generated automatically by Doxygen for Qwt User's Guide from the source code\&.