summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit/WebKit/qt/Api/qwebelement.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2010-05-20 14:36:25 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2010-05-20 14:36:25 (GMT)
commite4dc3567af533df2e57425952c4609726515d2cd (patch)
tree72824b5efc9a4d6ed9f099d34404076245e164fa /src/3rdparty/webkit/WebKit/qt/Api/qwebelement.cpp
parenta36e8ca7afd0c15e5ec73bf4ea21464ab89a3662 (diff)
parentdbfedcb31961579499fcb5342ccc42311191bcd4 (diff)
downloadQt-e4dc3567af533df2e57425952c4609726515d2cd.zip
Qt-e4dc3567af533df2e57425952c4609726515d2cd.tar.gz
Qt-e4dc3567af533df2e57425952c4609726515d2cd.tar.bz2
Merge remote branch 'origin/master'
Conflicts: src/gui/dialogs/qnspanelproxy_mac.mm
Diffstat (limited to 'src/3rdparty/webkit/WebKit/qt/Api/qwebelement.cpp')
-rw-r--r--src/3rdparty/webkit/WebKit/qt/Api/qwebelement.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebelement.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebelement.cpp
index 955206d..69146a2 100644
--- a/src/3rdparty/webkit/WebKit/qt/Api/qwebelement.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebelement.cpp
@@ -84,13 +84,27 @@ public:
\snippet webkitsnippets/webelement/main.cpp Traversing with QWebElement
+ Individual elements can be inspected or changed using methods such as attribute()
+ or setAttribute(). For examle, to capture the user's input in a text field for later
+ use (auto-completion), a browser could do something like this:
+
+ \snippet webkitsnippets/webelement/main.cpp autocomplete1
+
+ When the same page is later revisited, the browser can fill in the text field automatically
+ by modifying the value attribute of the input element:
+
+ \snippet webkitsnippets/webelement/main.cpp autocomplete2
+
+ Another use case is to emulate a click event on an element. The following
+ code snippet demonstrates how to call the JavaScript DOM method click() of
+ a submit button:
+
+ \snippet webkitsnippets/webelement/main.cpp Calling a DOM element method
+
The underlying content of QWebElement is explicitly shared. Creating a copy
of a QWebElement does not create a copy of the content. Instead, both
instances point to the same element.
- The element's attributes can be read using attribute() and modified with
- setAttribute().
-
The contents of child elements can be converted to plain text with
toPlainText(); to XHTML using toInnerXml(). To include the element's tag in
the output, use toOuterXml().