Sophie

Sophie

distrib > Mandriva > 8.2 > i586 > media > contrib > by-pkgid > 112b0974ad288f6cd55bf971ee6026a9 > files > 1454

libqt3-devel-3.0.2-2mdk.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- /tmp/qt-3.0-reggie-28534/qt-x11-free-3.0.2/src/widgets/qlabel.cpp:68 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>QLabel Class</title>
<style type="text/css"><!--
h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
body { background: #ffffff; color: black; }
--></style>
</head>
<body>

<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr bgcolor="#E5E5E5">
<td valign=center>
 <a href="index.html">
<font color="#004faf">Home</font></a>
 | <a href="classes.html">
<font color="#004faf">All&nbsp;Classes</font></a>
 | <a href="mainclasses.html">
<font color="#004faf">Main&nbsp;Classes</font></a>
 | <a href="annotated.html">
<font color="#004faf">Annotated</font></a>
 | <a href="groups.html">
<font color="#004faf">Grouped&nbsp;Classes</font></a>
 | <a href="functions.html">
<font color="#004faf">Functions</font></a>
</td>
<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QLabel Class Reference</h1>

<p>The QLabel widget provides a text or image display.
<a href="#details">More...</a>
<p><tt>#include &lt;<a href="qlabel-h.html">qlabel.h</a>&gt;</tt>
<p>Inherits <a href="qframe.html">QFrame</a>.
<p><a href="qlabel-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li><div class=fn><a href="#QLabel"><b>QLabel</b></a> ( QWidget&nbsp;*&nbsp;parent, const&nbsp;char&nbsp;*&nbsp;name = 0, WFlags&nbsp;f = 0 )</div></li>
<li><div class=fn><a href="#QLabel-2"><b>QLabel</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;text, QWidget&nbsp;*&nbsp;parent, const&nbsp;char&nbsp;*&nbsp;name = 0, WFlags&nbsp;f = 0 )</div></li>
<li><div class=fn><a href="#QLabel-3"><b>QLabel</b></a> ( QWidget&nbsp;*&nbsp;buddy, const&nbsp;QString&nbsp;&amp;&nbsp;text, QWidget&nbsp;*&nbsp;parent, const&nbsp;char&nbsp;*&nbsp;name = 0, WFlags&nbsp;f = 0 )</div></li>
<li><div class=fn><a href="#~QLabel"><b>~QLabel</b></a> ()</div></li>
<li><div class=fn>QString <a href="#text"><b>text</b></a> () const</div></li>
<li><div class=fn>QPixmap * <a href="#pixmap"><b>pixmap</b></a> () const</div></li>
<li><div class=fn>QPicture * <a href="#picture"><b>picture</b></a> () const</div></li>
<li><div class=fn>QMovie * <a href="#movie"><b>movie</b></a> () const</div></li>
<li><div class=fn>TextFormat <a href="#textFormat"><b>textFormat</b></a> () const</div></li>
<li><div class=fn>void <a href="#setTextFormat"><b>setTextFormat</b></a> ( TextFormat )</div></li>
<li><div class=fn>int <a href="#alignment"><b>alignment</b></a> () const</div></li>
<li><div class=fn>virtual void <a href="#setAlignment"><b>setAlignment</b></a> ( int )</div></li>
<li><div class=fn>int <a href="#indent"><b>indent</b></a> () const</div></li>
<li><div class=fn>void <a href="#setIndent"><b>setIndent</b></a> ( int )</div></li>
<li><div class=fn>bool autoResize () const &nbsp;<em>(obsolete)</em></div></li>
<li><div class=fn>virtual void setAutoResize ( bool&nbsp;enable ) &nbsp;<em>(obsolete)</em></div></li>
<li><div class=fn>bool <a href="#hasScaledContents"><b>hasScaledContents</b></a> () const</div></li>
<li><div class=fn>void <a href="#setScaledContents"><b>setScaledContents</b></a> ( bool )</div></li>
<li><div class=fn>virtual void <a href="#setBuddy"><b>setBuddy</b></a> ( QWidget&nbsp;*&nbsp;buddy )</div></li>
<li><div class=fn>QWidget * <a href="#buddy"><b>buddy</b></a> () const</div></li>
<li><div class=fn>virtual void <a href="#setFont"><b>setFont</b></a> ( const&nbsp;QFont&nbsp;&amp;&nbsp;f )</div></li>
</ul>
<h2>Public Slots</h2>
<ul>
<li><div class=fn>virtual void <a href="#setText"><b>setText</b></a> ( const QString &amp; )</div></li>
<li><div class=fn>virtual void <a href="#setPixmap"><b>setPixmap</b></a> ( const QPixmap &amp; )</div></li>
<li><div class=fn>virtual void <a href="#setPicture"><b>setPicture</b></a> ( const&nbsp;QPicture&nbsp;&amp;&nbsp;picture )</div></li>
<li><div class=fn>virtual void <a href="#setMovie"><b>setMovie</b></a> ( const&nbsp;QMovie&nbsp;&amp;&nbsp;movie )</div></li>
<li><div class=fn>virtual void <a href="#setNum"><b>setNum</b></a> ( int&nbsp;num )</div></li>
<li><div class=fn>virtual void <a href="#setNum-2"><b>setNum</b></a> ( double&nbsp;num )</div></li>
<li><div class=fn>void <a href="#clear"><b>clear</b></a> ()</div></li>
</ul>
<h2>Properties</h2>
<ul>
<li><div class=fn>Alignment <a href="#alignment-prop"><b>alignment</b></a>&nbsp;- the alignment of the label's contents</div></li>
<li><div class=fn>int <a href="#indent-prop"><b>indent</b></a>&nbsp;- the label's indent in pixels</div></li>
<li><div class=fn>QPixmap <a href="#pixmap-prop"><b>pixmap</b></a>&nbsp;- the label's pixmap</div></li>
<li><div class=fn>bool <a href="#scaledContents-prop"><b>scaledContents</b></a>&nbsp;- whether the label will scale its contents to fill all available space</div></li>
<li><div class=fn>QString <a href="#text-prop"><b>text</b></a>&nbsp;- the label text</div></li>
<li><div class=fn>TextFormat <a href="#textFormat-prop"><b>textFormat</b></a>&nbsp;- the label's text format</div></li>
</ul>
<h2>Protected Members</h2>
<ul>
<li><div class=fn>virtual void <a href="#drawContents"><b>drawContents</b></a> ( QPainter&nbsp;*&nbsp;p )</div></li>
</ul>
<hr><a name="details"></a><h2>Detailed Description</h2>


