summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorJocelyn Turcotte <jocelyn.turcotte@digia.com>2014-03-13 12:37:46 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-31 16:43:41 +0200
commit484f2d8c92e57cbe2c581a65a2ccf461eb68c883 (patch)
treeb19c2a65ab85a22a3e924d629ee8b6936efbff5d /examples
parent0862f71c8d3ee22ba9cf5173c262e78994999d5f (diff)
Rough port of the documentation to QtWebEngine
This is a gross mechanical modification of the documentation, along with build system bindings to allow it to generate. This should allow doing iterative improvements to the documentation from now on. This fixes project-related qdoc warnings but we still need to do some serious work to get the documentation better fitting QtWebEngine. All the documentation is ported to match the current state of our headers (without trying to adapt to modified APIs yet) and we should clear the part of the documentation that we don't need at the same time that we clean up our public headers. Change-Id: I6fb4e10e8b4c1c53be7bc7c581286248ac04d4da Reviewed-by: Andras Becsi <andras.becsi@digia.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/webenginewidgets/browser/doc/src/browser.qdoc9
-rw-r--r--examples/webenginewidgets/fancybrowser/doc/src/fancybrowser.qdoc25
-rw-r--r--examples/webenginewidgets/fancybrowser/mainwindow.cpp5
3 files changed, 19 insertions, 20 deletions
diff --git a/examples/webenginewidgets/browser/doc/src/browser.qdoc b/examples/webenginewidgets/browser/doc/src/browser.qdoc
index 4e53de38f..85cf44b80 100644
--- a/examples/webenginewidgets/browser/doc/src/browser.qdoc
+++ b/examples/webenginewidgets/browser/doc/src/browser.qdoc
@@ -26,12 +26,11 @@
****************************************************************************/
/*!
- \example webkitwidgets/browser
- \title Tab Browser
- \brief Demonstrates a complete web browsing experience
- \ingroup webkit-widgetexamples
+ \example browser
+ \title WebEngine Tab Browser Example
+ \brief The QtWebKit browser example ported to use QtWebEngine
- The Tab Browser example shows \l{Qt WebKit} module in action,
+ The Tab Browser example shows the \l{Qt WebEngine Widgets} module in action,
providing a little Web browser application with support for tabs.
\image browser-demo.png
diff --git a/examples/webenginewidgets/fancybrowser/doc/src/fancybrowser.qdoc b/examples/webenginewidgets/fancybrowser/doc/src/fancybrowser.qdoc
index c1de06332..60652c69a 100644
--- a/examples/webenginewidgets/fancybrowser/doc/src/fancybrowser.qdoc
+++ b/examples/webenginewidgets/fancybrowser/doc/src/fancybrowser.qdoc
@@ -26,10 +26,9 @@
****************************************************************************/
/*!
- \example webengine/fancybrowser
- \title Fancy Browser Example
+ \example fancybrowser
+ \title WebEngine Fancy Browser Example
\brief Demonstrates how to use browse web and manipulate content
- \ingroup webengine-widgetexamples
\brief The Fancy Browser example shows how to use JQuery with QtWebEngine to
create a web browser with special effects and content
@@ -46,7 +45,7 @@
The \c MainWindow class inherits QMainWindow. It implements a number of
slots to perform actions on both the application and on the web content.
- \snippet webenginewidgets/fancybrowser/mainwindow.h 1
+ \snippet fancybrowser/mainwindow.h 1
We also declare a QString that contains the jQuery, a QWebView
that displays the web content, and a QLineEdit that acts as the
@@ -56,7 +55,7 @@
We start by implementing the constructor.
- \snippet webenginewidgets/fancybrowser/mainwindow.cpp 1
+ \snippet fancybrowser/mainwindow.cpp 1
The first part of the constructor sets the value of \c progress to
0. This value will be used later in the code to visualize the
@@ -66,7 +65,7 @@
content. The jQuery library is a JavaScript library that provides different
functions for manipulating HTML.
- \snippet webenginewidgets/fancybrowser/mainwindow.cpp 2
+ \snippet fancybrowser/mainwindow.cpp 2
The second part of the constructor creates a QWebView and connects
slots to the views signals. Furthermore, we create a QLineEdit as
@@ -75,13 +74,13 @@
QLineEdit to a QToolbar together with a set of navigation actions
from QWebView::pageAction.
- \snippet webenginewidgets/fancybrowser/mainwindow.cpp 3
+ \snippet fancybrowser/mainwindow.cpp 3
The third and last part of the constructor implements two QMenus and assigns
a set of actions to them. The last line sets the QWebView as the central
widget in the QMainWindow.
- \snippet webenginewidgets/fancybrowser/mainwindow.cpp 4
+ \snippet fancybrowser/mainwindow.cpp 4
When the page is loaded, \c adjustLocation() updates the address
bar; \c adjustLocation() is triggered by the \c loadFinished()
@@ -90,13 +89,13 @@
the new web page has finished loading, \c adjustLocation() will be
run once more to update the address bar.
- \snippet webenginewidgets/fancybrowser/mainwindow.cpp 5
+ \snippet fancybrowser/mainwindow.cpp 5
\c adjustTitle() sets the window title and displays the loading
progress. This slot is triggered by the \c titleChanged() signal
in QWebView.
- \snippet webenginewidgets/fancybrowser/mainwindow.cpp 6
+ \snippet fancybrowser/mainwindow.cpp 6
When a web page has loaded, \c finishLoading() is triggered by the
\c loadFinished() signal in QWebView. \c finishLoading() then updates the
@@ -111,7 +110,7 @@
that the images of the newly loaded page respect the state of the toggle
action.
- \snippet webenginewidgets/fancybrowser/mainwindow.cpp 7
+ \snippet fancybrowser/mainwindow.cpp 7
The first jQuery-based function, \c highlightAllLinks(), is designed to
highlight all links in the current webpage. The JavaScript code looks
@@ -119,14 +118,14 @@
For each such element, the background color is set to be yellow by
using CSS.
- \snippet webenginewidgets/fancybrowser/mainwindow.cpp 8
+ \snippet fancybrowser/mainwindow.cpp 8
The \c rotateImages() function rotates the images on the current
web page. This JavaScript code relies on CSS transforms and
looks up all \e {img} elements and rotates the images 180 degrees
and then back again.
- \snippet webenginewidgets/fancybrowser/mainwindow.cpp 9
+ \snippet fancybrowser/mainwindow.cpp 9
The remaining four methods remove different elements from the current web
page. \c removeGifImages() removes all GIF images on the page by looking up
diff --git a/examples/webenginewidgets/fancybrowser/mainwindow.cpp b/examples/webenginewidgets/fancybrowser/mainwindow.cpp
index 3366d2006..a5a359350 100644
--- a/examples/webenginewidgets/fancybrowser/mainwindow.cpp
+++ b/examples/webenginewidgets/fancybrowser/mainwindow.cpp
@@ -70,8 +70,9 @@ MainWindow::MainWindow(const QUrl& url)
jQuery = file.readAll();
jQuery.append("\nvar qt = { 'jQuery': jQuery.noConflict(true) };");
file.close();
-
//! [1]
+
+//! [2]
view = new QWebEngineView(this);
view->load(url);
connect(view, SIGNAL(loadFinished(bool)), SLOT(adjustLocation()));
@@ -89,7 +90,7 @@ MainWindow::MainWindow(const QUrl& url)
toolBar->addAction(view->pageAction(QWebEnginePage::Reload));
toolBar->addAction(view->pageAction(QWebEnginePage::Stop));
toolBar->addWidget(locationEdit);
-//! [1]
+//! [2]
QMenu *viewMenu = menuBar()->addMenu(tr("&View"));
QAction* viewSourceAction = new QAction("Page Source", this);