Movatterモバイル変換


[0]ホーム

URL:


We bake cookies in your browser for a better experience. Using this site means that you consent.Read More

Menu

Qt Documentation

QWebElementCollection Class

TheQWebElementCollection class represents a collection of web elements.More...

Header:#include <QWebElementCollection>
Since: Qt 4.6

This class is under development and is subject to change.

Public Types

Public Functions

QWebElementCollection()
QWebElementCollection(const QWebElement & contextElement, const QString & query)
QWebElementCollection(const QWebElementCollection & other)
~QWebElementCollection()
voidappend(const QWebElementCollection & other)
QWebElementat(int i) const
const_iteratorbegin() const
iteratorbegin()
const_iteratorconstBegin() const
const_iteratorconstEnd() const
intcount() const
const_iteratorend() const
iteratorend()
QWebElementfirst() const
QWebElementlast() const
QList<QWebElement>toList() const
QWebElementCollectionoperator+(const QWebElementCollection & other) const
QWebElementCollection &operator+=(const QWebElementCollection & other)
QWebElementCollection &operator=(const QWebElementCollection & other)
QWebElementoperator[](int position) const

Detailed Description

TheQWebElementCollection class represents a collection of web elements.

Elements in a document can be selected usingQWebElement::findAll() or using theQWebElement 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 thecount() property. Individual elements can be retrieved by index usingat().

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) {...}

Member Function Documentation

QWebElementCollection::QWebElementCollection()

Constructs an empty collection.

QWebElementCollection::QWebElementCollection(constQWebElement & contextElement, constQString & query)

Constructs a collection of elements from the list of child elements ofcontextElement that match the specified CSS selectorquery.

QWebElementCollection::QWebElementCollection(constQWebElementCollection & other)

Constructs a copy ofother.

QWebElementCollection::~QWebElementCollection()

Destroys the collection.

void QWebElementCollection::append(constQWebElementCollection & other)

Extends the collection by appending all items ofother.

The resulting collection may include duplicate elements.

See alsooperator+=().

QWebElement QWebElementCollection::at(int i) const

Returns the element at index positioni in the collection.

const_iterator QWebElementCollection::begin() const

Returns an STL-style iterator pointing to the first element in the collection.

See alsoend().

iterator QWebElementCollection::begin()

Returns an STL-style iterator pointing to the first element in the collection.

See alsoend().

const_iterator QWebElementCollection::constBegin() const

Returns an STL-style iterator pointing to the first element in the collection.

See alsoend().

const_iterator QWebElementCollection::constEnd() const

Returns an STL-style iterator pointing to the imaginary element after the last element in the list.

See alsobegin().

int QWebElementCollection::count() const

Returns the number of elements in the collection.

const_iterator QWebElementCollection::end() const

Returns an STL-style iterator pointing to the imaginary element after the last element in the list.

See alsobegin().

iterator QWebElementCollection::end()

Returns an STL-style iterator pointing to the imaginary element after the last element in the list.

See alsobegin().

QWebElement QWebElementCollection::first() const

Returns the first element in the collection.

See alsolast(),operator[](),at(), andcount().

QWebElement QWebElementCollection::last() const

Returns the last element in the collection.

See alsofirst(),operator[](),at(), andcount().

QList<QWebElement> QWebElementCollection::toList() const

Returns aQList object with the elements contained in this collection.

QWebElementCollection QWebElementCollection::operator+(constQWebElementCollection & other) const

Returns a collection that contains all the elements of this collection followed by all the elements in theother collection. Duplicates may occur in the result.

See alsooperator+=().

QWebElementCollection & QWebElementCollection::operator+=(constQWebElementCollection & other)

Appends the items of theother list to this list and returns a reference to this list.

See alsooperator+() andappend().

QWebElementCollection & QWebElementCollection::operator=(constQWebElementCollection & other)

Assignsother to this collection and returns a reference to this collection.

QWebElement QWebElementCollection::operator[](int position) const

Returns the element at the specifiedposition in the collection.

© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of theGNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.


[8]ページ先頭

©2009-2025 Movatter.jp