Sophie

Sophie

distrib > CentOS > 5 > x86_64 > by-pkgid > ac91357d6caede925de099a02fced14e > files > 4130

qt4-doc-4.2.1-1.el5_7.1.x86_64.rpm

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- /tmp/qt-4.2.1-harald-1161357942206/qt-x11-opensource-src-4.2.1/src/gui/graphicsview/qgraphicsitem.cpp -->
<head>
  <title>Qt 4.2: QGraphicsLineItem Class Reference</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><a href="http://www.trolltech.com/products/qt"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></a></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a>&nbsp;&middot; <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a>&nbsp;&middot; <a href="modules.html"><font color="#004faf">Modules</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
<td align="right" valign="top" width="230"><a href="http://www.trolltech.com"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></a></td></tr></table><h1 align="center">QGraphicsLineItem Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1>
<p>The QGraphicsLineItem class provides a line item that you can add to a <a href="qgraphicsscene.html">QGraphicsScene</a>. <a href="#details">More...</a></p>
<pre> #include &lt;QGraphicsLineItem&gt;</pre><p>Inherits <a href="qgraphicsitem.html">QGraphicsItem</a>.</p>
<p>This class was introduced in Qt 4.2.</p>
<ul>
<li><a href="qgraphicslineitem-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-functions"></a>
<h3>Public Functions</h3>
<ul>
<li><div class="fn"/><b><a href="qgraphicslineitem.html#QGraphicsLineItem">QGraphicsLineItem</a></b> ( QGraphicsItem * <i>parent</i> = 0, QGraphicsScene * <i>scene</i> = 0 )</li>
<li><div class="fn"/><b><a href="qgraphicslineitem.html#QGraphicsLineItem-2">QGraphicsLineItem</a></b> ( const QLineF &amp; <i>line</i>, QGraphicsItem * <i>parent</i> = 0, QGraphicsScene * <i>scene</i> = 0 )</li>
<li><div class="fn"/><b><a href="qgraphicslineitem.html#QGraphicsLineItem-3">QGraphicsLineItem</a></b> ( qreal <i>x1</i>, qreal <i>y1</i>, qreal <i>x2</i>, qreal <i>y2</i>, QGraphicsItem * <i>parent</i> = 0, QGraphicsScene * <i>scene</i> = 0 )</li>
<li><div class="fn"/><b><a href="qgraphicslineitem.html#dtor.QGraphicsLineItem">~QGraphicsLineItem</a></b> ()</li>
<li><div class="fn"/>QLineF <b><a href="qgraphicslineitem.html#line">line</a></b> () const</li>
<li><div class="fn"/>QPen <b><a href="qgraphicslineitem.html#pen">pen</a></b> () const</li>
<li><div class="fn"/>void <b><a href="qgraphicslineitem.html#setLine">setLine</a></b> ( const QLineF &amp; <i>line</i> )</li>
<li><div class="fn"/>void <b><a href="qgraphicslineitem.html#setLine-2">setLine</a></b> ( qreal <i>x1</i>, qreal <i>y1</i>, qreal <i>x2</i>, qreal <i>y2</i> )</li>
<li><div class="fn"/>void <b><a href="qgraphicslineitem.html#setPen">setPen</a></b> ( const QPen &amp; <i>pen</i> )</li>
</ul>
<ul>
<li><div class="fn"/>105 public functions inherited from <a href="qgraphicsitem.html#public-functions">QGraphicsItem</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li><div class="fn"/>1 static public member inherited from <a href="qgraphicsitem.html#static-public-members">QGraphicsItem</a></li>
<li><div class="fn"/>23 protected functions inherited from <a href="qgraphicsitem.html#protected-functions">QGraphicsItem</a></li>
</ul>
<a name="details"></a>
<hr />
<h2>Detailed Description</h2>
<p>The QGraphicsLineItem class provides a line item that you can add to a <a href="qgraphicsscene.html">QGraphicsScene</a>.</p>
<p>To set the item's line, pass a <a href="qlinef.html">QLineF</a> to QGraphicsLineItem's constructor, or call the <a href="qgraphicslineitem.html#setLine">setLine</a>() function. The <a href="qgraphicslineitem.html#line">line</a>() function returns the current line. By default the line is black with a width of 0, but you can change this by calling <a href="qgraphicslineitem.html#setPen">setPen</a>().</p>
<p align="center"><img src="images/graphicsview-lineitem.png" /></p><p>QGraphicsLineItem uses the line and the pen width to provide a reasonable implementation of <a href="qgraphicsitem.html#boundingRect">boundingRect</a>(), <a href="qgraphicsitem.html#shape">shape</a>(), and <a href="qgraphicsitem.html#contains">contains</a>(). The <a href="qgraphicsitem.html#paint">paint</a>() function draws the line using the item's associated pen.</p>
<p>See also <a href="qgraphicspathitem.html">QGraphicsPathItem</a>, <a href="qgraphicsrectitem.html">QGraphicsRectItem</a>, <a href="qgraphicsellipseitem.html">QGraphicsEllipseItem</a>, <a href="qgraphicstextitem.html">QGraphicsTextItem</a>, <a href="qgraphicspolygonitem.html">QGraphicsPolygonItem</a>, <a href="qgraphicspixmapitem.html">QGraphicsPixmapItem</a>, and <a href="graphicsview.html">The Graphics View Framework</a>.</p>
<hr />
<h2>Member Function Documentation</h2>
<h3 class="fn"><a name="QGraphicsLineItem"></a>QGraphicsLineItem::QGraphicsLineItem ( <a href="qgraphicsitem.html">QGraphicsItem</a> * <i>parent</i> = 0, <a href="qgraphicsscene.html">QGraphicsScene</a> * <i>scene</i> = 0 )</h3>
<p>Constructs a <a href="qgraphicslineitem.html">QGraphicsLineItem</a>. The <i>parent</i> and <i>scene</i> parameters are passed to <a href="qgraphicsitem.html">QGraphicsItem</a>'s constructor.</p>
<h3 class="fn"><a name="QGraphicsLineItem-2"></a>QGraphicsLineItem::QGraphicsLineItem ( const <a href="qlinef.html">QLineF</a> &amp; <i>line</i>, <a href="qgraphicsitem.html">QGraphicsItem</a> * <i>parent</i> = 0, <a href="qgraphicsscene.html">QGraphicsScene</a> * <i>scene</i> = 0 )</h3>
<p>Constructs a <a href="qgraphicslineitem.html">QGraphicsLineItem</a>, using <i>line</i> as the default line. The <i>parent</i> and <i>scene</i> parameters are passed to <a href="qgraphicsitem.html">QGraphicsItem</a>'s constructor.</p>
<h3 class="fn"><a name="QGraphicsLineItem-3"></a>QGraphicsLineItem::QGraphicsLineItem ( <a href="qtglobal.html#qreal-typedef">qreal</a> <i>x1</i>, <a href="qtglobal.html#qreal-typedef">qreal</a> <i>y1</i>, <a href="qtglobal.html#qreal-typedef">qreal</a> <i>x2</i>, <a href="qtglobal.html#qreal-typedef">qreal</a> <i>y2</i>, <a href="qgraphicsitem.html">QGraphicsItem</a> * <i>parent</i> = 0, <a href="qgraphicsscene.html">QGraphicsScene</a> * <i>scene</i> = 0 )</h3>
<p>Constructs a <a href="qgraphicslineitem.html">QGraphicsLineItem</a>, using the line between (<i>x1</i>, <i>y1</i>) and (<i>x2</i>, <i>y2</i>) as the default line. The <i>parent</i> and <i>scene</i> parameters are passed to <a href="qgraphicsitem.html">QGraphicsItem</a>'s constructor.</p>
<h3 class="fn"><a name="dtor.QGraphicsLineItem"></a>QGraphicsLineItem::~QGraphicsLineItem ()</h3>
<p>Destroys the <a href="qgraphicslineitem.html">QGraphicsLineItem</a>.</p>
<h3 class="fn"><a name="line"></a><a href="qlinef.html">QLineF</a> QGraphicsLineItem::line () const</h3>
<p>Returns the item's line, or a null line if no line has been set.</p>
<p>See also <a href="qgraphicslineitem.html#setLine">setLine</a>().</p>
<h3 class="fn"><a name="pen"></a><a href="qpen.html">QPen</a> QGraphicsLineItem::pen () const</h3>
<p>Returns the item's pen, or a black solid 0-width pen if no pen has been set.</p>
<p>See also <a href="qgraphicslineitem.html#setPen">setPen</a>().</p>
<h3 class="fn"><a name="setLine"></a>void QGraphicsLineItem::setLine ( const <a href="qlinef.html">QLineF</a> &amp; <i>line</i> )</h3>
<p>Sets the item's line to be the given <i>line</i>.</p>
<p>See also <a href="qgraphicslineitem.html#line">line</a>().</p>
<h3 class="fn"><a name="setLine-2"></a>void QGraphicsLineItem::setLine ( <a href="qtglobal.html#qreal-typedef">qreal</a> <i>x1</i>, <a href="qtglobal.html#qreal-typedef">qreal</a> <i>y1</i>, <a href="qtglobal.html#qreal-typedef">qreal</a> <i>x2</i>, <a href="qtglobal.html#qreal-typedef">qreal</a> <i>y2</i> )</h3>
<p>This is an overloaded member function, provided for convenience.</p>
<p>Sets the item's line to be the line between (<i>x1</i>, <i>y1</i>) and (<i>x2</i>, <i>y2</i>).</p>
<p>This is the same as calling <tt>setLine(QLineF(x1, y1, x2, y2))</tt>.</p>
<h3 class="fn"><a name="setPen"></a>void QGraphicsLineItem::setPen ( const <a href="qpen.html">QPen</a> &amp; <i>pen</i> )</h3>
<p>Sets the item's pen to <i>pen</i>. If no pen is set, the line will be painted using a black solid 0-width pen.</p>
<p>See also <a href="qgraphicslineitem.html#pen">pen</a>().</p>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="30%">Copyright &copy; 2006 <a href="trolltech.html">Trolltech</a></td>
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
<td width="30%" align="right"><div align="right">Qt 4.2.1</div></td>
</tr></table></div></address></body>
</html>