[190] | 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
---|
| 2 | <!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/kernel/qabstractlayout.cpp:1569 -->
|
---|
| 3 | <html>
|
---|
| 4 | <head>
|
---|
| 5 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
---|
| 6 | <title>QLayoutIterator Class</title>
|
---|
| 7 | <style type="text/css"><!--
|
---|
| 8 | fn { margin-left: 1cm; text-indent: -1cm; }
|
---|
| 9 | a:link { color: #004faf; text-decoration: none }
|
---|
| 10 | a:visited { color: #672967; text-decoration: none }
|
---|
| 11 | body { background: #ffffff; color: black; }
|
---|
| 12 | --></style>
|
---|
| 13 | </head>
|
---|
| 14 | <body>
|
---|
| 15 |
|
---|
| 16 | <table border="0" cellpadding="0" cellspacing="0" width="100%">
|
---|
| 17 | <tr bgcolor="#E5E5E5">
|
---|
| 18 | <td valign=center>
|
---|
| 19 | <a href="index.html">
|
---|
| 20 | <font color="#004faf">Home</font></a>
|
---|
| 21 | | <a href="classes.html">
|
---|
| 22 | <font color="#004faf">All Classes</font></a>
|
---|
| 23 | | <a href="mainclasses.html">
|
---|
| 24 | <font color="#004faf">Main Classes</font></a>
|
---|
| 25 | | <a href="annotated.html">
|
---|
| 26 | <font color="#004faf">Annotated</font></a>
|
---|
| 27 | | <a href="groups.html">
|
---|
| 28 | <font color="#004faf">Grouped Classes</font></a>
|
---|
| 29 | | <a href="functions.html">
|
---|
| 30 | <font color="#004faf">Functions</font></a>
|
---|
| 31 | </td>
|
---|
| 32 | <td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QLayoutIterator Class Reference</h1>
|
---|
| 33 |
|
---|
| 34 | <p>The QLayoutIterator class provides iterators over QLayoutItem.
|
---|
| 35 | <a href="#details">More...</a>
|
---|
| 36 | <p><tt>#include <<a href="qlayout-h.html">qlayout.h</a>></tt>
|
---|
| 37 | <p><a href="qlayoutiterator-members.html">List of all member functions.</a>
|
---|
| 38 | <h2>Public Members</h2>
|
---|
| 39 | <ul>
|
---|
| 40 | <li class=fn><a href="#QLayoutIterator"><b>QLayoutIterator</b></a> ( QGLayoutIterator * gi )</li>
|
---|
| 41 | <li class=fn><a href="#QLayoutIterator-2"><b>QLayoutIterator</b></a> ( const QLayoutIterator & i )</li>
|
---|
| 42 | <li class=fn><a href="#~QLayoutIterator"><b>~QLayoutIterator</b></a> ()</li>
|
---|
| 43 | <li class=fn>QLayoutIterator & <a href="#operator-eq"><b>operator=</b></a> ( const QLayoutIterator & i )</li>
|
---|
| 44 | <li class=fn>QLayoutItem * <a href="#operator++"><b>operator++</b></a> ()</li>
|
---|
| 45 | <li class=fn>QLayoutItem * <a href="#current"><b>current</b></a> ()</li>
|
---|
| 46 | <li class=fn>QLayoutItem * <a href="#takeCurrent"><b>takeCurrent</b></a> ()</li>
|
---|
| 47 | <li class=fn>void <a href="#deleteCurrent"><b>deleteCurrent</b></a> ()</li>
|
---|
| 48 | </ul>
|
---|
| 49 | <hr><a name="details"></a><h2>Detailed Description</h2>
|
---|
| 50 |
|
---|
| 51 |
|
---|
| 52 | The QLayoutIterator class provides iterators over <a href="qlayoutitem.html">QLayoutItem</a>.
|
---|
| 53 | <p>
|
---|
| 54 |
|
---|
| 55 | <p> Use <a href="qlayoutitem.html#iterator">QLayoutItem::iterator</a>() to create an iterator over a layout.
|
---|
| 56 | <p> QLayoutIterator uses <em>explicit</em> sharing with a reference count.
|
---|
| 57 | If an iterator is copied and one of the copies is modified, both
|
---|
| 58 | iterators will be modified.
|
---|
| 59 | <p> A QLayoutIterator is not protected against changes in its layout. If
|
---|
| 60 | the layout is modified or deleted the iterator will become invalid.
|
---|
| 61 | It is not possible to test for validity. It is safe to delete an
|
---|
| 62 | invalid layout; any other access may lead to an illegal memory
|
---|
| 63 | reference and the abnormal termination of the program.
|
---|
| 64 | <p> Calling <a href="#takeCurrent">takeCurrent</a>() or <a href="#deleteCurrent">deleteCurrent</a>() leaves the iterator in a
|
---|
| 65 | valid state, but may invalidate any other iterators that access the
|
---|
| 66 | same layout.
|
---|
| 67 | <p> The following code will draw a rectangle for each layout item in
|
---|
| 68 | the layout structure of the widget.
|
---|
| 69 | <pre>
|
---|
| 70 | static void paintLayout( <a href="qpainter.html">QPainter</a> *p, QLayoutItem *lay )
|
---|
| 71 | {
|
---|
| 72 | QLayoutIterator it = lay->iterator();
|
---|
| 73 | <a href="qlayoutitem.html">QLayoutItem</a> *child;
|
---|
| 74 | while ( (child = it.<a href="#current">current</a>()) != 0 ) {
|
---|
| 75 | paintLayout( p, child );
|
---|
| 76 | ++it;
|
---|
| 77 | }
|
---|
| 78 | p-><a href="qpainter.html#drawRect">drawRect</a>( lay->geometry() );
|
---|
| 79 | }
|
---|
| 80 | void ExampleWidget::paintEvent( <a href="qpaintevent.html">QPaintEvent</a> * )
|
---|
| 81 | {
|
---|
| 82 | <a href="qpainter.html">QPainter</a> p( this );
|
---|
| 83 | if ( layout() )
|
---|
| 84 | paintLayout( &p, layout() );
|
---|
| 85 | }
|
---|
| 86 | </pre>
|
---|
| 87 |
|
---|
| 88 | <p> All the functionality of QLayoutIterator is implemented by
|
---|
| 89 | subclasses of <a href="qglayoutiterator.html">QGLayoutIterator</a>. QLayoutIterator itself is not
|
---|
| 90 | designed to be subclassed.
|
---|
| 91 | <p>See also <a href="appearance.html">Widget Appearance and Style</a> and <a href="geomanagement.html">Layout Management</a>.
|
---|
| 92 |
|
---|
| 93 | <hr><h2>Member Function Documentation</h2>
|
---|
| 94 | <h3 class=fn><a name="QLayoutIterator"></a>QLayoutIterator::QLayoutIterator ( <a href="qglayoutiterator.html">QGLayoutIterator</a> * gi )
|
---|
| 95 | </h3>
|
---|
| 96 |
|
---|
| 97 | <p> Constructs an iterator based on <em>gi</em>. The constructed iterator
|
---|
| 98 | takes ownership of <em>gi</em> and will delete it.
|
---|
| 99 | <p> This constructor is provided for layout implementors. Application
|
---|
| 100 | programmers should use <a href="qlayoutitem.html#iterator">QLayoutItem::iterator</a>() to create an
|
---|
| 101 | iterator over a layout.
|
---|
| 102 |
|
---|
| 103 | <h3 class=fn><a name="QLayoutIterator-2"></a>QLayoutIterator::QLayoutIterator ( const <a href="qlayoutiterator.html">QLayoutIterator</a> & i )
|
---|
| 104 | </h3>
|
---|
| 105 |
|
---|
| 106 | <p> Creates a <a href="shclass.html#shallow-copy">shallow copy</a> of <em>i</em>, i.e. if the copy is modified, then
|
---|
| 107 | the original will also be modified.
|
---|
| 108 |
|
---|
| 109 | <h3 class=fn><a name="~QLayoutIterator"></a>QLayoutIterator::~QLayoutIterator ()
|
---|
| 110 | </h3>
|
---|
| 111 |
|
---|
| 112 | <p> Destroys the iterator.
|
---|
| 113 |
|
---|
| 114 | <h3 class=fn><a href="qlayoutitem.html">QLayoutItem</a> * <a name="current"></a>QLayoutIterator::current ()
|
---|
| 115 | </h3>
|
---|
| 116 |
|
---|
| 117 | <p> Returns the current item, or 0 if there is no current item.
|
---|
| 118 |
|
---|
| 119 | <h3 class=fn>void <a name="deleteCurrent"></a>QLayoutIterator::deleteCurrent ()
|
---|
| 120 | </h3>
|
---|
| 121 |
|
---|
| 122 | <p> Removes and deletes the current child item from the layout and
|
---|
| 123 | moves the iterator to the next item. This iterator will still be
|
---|
| 124 | valid, but any other iterator over the same layout may become
|
---|
| 125 | invalid.
|
---|
| 126 |
|
---|
| 127 | <h3 class=fn><a href="qlayoutitem.html">QLayoutItem</a> * <a name="operator++"></a>QLayoutIterator::operator++ ()
|
---|
| 128 | </h3>
|
---|
| 129 |
|
---|
| 130 | <p> Moves the iterator to the next child item and returns that item,
|
---|
| 131 | or 0 if there is no such item.
|
---|
| 132 |
|
---|
| 133 | <h3 class=fn><a href="qlayoutiterator.html">QLayoutIterator</a> & <a name="operator-eq"></a>QLayoutIterator::operator= ( const <a href="qlayoutiterator.html">QLayoutIterator</a> & i )
|
---|
| 134 | </h3>
|
---|
| 135 |
|
---|
| 136 | <p> Assigns <em>i</em> to this iterator and returns a reference to this
|
---|
| 137 | iterator.
|
---|
| 138 |
|
---|
| 139 | <h3 class=fn><a href="qlayoutitem.html">QLayoutItem</a> * <a name="takeCurrent"></a>QLayoutIterator::takeCurrent ()
|
---|
| 140 | </h3>
|
---|
| 141 |
|
---|
| 142 | <p> Removes the current child item from the layout without deleting
|
---|
| 143 | it, and moves the iterator to the next item. Returns the removed
|
---|
| 144 | item, or 0 if there was no item to be removed. This iterator will
|
---|
| 145 | still be valid, but any other iterator over the same layout may
|
---|
| 146 | become invalid.
|
---|
| 147 |
|
---|
| 148 | <!-- eof -->
|
---|
| 149 | <hr><p>
|
---|
| 150 | This file is part of the <a href="index.html">Qt toolkit</a>.
|
---|
| 151 | Copyright © 1995-2007
|
---|
| 152 | <a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
|
---|
| 153 | <table width=100% cellspacing=0 border=0><tr>
|
---|
| 154 | <td>Copyright © 2007
|
---|
| 155 | <a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
|
---|
| 156 | <td align=right><div align=right>Qt 3.3.8</div>
|
---|
| 157 | </table></div></address></body>
|
---|
| 158 | </html>
|
---|