The QLabel widget provides a text or image display.
<p> 


<p> QLabel is used for displaying information in the form of text or
an image. No user interaction functionality is
provided. The visual appearance of the label can be configured in
various ways, and it can be used for specifying a focus accelerator
key for another widget.
<p> A QLabel can contain any of the following content types:
<ul>
<li> Plain text: set by passing a <a href="qstring.html">QString</a> to <a href="#setText">setText</a>().
<li> Rich text: set by passing a QString that contains rich text to setText().
<li> A pixmap: set by passing a <a href="qpixmap.html">QPixmap</a> to <a href="#setPixmap">setPixmap</a>().
<li> A movie: set by passing a <a href="qmovie.html">QMovie</a> to <a href="#setMovie">setMovie</a>().
<li> A number: set by passing an <em>int</em> or a <em>double</em> to <a href="#setNum">setNum</a>(), which converts the number to plain text.
<li> Nothing: the same as an empty plain text. This is the default. Set by <a href="#clear">clear</a>().
</ul>
<p> When the content is changed using any of these functions, any
previous content is cleared.
<p> The look of a QLabel can be tuned in several ways. All the settings
of <a href="qframe.html">QFrame</a> are available for specifying a widget frame. The
positioning of the content within the QLabel widget area can be
tuned with <a href="#setAlignment">setAlignment</a>() and <a href="#setIndent">setIndent</a>().  For example, this code
sets up a sunken panel with a two-line text in the bottom right
corner (both lines being flush with the right side of the label):
<p> <pre>
    QLabel *label = new QLabel;
    label-&gt;<a href="qframe.html#setFrameStyle">setFrameStyle</a>( QFrame::<a href="qframe.html#Shape-enum">Panel</a> | QFrame::<a href="qframe.html#Shadow-enum">Sunken</a> );
    label-&gt;<a href="#setText">setText</a>( "first line\nsecond line" );
    label-&gt;<a href="#setAlignment">setAlignment</a>( AlignBottom | AlignRight );
  </pre>
 
