Note
This class was introduced in Qt 4.6
The PySide.QtWebKit.QWebElementCollection class represents a collection of web elements.
Elements in a document can be selected using QWebElement.findAll() or using the PySide.QtWebKit.QWebElement constructor. The collection is composed by choosing all elements in the document that match a specified CSS selector expression.
The number of selected elements is provided through the PySide.QtWebKit.QWebElementCollection.count() property. Individual elements can be retrieved by index using PySide.QtWebKit.QWebElementCollection.at() .
It is also possible to iterate through all elements in the collection using Qt’s foreach macro:
QWebElementCollection collection = document.findAll("p"); foreach (QWebElement paraElement, collection) { ... }
Parameters: |
|
---|
Constructs an empty collection.
Constructs a collection of elements from the list of child elements of contextElement that match the specified CSS selector query .
Constructs a copy of other .
Parameters: | collection – PySide.QtWebKit.QWebElementCollection |
---|
Extends the collection by appending all items of other .
The resulting collection may include duplicate elements.
See also
PySide.QtWebKit.QWebElementCollection.operator+=()
Parameters: | i – PySide.QtCore.int |
---|---|
Return type: | PySide.QtWebKit.QWebElement |
Returns the element at index position i in the collection.
Return type: | PySide.QtCore.int |
---|
Returns the number of elements in the collection.
Return type: | PySide.QtWebKit.QWebElement |
---|
Returns the first element in the collection.
See also
PySide.QtWebKit.QWebElementCollection.last() PySide.QtWebKit.QWebElementCollection.operator[]() PySide.QtWebKit.QWebElementCollection.at() PySide.QtWebKit.QWebElementCollection.count()
Return type: | PySide.QtWebKit.QWebElement |
---|
Returns the last element in the collection.
See also
PySide.QtWebKit.QWebElementCollection.first() PySide.QtWebKit.QWebElementCollection.operator[]() PySide.QtWebKit.QWebElementCollection.at() PySide.QtWebKit.QWebElementCollection.count()
Parameters: | other – PySide.QtWebKit.QWebElementCollection |
---|---|
Return type: | PySide.QtWebKit.QWebElementCollection |
Returns a collection that contains all the elements of this collection followed by all the elements in the other collection. Duplicates may occur in the result.
See also
PySide.QtWebKit.QWebElementCollection.operator+=()
Parameters: | other – PySide.QtWebKit.QWebElementCollection |
---|---|
Return type: | PySide.QtWebKit.QWebElementCollection |
Appends the items of the other list to this list and returns a reference to this list.
See also
PySide.QtWebKit.QWebElementCollection.operator+() PySide.QtWebKit.QWebElementCollection.append()
Parameters: | i – PySide.QtCore.int |
---|---|
Return type: | PySide.QtWebKit.QWebElement |
Returns the element at the specified position in the collection.
Return type: |
---|
Returns a QList object with the elements contained in this collection.