<?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"> <!-- qwebelement.cpp --> <head> <title>Qt 4.6: QWebElementCollection Class Reference</title> <link href="classic.css" rel="stylesheet" type="text/css" /> </head> <body> <a name="//apple_ref/cpp/cl//QWebElementCollection"></a> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td align="left" valign="top" width="32"><a href="http://qt.nokia.com/"><img src="images/qt-logo.png" align="left" border="0" /></a></td> <td width="1"> </td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a> · <a href="classes.html"><font color="#004faf">All Classes</font></a> · <a href="functions.html"><font color="#004faf">All Functions</font></a> · <a href="overviews.html"><font color="#004faf">Overviews</font></a></td></tr></table><h1 class="title">QWebElementCollection Class Reference<br /><span class="small-subtitle">[<a href="qtwebkit.html">QtWebKit</a> module]</span> </h1> <p>The QWebElementCollection class represents a collection of web elements. <a href="#details">More...</a></p> <pre> #include <QWebElementCollection></pre><p><b>This class is under development and is subject to change.</b></p> <p><b>This class is not part of the Qt GUI Framework Edition.</b></p> <p>This class was introduced in Qt 4.6.</p> <ul> <li><a href="qwebelementcollection-members.html">List of all members, including inherited members</a></li> </ul> <hr /> <a name="public-types"></a> <h2>Public Types</h2> <table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%"> <tr><td class="memItemLeft" align="right" valign="top">class </td><td class="memItemRight" valign="bottom"><b><a href="qwebelementcollection-const-iterator.html">const_iterator</a></b></td></tr> <tr><td class="memItemLeft" align="right" valign="top">class </td><td class="memItemRight" valign="bottom"><b><a href="qwebelementcollection-iterator.html">iterator</a></b></td></tr> </table> <hr /> <a name="public-functions"></a> <h2>Public Functions</h2> <table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%"> <tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qwebelementcollection.html#QWebElementCollection">QWebElementCollection</a></b> ()</td></tr> <tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qwebelementcollection.html#QWebElementCollection-2">QWebElementCollection</a></b> ( const QWebElement & <i>contextElement</i>, const QString & <i>query</i> )</td></tr> <tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qwebelementcollection.html#QWebElementCollection-3">QWebElementCollection</a></b> ( const QWebElementCollection & <i>other</i> )</td></tr> <tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qwebelementcollection.html#dtor.QWebElementCollection">~QWebElementCollection</a></b> ()</td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qwebelementcollection.html#append">append</a></b> ( const QWebElementCollection & <i>other</i> )</td></tr> <tr><td class="memItemLeft" align="right" valign="top">QWebElement </td><td class="memItemRight" valign="bottom"><b><a href="qwebelementcollection.html#at">at</a></b> ( int <i>i</i> ) const</td></tr> <tr><td class="memItemLeft" align="right" valign="top">const_iterator </td><td class="memItemRight" valign="bottom"><b><a href="qwebelementcollection.html#begin">begin</a></b> () const</td></tr> <tr><td class="memItemLeft" align="right" valign="top">iterator </td><td class="memItemRight" valign="bottom"><b><a href="qwebelementcollection.html#begin-2">begin</a></b> ()</td></tr> <tr><td class="memItemLeft" align="right" valign="top">const_iterator </td><td class="memItemRight" valign="bottom"><b><a href="qwebelementcollection.html#constBegin">constBegin</a></b> () const</td></tr> <tr><td class="memItemLeft" align="right" valign="top">const_iterator </td><td class="memItemRight" valign="bottom"><b><a href="qwebelementcollection.html#constEnd">constEnd</a></b> () const</td></tr> <tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><b><a href="qwebelementcollection.html#count">count</a></b> () const</td></tr> <tr><td class="memItemLeft" align="right" valign="top">const_iterator </td><td class="memItemRight" valign="bottom"><b><a href="qwebelementcollection.html#end">end</a></b> () const</td></tr> <tr><td class="memItemLeft" align="right" valign="top">iterator </td><td class="memItemRight" valign="bottom"><b><a href="qwebelementcollection.html#end-2">end</a></b> ()</td></tr> <tr><td class="memItemLeft" align="right" valign="top">QWebElement </td><td class="memItemRight" valign="bottom"><b><a href="qwebelementcollection.html#first">first</a></b> () const</td></tr> <tr><td class="memItemLeft" align="right" valign="top">QWebElement </td><td class="memItemRight" valign="bottom"><b><a href="qwebelementcollection.html#last">last</a></b> () const</td></tr> <tr><td class="memItemLeft" align="right" valign="top">QList<QWebElement> </td><td class="memItemRight" valign="bottom"><b><a href="qwebelementcollection.html#toList">toList</a></b> () const</td></tr> <tr><td class="memItemLeft" align="right" valign="top">QWebElementCollection </td><td class="memItemRight" valign="bottom"><b><a href="qwebelementcollection.html#operator-2b">operator+</a></b> ( const QWebElementCollection & <i>other</i> ) const</td></tr> <tr><td class="memItemLeft" align="right" valign="top">QWebElementCollection & </td><td class="memItemRight" valign="bottom"><b><a href="qwebelementcollection.html#operator-2b-eq">operator+=</a></b> ( const QWebElementCollection & <i>other</i> )</td></tr> <tr><td class="memItemLeft" align="right" valign="top">QWebElementCollection & </td><td class="memItemRight" valign="bottom"><b><a href="qwebelementcollection.html#operator-eq">operator=</a></b> ( const QWebElementCollection & <i>other</i> )</td></tr> <tr><td class="memItemLeft" align="right" valign="top">QWebElement </td><td class="memItemRight" valign="bottom"><b><a href="qwebelementcollection.html#operator-5b-5d">operator[]</a></b> ( int <i>position</i> ) const</td></tr> </table> <a name="details"></a> <hr /> <h2>Detailed Description</h2> <p>The QWebElementCollection class represents a collection of web elements.</p> <p>Elements in a document can be selected using <a href="qwebelement.html#findAll">QWebElement::findAll</a>() or using the <a href="qwebelement.html">QWebElement</a> constructor. The collection is composed by choosing all elements in the document that match a specified CSS selector expression.</p> <p>The number of selected elements is provided through the <a href="qwebelementcollection.html#count">count</a>() property. Individual elements can be retrieved by index using <a href="qwebelementcollection.html#at">at</a>().</p> <p>It is also possible to iterate through all elements in the collection using Qt's foreach macro:</p> <pre> QWebElementCollection collection = document.findAll("p"); foreach (QWebElement paraElement, collection) { ... }</pre> <hr /> <h2>Member Function Documentation</h2> <a name="//apple_ref/cpp/instm/QWebElementCollection/QWebElementCollection"></a> <h3 class="fn"><a name="QWebElementCollection"></a>QWebElementCollection::QWebElementCollection ()</h3> <p>Constructs an empty collection.</p> <h3 class="fn"><a name="QWebElementCollection-2"></a>QWebElementCollection::QWebElementCollection ( const <a href="qwebelement.html">QWebElement</a> & <i>contextElement</i>, const <a href="qstring.html">QString</a> & <i>query</i> )</h3> <p>Constructs a collection of elements from the list of child elements of <i>contextElement</i> that match the specified CSS selector <i>query</i>.</p> <h3 class="fn"><a name="QWebElementCollection-3"></a>QWebElementCollection::QWebElementCollection ( const QWebElementCollection & <i>other</i> )</h3> <p>Constructs a copy of <i>other</i>.</p> <a name="//apple_ref/cpp/instm/QWebElementCollection/~QWebElementCollection"></a> <h3 class="fn"><a name="dtor.QWebElementCollection"></a>QWebElementCollection::~QWebElementCollection ()</h3> <p>Destroys the collection.</p> <a name="//apple_ref/cpp/instm/QWebElementCollection/append"></a> <h3 class="fn"><a name="append"></a>void QWebElementCollection::append ( const QWebElementCollection & <i>other</i> )</h3> <p>Extends the collection by appending all items of <i>other</i>.</p> <p>The resulting collection may include duplicate elements.</p> <p>See also <a href="qwebelementcollection.html#operator-2b-eq">operator+=</a>().</p> <a name="//apple_ref/cpp/instm/QWebElementCollection/at"></a> <h3 class="fn"><a name="at"></a><a href="qwebelement.html">QWebElement</a> QWebElementCollection::at ( int <i>i</i> ) const</h3> <p>Returns the element at index position <i>i</i> in the collection.</p> <a name="//apple_ref/cpp/instm/QWebElementCollection/begin"></a> <h3 class="fn"><a name="begin"></a><a href="qwebelementcollection-const-iterator.html">const_iterator</a> QWebElementCollection::begin () const</h3> <p>Returns an STL-style iterator pointing to the first element in the collection.</p> <p>See also <a href="qwebelementcollection.html#end">end</a>().</p> <h3 class="fn"><a name="begin-2"></a><a href="qwebelementcollection-iterator.html">iterator</a> QWebElementCollection::begin ()</h3> <p>Returns an STL-style iterator pointing to the first element in the collection.</p> <p>See also <a href="qwebelementcollection.html#end">end</a>().</p> <a name="//apple_ref/cpp/instm/QWebElementCollection/constBegin"></a> <h3 class="fn"><a name="constBegin"></a><a href="qwebelementcollection-const-iterator.html">const_iterator</a> QWebElementCollection::constBegin () const</h3> <p>Returns an STL-style iterator pointing to the first element in the collection.</p> <p>See also <a href="qwebelementcollection.html#end">end</a>().</p> <a name="//apple_ref/cpp/instm/QWebElementCollection/constEnd"></a> <h3 class="fn"><a name="constEnd"></a><a href="qwebelementcollection-const-iterator.html">const_iterator</a> QWebElementCollection::constEnd () const</h3> <p>Returns an STL-style iterator pointing to the imaginary element after the last element in the list.</p> <p>See also <a href="qwebelementcollection.html#begin">begin</a>().</p> <a name="//apple_ref/cpp/instm/QWebElementCollection/count"></a> <h3 class="fn"><a name="count"></a>int QWebElementCollection::count () const</h3> <p>Returns the number of elements in the collection.</p> <a name="//apple_ref/cpp/instm/QWebElementCollection/end"></a> <h3 class="fn"><a name="end"></a><a href="qwebelementcollection-const-iterator.html">const_iterator</a> QWebElementCollection::end () const</h3> <p>Returns an STL-style iterator pointing to the imaginary element after the last element in the list.</p> <p>See also <a href="qwebelementcollection.html#begin">begin</a>().</p> <h3 class="fn"><a name="end-2"></a><a href="qwebelementcollection-iterator.html">iterator</a> QWebElementCollection::end ()</h3> <p>Returns an STL-style iterator pointing to the imaginary element after the last element in the list.</p> <p>See also <a href="qwebelementcollection.html#begin">begin</a>().</p> <a name="//apple_ref/cpp/instm/QWebElementCollection/first"></a> <h3 class="fn"><a name="first"></a><a href="qwebelement.html">QWebElement</a> QWebElementCollection::first () const</h3> <p>Returns the first element in the collection.</p> <p>See also <a href="qwebelementcollection.html#last">last</a>(), <a href="qwebelementcollection.html#operator-5b-5d">operator[]</a>(), <a href="qwebelementcollection.html#at">at</a>(), and <a href="qwebelementcollection.html#count">count</a>().</p> <a name="//apple_ref/cpp/instm/QWebElementCollection/last"></a> <h3 class="fn"><a name="last"></a><a href="qwebelement.html">QWebElement</a> QWebElementCollection::last () const</h3> <p>Returns the last element in the collection.</p> <p>See also <a href="qwebelementcollection.html#first">first</a>(), <a href="qwebelementcollection.html#operator-5b-5d">operator[]</a>(), <a href="qwebelementcollection.html#at">at</a>(), and <a href="qwebelementcollection.html#count">count</a>().</p> <a name="//apple_ref/cpp/instm/QWebElementCollection/toList"></a> <h3 class="fn"><a name="toList"></a><a href="qlist.html">QList</a><<a href="qwebelement.html">QWebElement</a>> QWebElementCollection::toList () const</h3> <p>Returns a <a href="qlist.html">QList</a> object with the elements contained in this collection.</p> <a name="//apple_ref/cpp/instm/QWebElementCollection/operator+"></a> <h3 class="fn"><a name="operator-2b"></a>QWebElementCollection QWebElementCollection::operator+ ( const QWebElementCollection & <i>other</i> ) const</h3> <p>Returns a collection that contains all the elements of this collection followed by all the elements in the <i>other</i> collection. Duplicates may occur in the result.</p> <p>See also <a href="qwebelementcollection.html#operator-2b-eq">operator+=</a>().</p> <a name="//apple_ref/cpp/instm/QWebElementCollection/operator+="></a> <h3 class="fn"><a name="operator-2b-eq"></a>QWebElementCollection & QWebElementCollection::operator+= ( const QWebElementCollection & <i>other</i> )</h3> <p>Appends the items of the <i>other</i> list to this list and returns a reference to this list.</p> <p>See also <a href="qwebelementcollection.html#operator-2b">operator+</a>() and <a href="qwebelementcollection.html#append">append</a>().</p> <a name="//apple_ref/cpp/instm/QWebElementCollection/operator="></a> <h3 class="fn"><a name="operator-eq"></a>QWebElementCollection & QWebElementCollection::operator= ( const QWebElementCollection & <i>other</i> )</h3> <p>Assigns <i>other</i> to this collection and returns a reference to this collection.</p> <a name="//apple_ref/cpp/instm/QWebElementCollection/operator[]"></a> <h3 class="fn"><a name="operator-5b-5d"></a><a href="qwebelement.html">QWebElement</a> QWebElementCollection::operator[] ( int <i>position</i> ) const</h3> <p>Returns the element at the specified <i>position</i> in the collection.</p> <p /><address><hr /><div align="center"> <table width="100%" cellspacing="0" border="0"><tr class="address"> <td width="40%" align="left">Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies)</td> <td width="20%" align="center"><a href="trademarks.html">Trademarks</a></td> <td width="40%" align="right"><div align="right">Qt 4.6.3</div></td> </tr></table></div></address></body> </html>