<p> A QLabel is often used as a label for an interactive widget. For this
use QLabel provides a useful mechanism for adding an accelerator key (see
<a href="qaccel.html">QAccel</a>) that will set the <a href="focus.html#keyboard-focus">keyboard focus</a> to the other widget (called the
QLabel's "buddy"). Example:
<p> <pre>
     <a href="qlineedit.html">QLineEdit</a>* phoneEdit = new <a href="qlineedit.html">QLineEdit</a>( this, "phoneEdit" );
     QLabel* phoneLabel = new QLabel( phoneEdit, "&amp;Phone:", this, "phoneLabel" );
  </pre>
 
<p> In this example, keyboard focus is transferred to the label's buddy
(the <a href="qlineedit.html">QLineEdit</a>) when the user presses <tt>Alt-P</tt>. You can also
use the <a href="#setBuddy">setBuddy</a>() function to accomplish the same thing.
<p> <img src=qlabel-m.png> <img src=qlabel-w.png>
<p> <p>See also <a href="qlineedit.html">QLineEdit</a>, <a href="qtextview.html">QTextView</a>, <a href="qpixmap.html">QPixmap</a>, <a href="qmovie.html">QMovie</a>, <a href="guibooks.html#fowler">GUI Design Handbook: Label</a>, <a href="basic.html">Basic Widgets</a> and <a href="text.html">Text Related Classes</a>.

<hr><h2>Member Function Documentation</h2>
<h3 class=fn><a name="QLabel"></a>QLabel::QLabel ( <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;parent, const&nbsp;char&nbsp;*&nbsp;name = 0, WFlags&nbsp;f = 0 )
</h3>
Constructs an empty label.
<p> The <em>parent</em>, <em>name</em> and widget flag <em>f</em>, arguments are passed
to the <a href="qframe.html">QFrame</a> constructor.
<p> <p>See also <a href="#alignment-prop">alignment</a>, <a href="qframe.html#setFrameStyle">setFrameStyle</a>() and <a href="#indent-prop">indent</a>.

<h3 class=fn><a name="QLabel-2"></a>QLabel::QLabel ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;text, <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;parent, const&nbsp;char&nbsp;*&nbsp;name = 0, WFlags&nbsp;f = 0 )
</h3>
Constructs a label that displays the text, <em>text</em>.
<p> The <em>parent</em>, <em>name</em> and widget flag <em>f</em>, arguments are passed
to the <a href="qframe.html">QFrame</a> constructor.
<p> <p>See also <a href="#text-prop">text</a>, <a href="#alignment-prop">alignment</a>, <a href="qframe.html#setFrameStyle">setFrameStyle</a>() and <a href="#indent-prop">indent</a>.

<h3 class=fn><a name="QLabel-3"></a>QLabel::QLabel ( <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;buddy, const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;text, <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;parent, const&nbsp;char&nbsp;*&nbsp;name = 0, WFlags&nbsp;f = 0 )
</h3>
Constructs a label that displays the text <em>text</em>. The label has a
buddy widget, <em>buddy</em>.
<p> If the <em>text</em> contains an underlined letter (a letter preceded by
an ampersand, &), and the text is in plain text format, when the
user presses Alt+ the underlined letter, focus is passed to the
buddy widget.
<p> The <em>parent</em>, <em>name</em> and widget flag, <em>f</em>, arguments are passed
to the <a href="qframe.html">QFrame</a> constructor.
<p> <p>See also <a href="#text-prop">text</a>, <a href="#setBuddy">setBuddy</a>(), <a href="#alignment-prop">alignment</a>, <a href="qframe.html#setFrameStyle">setFrameStyle</a>() and <a href="#indent-prop">indent</a>.

<h3 class=fn><a name="~QLabel"></a>QLabel::~QLabel ()
</h3>
Destroys the label.

<h3 class=fn>int <a name="alignment"></a>QLabel::alignment () const
</h3><p>Returns the alignment of the label's contents.
See the <a href="qlabel.html#alignment-prop">"alignment"</a> property for details.
<h3 class=fn>bool <a name="autoResize"></a>QLabel::autoResize () const
</h3>

<p> <b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
<p> Returns TRUE if auto-resizing is enabled, or FALSE if auto-resizing
is disabled.
<p> Auto-resizing is disabled by default.
<p> <p>See also <a href="#setAutoResize">setAutoResize</a>().

<h3 class=fn><a href="qwidget.html">QWidget</a>&nbsp;* <a name="buddy"></a>QLabel::buddy () const
</h3>
Returns the buddy of this label, or 0 if no buddy is currently set.
<p> <p>See also <a href="#setBuddy">setBuddy</a>().

<h3 class=fn>void <a name="clear"></a>QLabel::clear ()<tt> [slot]</tt>
</h3>
Clears any label contents. Equivalent to <a href="#setText">setText</a>( "" ).

<h3 class=fn>void <a name="drawContents"></a>QLabel::drawContents ( <a href="qpainter.html">QPainter</a>&nbsp;*&nbsp;p )<tt> [virtual protected]</tt>
</h3>
Draws the label contents using the painter <em>p</em>.

<p>Reimplemented from <a href="qframe.html#drawContents">QFrame</a>.
<h3 class=fn>bool <a name="hasScaledContents"></a>QLabel::hasScaledContents () const
</h3><p>Returns TRUE if the label will scale its contents to fill all available space; otherwise returns FALSE.
See the <a href="qlabel.html#scaledContents-prop">"scaledContents"</a> property for details.
<h3 class=fn>int <a name="indent"></a>QLabel::indent () const
</h3><p>Returns the label's indent in pixels.
See the <a href="qlabel.html#indent-prop">"indent"</a> property for details.
<h3 class=fn><a href="qmovie.html">QMovie</a>&nbsp;* <a name="movie"></a>QLabel::movie () const
</h3>
If the label contains a movie, returns a pointer to it. Otherwise,
returns 0.
<p> <p>See also <a href="#setMovie">setMovie</a>().

<h3 class=fn><a href="qpicture.html">QPicture</a>&nbsp;* <a name="picture"></a>QLabel::picture () const
</h3>

Returns the label's picture or 0 if the label doesn't have a
picture.

<h3 class=fn><a href="qpixmap.html">QPixmap</a>&nbsp;* <a name="pixmap"></a>QLabel::pixmap () const
</h3><p>Returns the label's pixmap.
See the <a href="qlabel.html#pixmap-prop">"pixmap"</a> property for details.
<h3 class=fn>void <a name="setAlignment"></a>QLabel::setAlignment ( int )<tt> [virtual]</tt>
</h3><p>Sets the alignment of the label's contents.
See the <a href="qlabel.html#alignment-prop">"alignment"</a> property for details.
<h3 class=fn>void <a name="setAutoResize"></a>QLabel::setAutoResize ( bool&nbsp;enable )<tt> [virtual]</tt>
</h3> <b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
<p> Enables auto-resizing if <em>enable</em> is TRUE, or disables it if <em>enable</em> is FALSE.
<p> When auto-resizing is enabled the label will resize itself to fit
the contents whenever the contents change. The top-left corner is
not moved. This is useful for QLabel widgets that are not managed by
a <a href="qlayout.html">QLayout</a> (e.g., top-level widgets).
<p> Auto-resizing is disabled by default.
<p> <p>See also <a href="#autoResize">autoResize</a>(), <a href="qwidget.html#adjustSize">adjustSize</a>() and <a href="qwidget.html#sizeHint-prop">sizeHint</a>.

<h3 class=fn>void <a name="setBuddy"></a>QLabel::setBuddy ( <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;buddy )<tt> [virtual]</tt>
</h3>
Sets the buddy of this label to <em>buddy</em>.
<p> When the user presses the accelerator key indicated by this label,
the <a href="focus.html#keyboard-focus">keyboard focus</a> is transferred to the label's buddy widget.
<p> The buddy mechanism is available only for QLabels that contain plain
text in which one letter is prefixed with an ampersand, &. This
letter is set as the accelerator key. The letter is displayed
underlined, and the '&' is not displayed (i.e. the <a href="qt.html#TextFlags-enum">ShowPrefix</a>
alignment flag is turned on; see <a href="#setAlignment">setAlignment</a>()).
<p> In a dialog, you might create two data entry widgets and a label for
each, and set up the geometry layout so each label is just to the
left of its data entry widget (its "buddy"), perhaps like this:
<p> <pre>
    <a href="qlineedit.html">QLineEdit</a> *nameEd  = new <a href="qlineedit.html">QLineEdit</a>( this );
    QLabel    *nameLb  = new QLabel( "&amp;Name:", this );
    nameLb-&gt;<a href="#setBuddy">setBuddy</a>( nameEd );
    <a href="qlineedit.html">QLineEdit</a> *phoneEd = new <a href="qlineedit.html">QLineEdit</a>( this );
    QLabel    *phoneLb = new QLabel( "&amp;Phone:", this );
    phoneLb-&gt;<a href="#setBuddy">setBuddy</a>( phoneEd );
    // ( layout setup not shown )
  </pre>
 
<p> With the code above, the focus jumps to the Name field when the user
presses Alt-N, and to the Phone field when the user presses Alt-P.
<p> To unset a previously set buddy, call this function with <em>buddy</em>
set to 0.
<p> <p>See also <a href="#buddy">buddy</a>(), <a href="#text-prop">text</a>, <a href="qaccel.html">QAccel</a> and <a href="#alignment-prop">alignment</a>.

<p>Example: <a href="addressbook-example.html#x1970">addressbook/centralwidget.cpp</a>.
<h3 class=fn>void <a name="setFont"></a>QLabel::setFont ( const&nbsp;<a href="qfont.html">QFont</a>&nbsp;&amp;&nbsp;f )<tt> [virtual]</tt>
</h3>
Sets the font used on the QLabel to font <em>f</em>.

<p>Reimplemented from <a href="qwidget.html#setFont">QWidget</a>.
<h3 class=fn>void <a name="setIndent"></a>QLabel::setIndent ( int )
</h3><p>Sets the label's indent in pixels.
See the <a href="qlabel.html#indent-prop">"indent"</a> property for details.
<h3 class=fn>void <a name="setMovie"></a>QLabel::setMovie ( const&nbsp;<a href="qmovie.html">QMovie</a>&nbsp;&amp;&nbsp;movie )<tt> [virtual slot]</tt>
</h3>
Sets the label contents to <em>movie</em>. Any previous content is cleared.
<p> The buddy accelerator, if any, is disabled.
<p> The label resizes itself if auto-resizing is enabled.
<p> <p>See also <a href="#movie">movie</a>() and <a href="#setBuddy">setBuddy</a>().

<h3 class=fn>void <a name="setNum"></a>QLabel::setNum ( int&nbsp;num )<tt> [virtual slot]</tt>
</h3>
Sets the label contents to plain text containing the printed
representation of integer <em>num</em>. Any previous content is cleared.
Does nothing if the integer's string representation is the same as
the current contents of the label.
<p> The buddy accelerator, if any, is disabled.
<p> The label resizes itself if auto-resizing is enabled.
<p> <p>See also <a href="#text-prop">text</a>, <a href="qstring.html#setNum">QString::setNum</a>() and <a href="#setBuddy">setBuddy</a>().

<h3 class=fn>void <a name="setNum-2"></a>QLabel::setNum ( double&nbsp;num )<tt> [virtual slot]</tt>
</h3> This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> Sets the label contents to plain text containing the printed
representation of double <em>num</em>. Any previous content is cleared.
Does nothing if the double's string representation is the same as
the current contents of the label.
<p> The buddy accelerator, if any, is disabled.
<p> The label resizes itself if auto-resizing is enabled.
<p> <p>See also <a href="#text-prop">text</a>, <a href="qstring.html#setNum">QString::setNum</a>() and <a href="#setBuddy">setBuddy</a>().

<h3 class=fn>void <a name="setPicture"></a>QLabel::setPicture ( const&nbsp;<a href="qpicture.html">QPicture</a>&nbsp;&amp;&nbsp;picture )<tt> [virtual slot]</tt>
</h3>
Sets the label contents to <em>picture</em>. Any previous content is cleared.
<p> The buddy accelerator, if any, is disabled.
<p> <p>See also <a href="#picture">picture</a>() and <a href="#setBuddy">setBuddy</a>().

<h3 class=fn>void <a name="setPixmap"></a>QLabel::setPixmap ( const&nbsp;<a href="qpixmap.html">QPixmap</a>&nbsp;&amp; )<tt> [virtual slot]</tt>
</h3><p>Sets the label's pixmap.
See the <a href="qlabel.html#pixmap-prop">"pixmap"</a> property for details.
<h3 class=fn>void <a name="setScaledContents"></a>QLabel::setScaledContents ( bool )
</h3><p>Sets whether the label will scale its contents to fill all available space.
See the <a href="qlabel.html#scaledContents-prop">"scaledContents"</a> property for details.
<h3 class=fn>void <a name="setText"></a>QLabel::setText ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp; )<tt> [virtual slot]</tt>
</h3><p>Sets the label text.
See the <a href="qlabel.html#text-prop">"text"</a> property for details.
<h3 class=fn>void <a name="setTextFormat"></a>QLabel::setTextFormat ( <a href="qt.html#TextFormat-enum">TextFormat</a> )
</h3><p>Sets the label's text format.
See the <a href="qlabel.html#textFormat-prop">"textFormat"</a> property for details.
<h3 class=fn><a href="qstring.html">QString</a> <a name="text"></a>QLabel::text () const
</h3><p>Returns the label text.
See the <a href="qlabel.html#text-prop">"text"</a> property for details.
<h3 class=fn><a href="qt.html#TextFormat-enum">TextFormat</a> <a name="textFormat"></a>QLabel::textFormat () const
</h3><p>Returns the label's text format.
See the <a href="qlabel.html#textFormat-prop">"textFormat"</a> property for details.
<hr><h2>Property Documentation</h2>
<h3 class=fn>Alignment <a name="alignment-prop"></a>alignment</h3>
<p>This property holds the alignment of the label's contents.
<p>The alignment is a bitwise OR of Qt::AlignmentFlags and
Qt::TextFlags values. The <a href="qt.html#TextFlags-enum">ExpandTabs</a>, <a href="qt.html#TextFlags-enum">SingleLine</a> and <a href="qt.html#TextFlags-enum">ShowPrefix</a> flags apply only if the label contains plain text;
otherwise they are ignored. The <a href="qt.html#TextFlags-enum">DontClip</a> flag is always
ignored. <a href="qt.html#TextFlags-enum">WordBreak</a> applies to both rich text and plain text
labels.
<p> If the label has a buddy, the <a href="qt.html#TextFlags-enum">ShowPrefix</a> flag is forced to TRUE.
<p> The default alignment is <tt>AlignAuto | AlignVCenter | ExpandTabs</tt>
if the label doesn't have a buddy and <tt>AlignAuto | AlignVCenter | ExpandTabs | ShowPrefix</tt> if the label has a buddy. If the label
contains rich text, additionally <a href="qt.html#TextFlags-enum">WordBreak</a> is turned on.
<p> <p>See also <a href="qt.html#AlignmentFlags-enum">Qt::AlignmentFlags</a>, <a href="#alignment-prop">alignment</a>, <a href="#setBuddy">setBuddy</a>() and <a href="#text-prop">text</a>.

<p>Set this property's value with <a href="#setAlignment">setAlignment</a>() and get this property's value with <a href="#alignment">alignment</a>().
<h3 class=fn>int <a name="indent-prop"></a>indent</h3>
<p>This property holds the label's indent in pixels.
<p>The indent applies to the left edge if <a href="#alignment">alignment</a>() is <a href="qt.html#AlignmentFlags-enum">AlignLeft</a>,
to the right edge if alignment() is <a href="qt.html#AlignmentFlags-enum">AlignRight</a>, to the top edge
if alignment() is <a href="qt.html#AlignmentFlags-enum">AlignTop</a>, and to to the bottom edge if
alignment() is <a href="qt.html#AlignmentFlags-enum">AlignBottom</a>.
<p> If the indent is negative, or if no indent has been set, the label
computes the effective indent as follows: if <a href="qframe.html#frameWidth">frameWidth</a>() is 0, the
effective indent becomes 0. If frameWidth() is greater than 0, the
effective indent becomes half the width of the "x" character of the
widget's current <a href="qwidget.html#font">font</a>().
<p> <p>See also <a href="#alignment-prop">alignment</a>, <a href="qframe.html#frameWidth-prop">frameWidth</a> and <a href="qwidget.html#font-prop">font</a>.

<p>Set this property's value with <a href="#setIndent">setIndent</a>() and get this property's value with <a href="#indent">indent</a>().
<h3 class=fn><a href="qpixmap.html">QPixmap</a> <a name="pixmap-prop"></a>pixmap</h3>
<p>This property holds the label's pixmap.
<p>If no pixmap has been set this will return an invalid pixmap.
<p> Setting the pixmap clears any previous content, and resizes the label
if <a href="#autoResize">QLabel::autoResize</a>() is TRUE. The buddy accelerator, if any,
is disabled.

<p>Set this property's value with <a href="#setPixmap">setPixmap</a>() and get this property's value with <a href="#pixmap">pixmap</a>().
<h3 class=fn>bool <a name="scaledContents-prop"></a>scaledContents</h3>
<p>This property holds whether the label will scale its contents to fill all available space.
<p>When enabled and the label shows a pixmap, it will scale the pixmap to
fill the available space.
<p> This property's default is FALSE.
<p> <p>See also <a href="#scaledContents-prop">scaledContents</a>.

<p>Set this property's value with <a href="#setScaledContents">setScaledContents</a>() and get this property's value with <a href="#hasScaledContents">hasScaledContents</a>().
<h3 class=fn><a href="qstring.html">QString</a> <a name="text-prop"></a>text</h3>
<p>This property holds the label text.
<p>If no text has been set this will return an empty string. Setting the
text clears any previous content, unless they are the same.
<p> The text will be interpreted either as a plain text or as a rich text,
depending on the text format setting; see <a href="#setTextFormat">setTextFormat</a>(). The default
setting is <a href="qt.html#TextFormat-enum">AutoText</a>, i.e. QLabel will try to auto-detect the format
of the text set.
<p> If the text is interpreted as a plain text and a buddy has been set, the
buddy accelerator key is updated from the new text.
<p> The label resizes itself if auto-resizing is enabled.
<p> Note that Qlabel is well-suited to display small rich text documents
only. Those small documents get their document specific settings
(font, text color, link color) from the label's palette and font
properties. For large documents, use QTextView instead. QTextView
will flicker less on resize and can also provide a scrollbar, when
necessary.
<p> <p>See also <a href="#text-prop">text</a>, <a href="#textFormat-prop">textFormat</a>, <a href="#setBuddy">setBuddy</a>() and <a href="#alignment-prop">alignment</a>.

<p>Set this property's value with <a href="#setText">setText</a>() and get this property's value with <a href="#text">text</a>().
<h3 class=fn><a href="qt.html#TextFormat-enum">TextFormat</a> <a name="textFormat-prop"></a>textFormat</h3>
<p>This property holds the label's text format.
<p>See the Qt::TextFormat enum for an explanation of the possible options.
<p> The default format is <a href="qt.html#TextFormat-enum">AutoText</a>.
<p> <p>See also <a href="#text-prop">text</a>.

<p>Set this property's value with <a href="#setTextFormat">setTextFormat</a>() and get this property's value with <a href="#textFormat">textFormat</a>().
<!-- eof -->
<hr><p>
This file is part of the <a href="index.html">Qt toolkit</a>.
Copyright &copy; 1995-2001
<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
<table width=100% cellspacing=0 border=0><tr>
<td>Copyright &copy; 2001 
<a href="http://www.trolltech.com">Trolltech</a><td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a>
<td align=right><div align=right>Qt version 3.0.2</div>
</table></div></address></body>
</html>