summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVenugopal Shivashankar <venugopal.shivashankar@digia.com>2012-12-17 16:36:06 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-12-17 17:39:00 +0100
commit3e5b10ab5a4b6be7e71dd03c601067908048eedd (patch)
tree662b76c5ac907bf258efa9198fecdc21e83b7a35
parent544fa3c1c405b951dff132ed0f4bd168d3c8b67f (diff)
downloadqtwebkit-examples-3e5b10ab5a4b6be7e71dd03c601067908048eedd.tar.gz
Doc: Fixed the \snippet paths in the example documentationv5.0.0
The \snippet paths in the WebKit widget example documents now reflect the new directory structure of the examples. Task-number: QTBUG-27515 Change-Id: I6153f7728cc6217a38a62bb04a7bfe3794823e2a Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
-rw-r--r--examples/webkitwidgets/domtraversal/doc/src/domtraversal.qdoc12
-rw-r--r--examples/webkitwidgets/fancybrowser/doc/src/fancybrowser.qdoc20
-rw-r--r--examples/webkitwidgets/imageanalyzer/doc/images/webkit-imageanalyzer-complete.png (renamed from examples/webkitwidgets/imageanalyzer/doc/images/wekit-imageanalyzer-complete.png)bin326357 -> 326357 bytes
-rw-r--r--examples/webkitwidgets/imageanalyzer/doc/src/webkit-bridge-imageanalyzer.qdoc30
-rw-r--r--examples/webkitwidgets/previewer/doc/src/previewer.qdoc30
-rw-r--r--examples/webkitwidgets/scroller/wheel/doc/src/wheel.qdoc8
-rw-r--r--examples/webkitwidgets/scroller/wheel/wheelwidget.cpp3
-rw-r--r--examples/webkitwidgets/simpleselector/doc/src/simpleselector.qdoc12
-rw-r--r--examples/webkitwidgets/xmlpatterns/doc/src/qobjectxmlmodel.qdoc38
9 files changed, 77 insertions, 76 deletions
diff --git a/examples/webkitwidgets/domtraversal/doc/src/domtraversal.qdoc b/examples/webkitwidgets/domtraversal/doc/src/domtraversal.qdoc
index b28f115..cd48938 100644
--- a/examples/webkitwidgets/domtraversal/doc/src/domtraversal.qdoc
+++ b/examples/webkitwidgets/domtraversal/doc/src/domtraversal.qdoc
@@ -51,7 +51,7 @@
using \l{Qt Designer}. As a result, the class is also derived from the user
interface class created by \l uic:
- \snippet domtraversal/window.h Window class definition
+ \snippet webkitwidgets/domtraversal/window.h Window class definition
Two important functions to note are the \c on_webView_loadFinished() slot and
the \c examineChildElements() function. The former is automatically called
@@ -67,13 +67,13 @@
In the \c Window class constructor, we call the \l{QWidget::}{setupUi()} function
to set up the user interface described in the \c{window.ui} file:
- \snippet domtraversal/window.cpp Window constructor
+ \snippet webkitwidgets/domtraversal/window.cpp Window constructor
When the Web page is loaded, the \c on_webView_loadFinished() slot is called. Here,
we clear the tree widget and begin inspection of the document by obtaining the
document element from the page's main frame:
- \snippet domtraversal/window.cpp begin document inspection
+ \snippet webkitwidgets/domtraversal/window.cpp begin document inspection
At this point, we call the \c examineChildElements() function to traverse the
document, starting with the child elements of the document element for which we
@@ -86,7 +86,7 @@
\l{QWebElement::}{isNull()} function, we create a new QTreeWidgetItem instance with
the element name and add it to the parent item.
- \snippet domtraversal/window.cpp traverse document
+ \snippet webkitwidgets/domtraversal/window.cpp traverse document
We recursively examine the child elements for each element by calling
\c examineChildElements() with the current child element and the newly-created item.
@@ -99,14 +99,14 @@
For completeness, we show the \c setUrl() function, which is provided to allow the
document URL to be set from the example's \c main() function.
- \snippet domtraversal/window.cpp set URL
+ \snippet webkitwidgets/domtraversal/window.cpp set URL
\section1 Starting the Example
We set up the application, create
a \c Window instance, set its URL, and show it:
- \snippet domtraversal/main.cpp main program
+ \snippet webkitwidgets/domtraversal/main.cpp main program
When the application's event loop is run, the Qt home page will load, and the
tree widget will be updated to show the document structure. Navigating to another
diff --git a/examples/webkitwidgets/fancybrowser/doc/src/fancybrowser.qdoc b/examples/webkitwidgets/fancybrowser/doc/src/fancybrowser.qdoc
index 74e76f1..808505c 100644
--- a/examples/webkitwidgets/fancybrowser/doc/src/fancybrowser.qdoc
+++ b/examples/webkitwidgets/fancybrowser/doc/src/fancybrowser.qdoc
@@ -46,7 +46,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 fancybrowser/mainwindow.h 1
+ \snippet webkitwidgets/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 +56,7 @@
We start by implementing the constructor.
- \snippet fancybrowser/mainwindow.cpp 1
+ \snippet webkitwidgets/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 +66,7 @@
content. The jQuery library is a JavaScript library that provides different
functions for manipulating HTML.
- \snippet fancybrowser/mainwindow.cpp 2
+ \snippet webkitwidgets/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 +75,13 @@
QLineEdit to a QToolbar together with a set of navigation actions
from QWebView::pageAction.
- \snippet fancybrowser/mainwindow.cpp 3
+ \snippet webkitwidgets/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 fancybrowser/mainwindow.cpp 4
+ \snippet webkitwidgets/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 +90,13 @@
the new web page has finished loading, \c adjustLocation() will be
run once more to update the address bar.
- \snippet fancybrowser/mainwindow.cpp 5
+ \snippet webkitwidgets/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 fancybrowser/mainwindow.cpp 6
+ \snippet webkitwidgets/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 +111,7 @@
that the images of the newly loaded page respect the state of the toggle
action.
- \snippet fancybrowser/mainwindow.cpp 7
+ \snippet webkitwidgets/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 +119,14 @@
For each such element, the background color is set to be yellow by
using CSS.
- \snippet fancybrowser/mainwindow.cpp 8
+ \snippet webkitwidgets/fancybrowser/mainwindow.cpp 8
The \c rotateImages() function rotates the images on the current
web page. Webkit supports CSS transforms and this JavaScript code
looks up all \e {img} elements and rotates the images 180 degrees
and then back again.
- \snippet fancybrowser/mainwindow.cpp 9
+ \snippet webkitwidgets/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/webkitwidgets/imageanalyzer/doc/images/wekit-imageanalyzer-complete.png b/examples/webkitwidgets/imageanalyzer/doc/images/webkit-imageanalyzer-complete.png
index 83bfb26..83bfb26 100644
--- a/examples/webkitwidgets/imageanalyzer/doc/images/wekit-imageanalyzer-complete.png
+++ b/examples/webkitwidgets/imageanalyzer/doc/images/webkit-imageanalyzer-complete.png
Binary files differ
diff --git a/examples/webkitwidgets/imageanalyzer/doc/src/webkit-bridge-imageanalyzer.qdoc b/examples/webkitwidgets/imageanalyzer/doc/src/webkit-bridge-imageanalyzer.qdoc
index c56ccdc..70f7299 100644
--- a/examples/webkitwidgets/imageanalyzer/doc/src/webkit-bridge-imageanalyzer.qdoc
+++ b/examples/webkitwidgets/imageanalyzer/doc/src/webkit-bridge-imageanalyzer.qdoc
@@ -64,7 +64,7 @@ The MainWindow is defined in C++, and creates a \l QNetworkDiskCache and a
\l QWebView, and tells the \l QWebView to load the starting page, providing us
with a user interface for the client.
- \snippet webkit/imageanalyzer/mainwindow.cpp MainWindow - constructor
+ \snippet webkitwidgets/imageanalyzer/mainwindow.cpp MainWindow - constructor
In this example, the sample content is addressed with the \tt qrc:/index.html
URL. \tt qrc:/ indicates that the file is stored as a Qt resource (attached to
@@ -76,7 +76,7 @@ to our \tt ImageAnalyzer before any other scripts are run. To do this, we
connect the \l{QWebFrame::}{javaScriptWindowObjectCleared()} signal to a slot
which does the object creation and handoff to JavaScript.
- \snippet webkit/imageanalyzer/mainwindow.cpp MainWindow - addJSObject
+ \snippet webkitwidgets/imageanalyzer/mainwindow.cpp MainWindow - addJSObject
The ImageAnalyzer object is created and added to a JavaScript object on the web
page's mainFrame with \c addToJavaScriptWindowObject().
@@ -85,16 +85,16 @@ page's mainFrame with \c addToJavaScriptWindowObject().
In one of its <div> regions, we have images, each
with an \c onClick() handler that calls \c addImage().
- \snippet webkit/imageanalyzer/resources/index.html sample images
+ \snippet webkitwidgets/imageanalyzer/resources/index.html sample images
Clicking an image adds it to an images list.
- \snippet webkit/imageanalyzer/resources/index.html addImage
+ \snippet webkitwidgets/imageanalyzer/resources/index.html addImage
The \b {Analyze} button at the bottom of the image list is clicked when we
want to start the analysis:
- \snippet webkit/imageanalyzer/resources/index.html images list
+ \snippet webkitwidgets/imageanalyzer/resources/index.html images list
When the user clicks the \b {Analyze} button, \c analyzeImages() is called,
another regular JavaScript method, shown below.
@@ -102,7 +102,7 @@ Notice it assumes the \c imageAnalyzer object is already defined and initialized
in JavaScript space, but we guaranteed that by connecting our setup slot to the
appropriate signal, \l{QWebFrame::}{javaScriptWindowObjectCleared()}.
- \snippet webkit/imageanalyzer/resources/index.html analyzeImages
+ \snippet webkitwidgets/imageanalyzer/resources/index.html analyzeImages
The only methods on \c ImageAnalyzer that we can or do call from JavaScript are
those which are exposed through \{The Meta-Object System}{Qt's MetaObject}
@@ -110,13 +110,13 @@ system: \l{The Property System}{property} getter/setter methods,
\c public \l {Signals & Slots}{signals and slots}, and other
\l{Q_INVOKABLE}{Q_INVOKABLE} functions.
-\snippet webkit/imageanalyzer/imageanalyzer.h ImageAnalyzer - public interface
+\snippet webkitwidgets/imageanalyzer/imageanalyzer.h ImageAnalyzer - public interface
\dots
-\snippet webkit/imageanalyzer/imageanalyzer.h ImageAnalyzer - private members
+\snippet webkitwidgets/imageanalyzer/imageanalyzer.h ImageAnalyzer - private members
Most of the members are set up in the constructor:
-\snippet webkit/imageanalyzer/imageanalyzer.cpp ImageAnalyzer - Constructor
+\snippet webkitwidgets/imageanalyzer/imageanalyzer.cpp ImageAnalyzer - Constructor
Back on the JavaScript side, we want to connect signals from this object to
JavaScript functions on our web page, after the web page is loaded, but before
@@ -126,29 +126,29 @@ From \c connectSlots(), we can see how to connect signals from the imageAnalyzer
object to regular JavaScript functions, which can also behave like slots. We use
this to monitor and display progress from the C++ side.
- \snippet webkit/imageanalyzer/resources/index.html connect slots
+ \snippet webkitwidgets/imageanalyzer/resources/index.html connect slots
The only public slot is \c startAnalysis(), called to place
a list of URLs into the image analyzer's QtConcurrent processing queue
from JavaScript space.
-\snippet webkit/imageanalyzer/imageanalyzer.cpp ImageAnalyzer - startAnalysis
+\snippet webkitwidgets/imageanalyzer/imageanalyzer.cpp ImageAnalyzer - startAnalysis
The images need to be loaded again now, which is why fetchURLs first checks the
cache to see if we can save an extra network get.
-\snippet webkit/imageanalyzer/imageanalyzer.cpp ImageAnalyzer - fetchURLs
+\snippet webkitwidgets/imageanalyzer/imageanalyzer.cpp ImageAnalyzer - fetchURLs
For the images that were not in the cache, \c handleReply()
will load them into a QImage when the data is ready.
-\snippet webkit/imageanalyzer/imageanalyzer.cpp ImageAnalyzer - handleReply
+\snippet webkitwidgets/imageanalyzer/imageanalyzer.cpp ImageAnalyzer - handleReply
After the images are loaded, they are queued up in preparation to be
sent in a batch for analysis to a \l QFutureWatcher, which will distribute the
processing across multiple threads and cores, depending on how many are available.
-\snippet webkit/imageanalyzer/imageanalyzer.cpp ImageAnalyzer - queueImage
+\snippet webkitwidgets/imageanalyzer/imageanalyzer.cpp ImageAnalyzer - queueImage
The function that gets performed on each image is \c averageRGB(),
as specified in argument 2 to the \l{QtConcurrent::mapped()} function.
@@ -156,7 +156,7 @@ Notice it repeats the same calculations 100 times on each pixel to keep the CPU
very busy. This is done only for the purposes of the demo so that the analysis
takes a noticeable time to complete.
-\snippet webkit/imageanalyzer/imageanalyzer.cpp ImageAnalyzer - averageRGB
+\snippet webkitwidgets/imageanalyzer/imageanalyzer.cpp ImageAnalyzer - averageRGB
*/
diff --git a/examples/webkitwidgets/previewer/doc/src/previewer.qdoc b/examples/webkitwidgets/previewer/doc/src/previewer.qdoc
index 3dcd75a..2d57e43 100644
--- a/examples/webkitwidgets/previewer/doc/src/previewer.qdoc
+++ b/examples/webkitwidgets/previewer/doc/src/previewer.qdoc
@@ -56,14 +56,14 @@
In our \c previewer.h file, we have a constructor and a slot,
\c on_previewButton_clicked().
- \snippet previewer/previewer.h 0
+ \snippet webkitwidgets/previewer/previewer.h 0
\section1 Previewer Class Implementation
The \c{Previewer}'s constructor is only responsible for setting up the
user interface.
- \snippet previewer/previewer.cpp 0
+ \snippet webkitwidgets/previewer/previewer.cpp 0
The \c on_previewButton_clicked() is a slot corresponding to the
\c{previewButton}'s \l{QPushButton::}{clicked()} signal. When the
@@ -71,7 +71,7 @@
and then invoke the \l{QWebView::}{setHtml()} function to display our
contents as HTML.
- \snippet previewer/previewer.cpp 1
+ \snippet webkitwidgets/previewer/previewer.cpp 1
\section1 MainWindow Class Definition
@@ -79,14 +79,14 @@
QMainWindow with a constructor and five private slots: \c open(),
\c openUrl(), \c save(), \c about() and \c updateTextEdit().
- \snippet previewer/mainwindow.h 0
+ \snippet webkitwidgets/previewer/mainwindow.h 0
The private objects in \c MainWindow are \c centralWidget, which is
a \c Previewer object, \c fileMenu, \c helpMenu and the QAction objects
\c openAct, \c openUrlAct, \c saveAct, \c exitAct, \c aboutAct and
\c aboutQtAct.
- \snippet previewer/mainwindow.h 1
+ \snippet webkitwidgets/previewer/mainwindow.h 1
There are three private functions: \c createActions(), \c createMenus()
and \c setStartupText(). The \c createActions() and \c createMenus()
@@ -105,25 +105,25 @@
Finally, we call the \c setStartupText() function to display the
description of the example.
- \snippet previewer/mainwindow.cpp 0
+ \snippet webkitwidgets/previewer/mainwindow.cpp 0
Within the \c createActions() function, we instantiate all our private
QAction objects which we declared in \c{mainwindow.h}. We set the
short cut and status tip for these actions and connect their
\l{QAction::}{triggered()} signal to appropriate slots.
- \snippet previewer/mainwindow.cpp 1
+ \snippet webkitwidgets/previewer/mainwindow.cpp 1
\dots
The \c createMenus() function instantiates the QMenu items, \c fileMenu
and \c helpMenu and adds them to the main window's
\l{QMainWindow::menuBar()}{menu bar}.
- \snippet previewer/mainwindow.cpp 2
+ \snippet webkitwidgets/previewer/mainwindow.cpp 2
The example also provides an \c about() slot to describe its purpose.
- \snippet previewer/mainwindow.cpp 3
+ \snippet webkitwidgets/previewer/mainwindow.cpp 3
The \c MainWindow class provides two types of \gui Open functions:
\c open() and \c openUrl(). The \c open() function opens an HTML file
@@ -131,19 +131,19 @@
displays the output on \c plainTextEdit. The file's name is obtained
using QFileDialog's \l{QFileDialog::}{getOpenFileName()} function.
- \snippet previewer/mainwindow.cpp 4
+ \snippet webkitwidgets/previewer/mainwindow.cpp 4
The \c openUrl() function, on the other hand, displays a QInputDialog
to obtain a URL, and displays it on \c webView.
- \snippet previewer/mainwindow.cpp 5
+ \snippet webkitwidgets/previewer/mainwindow.cpp 5
In order to save a HTML file, the \c save() function first extracts the
contents of \c plainTextEdit and displays a QFileDialog to obtain
\c fileName. Then, we use a QTextStream object, \c in, to write to
\c file.
- \snippet previewer/mainwindow.cpp 6
+ \snippet webkitwidgets/previewer/mainwindow.cpp 6
Earlier, in \c{MainWindow}'s constructor, we connected \c{webView}'s
\l{QWebView::}{loadFinished()} signal to our private \c updateTextEdit()
@@ -151,12 +151,12 @@
source of the web page's main frame, obtained using \l{QWebFrame}'s
\l{QWebFrame::}{toHtml()} function.
- \snippet previewer/mainwindow.cpp 7
+ \snippet webkitwidgets/previewer/mainwindow.cpp 7
To provide a description about the Previewer example, when it starts up,
we use the \c setStartupText() function, as shown below:
- \snippet previewer/mainwindow.cpp 8
+ \snippet webkitwidgets/previewer/mainwindow.cpp 8
\section1 The \c{main()} Function
@@ -164,6 +164,6 @@
The \c main() function instantiates a \c MainWindow object, \c mainWindow,
and displays it with the \l{QWidget::}{show()} function.
- \snippet previewer/main.cpp 0
+ \snippet webkitwidgets/previewer/main.cpp 0
*/
diff --git a/examples/webkitwidgets/scroller/wheel/doc/src/wheel.qdoc b/examples/webkitwidgets/scroller/wheel/doc/src/wheel.qdoc
index 14b13fa..b8c9538 100644
--- a/examples/webkitwidgets/scroller/wheel/doc/src/wheel.qdoc
+++ b/examples/webkitwidgets/scroller/wheel/doc/src/wheel.qdoc
@@ -64,14 +64,14 @@
In the widget we need to grab the QFlickGesture. The gesture itself
will setAcceptTouchEvents for us, so we don't need to do that here.
- \snippet scroller/wheel/wheelwidget.cpp 0
+ \snippet webkitwidgets/scroller/wheel/wheelwidget.cpp 0
The widget will get gesture events but in addition we also will
get the events from QScroller.
We will need to accept the QScrollPrepareEvent to indicate that
a scrolling should really be started from the given position.
- \snippet scroller/wheel/wheelwidget.cpp 1
+ \snippet webkitwidgets/scroller/wheel/wheelwidget.cpp 1
We should call all three set functions form QScrollPrepareEvent.
@@ -90,7 +90,7 @@
\endlist
The handling of the QScrollEvent is a lengthly code not fully shown here.
- \snippet scroller/wheel/wheelwidget.cpp 2
+ \snippet webkitwidgets/scroller/wheel/wheelwidget.cpp 2
In principle it does three steps.
\list
@@ -101,7 +101,7 @@
\endlist
The following code does the centering.
- \snippet scroller/wheel/wheelwidget.cpp 3
+ \snippet webkitwidgets/scroller/wheel/wheelwidget.cpp 3
We check if the scrolling is finished which is indicated in the
QScrollEvent by the \c isLast flag.
diff --git a/examples/webkitwidgets/scroller/wheel/wheelwidget.cpp b/examples/webkitwidgets/scroller/wheel/wheelwidget.cpp
index 8864e82..e2cf495 100644
--- a/examples/webkitwidgets/scroller/wheel/wheelwidget.cpp
+++ b/examples/webkitwidgets/scroller/wheel/wheelwidget.cpp
@@ -102,7 +102,7 @@ bool AbstractWheelWidget::event(QEvent *e)
int ih = itemHeight();
// ![2]
-
+// ![3]
// -- calculate the current item position and offset and redraw the widget
int ic = itemCount();
if (ic>0) {
@@ -123,6 +123,7 @@ bool AbstractWheelWidget::event(QEvent *e)
se->accept();
return true;
+// ![3]
}
default:
return QWidget::event(e);
diff --git a/examples/webkitwidgets/simpleselector/doc/src/simpleselector.qdoc b/examples/webkitwidgets/simpleselector/doc/src/simpleselector.qdoc
index 0a86f55..c7bde50 100644
--- a/examples/webkitwidgets/simpleselector/doc/src/simpleselector.qdoc
+++ b/examples/webkitwidgets/simpleselector/doc/src/simpleselector.qdoc
@@ -50,7 +50,7 @@
The \c Window class describes the example's user interface and this is partially described
by the \c window.ui file, created using \l{Qt Designer}:
- \snippet webkit/simpleselector/window.h Window class definition
+ \snippet webkitwidgets/simpleselector/window.h Window class definition
We use \l{Using a Designer UI File in Your Application#The Multiple Inheritance Approach}
{multiple inheritance} to include the user interface description. We define slots that
@@ -61,7 +61,7 @@
Since the layout of the user interface is provided by the \c{window.ui} user interface file,
we only need to call the \l{QWidget::}{setupUi()} in the constructor:
- \snippet webkit/simpleselector/window.cpp Window class constructor
+ \snippet webkitwidgets/simpleselector/window.cpp Window class constructor
This adds all the controls to the window and sets up connections between their signals
and suitably-named slots in the \c Window class. The QLineEdit instance was given a name of
@@ -73,7 +73,7 @@
a QWebElement instance that represents the document, and we obtain this in order to
examine its contents:
- \snippet webkit/simpleselector/window.cpp return pressed
+ \snippet webkitwidgets/simpleselector/window.cpp return pressed
Taking the contents of the QLineEdit as the query text, we call the element's
\l{QWebElement::}{findAll()} function to obtain a list of elements that match the
@@ -86,19 +86,19 @@
button, we also implement the \c{on_highlightButton_clicked()} slot to simply call
the \c{on_elementLineEdit_returnPressed()} slot when it is invoked:
- \snippet webkit/simpleselector/window.cpp button clicked
+ \snippet webkitwidgets/simpleselector/window.cpp button clicked
For completeness, we also implement a \c setUrl() function which simply passes on
a QUrl instance to the equivalent function in the QWebView widget:
- \snippet webkit/simpleselector/window.cpp set URL
+ \snippet webkitwidgets/simpleselector/window.cpp set URL
\section1 Starting the Example
The main function implementation is simple. We set up the application, create
a \c Window instance, set its URL, and show it:
- \snippet webkit/simpleselector/main.cpp main program
+ \snippet webkitwidgets/simpleselector/main.cpp main program
When the application's event loop is run, the WebKit home page will load, and the
user can then begin to start running queries against the contents of the page.
diff --git a/examples/webkitwidgets/xmlpatterns/doc/src/qobjectxmlmodel.qdoc b/examples/webkitwidgets/xmlpatterns/doc/src/qobjectxmlmodel.qdoc
index 99bfbea..87a5773 100644
--- a/examples/webkitwidgets/xmlpatterns/doc/src/qobjectxmlmodel.qdoc
+++ b/examples/webkitwidgets/xmlpatterns/doc/src/qobjectxmlmodel.qdoc
@@ -97,12 +97,12 @@
callback interface functions that don't have implementations in
QSimpleXmlNodeModel:
- \snippet xmlpatterns/qobjectxmlmodel/qobjectxmlmodel.h 0
+ \snippet webkitwidgets/xmlpatterns/qobjectxmlmodel/qobjectxmlmodel.h 0
The node model class declares three data members:
\target Three Data Members
- \snippet xmlpatterns/qobjectxmlmodel/qobjectxmlmodel.h 2
+ \snippet webkitwidgets/xmlpatterns/qobjectxmlmodel/qobjectxmlmodel.h 2
The constructor sets \c m_baseURI to the QUrl constructed from the
\l{QCoreApplication::applicationFilePath()}{file path} of the
@@ -126,7 +126,7 @@
\l{QAbstractXmlNodeModel::createIndex()}{createIndex()} creates the
QXmlNodeModelIndex, as in the local \c{root()} function, for example:
- \snippet xmlpatterns/qobjectxmlmodel/qobjectxmlmodel.cpp 0
+ \snippet webkitwidgets/xmlpatterns/qobjectxmlmodel/qobjectxmlmodel.cpp 0
A QObject represents an element node in the node model, but we also
need to represent attribute nodes. For example, the class name of a
@@ -142,7 +142,7 @@
identifies the attribute in the QObject. For this \e{additional
data} value, we use \c{enum QObjectNodeType}:
- \snippet xmlpatterns/qobjectxmlmodel/qobjectxmlmodel.h 3
+ \snippet webkitwidgets/xmlpatterns/qobjectxmlmodel/qobjectxmlmodel.h 3
Ignore the \c{MetaObjectXXX} values for now. They will be explained
in \l{Including The QMetaObject Tree}. Here we are interested in the
@@ -163,8 +163,8 @@
\c{createIndex(object,QObjectClassName)}.
\target QObject attributes
- \snippet xmlpatterns/qobjectxmlmodel/qobjectxmlmodel.cpp 6
- \snippet xmlpatterns/qobjectxmlmodel/qobjectxmlmodel.cpp 8
+ \snippet webkitwidgets/xmlpatterns/qobjectxmlmodel/qobjectxmlmodel.cpp 6
+ \snippet webkitwidgets/xmlpatterns/qobjectxmlmodel/qobjectxmlmodel.cpp 8
\l{QObject attributes} {attributes()} is one of the callback
functions you have to implement in your custom node model class. It
@@ -188,13 +188,13 @@
QMetaObject tree.
\target QObject nextFromSimpleAxis
- \snippet xmlpatterns/qobjectxmlmodel/qobjectxmlmodel.cpp 2
- \snippet xmlpatterns/qobjectxmlmodel/qobjectxmlmodel.cpp 4
+ \snippet webkitwidgets/xmlpatterns/qobjectxmlmodel/qobjectxmlmodel.cpp 2
+ \snippet webkitwidgets/xmlpatterns/qobjectxmlmodel/qobjectxmlmodel.cpp 4
The main switch uses \c toNodeType(), which obtains the node
type from \l{QXmlNodeModelIndex::additionalData()}:
- \snippet xmlpatterns/qobjectxmlmodel/qobjectxmlmodel.cpp 1
+ \snippet webkitwidgets/xmlpatterns/qobjectxmlmodel/qobjectxmlmodel.cpp 1
\c{case IsObject} case is the most interesting. It switches again on
the value of the \c{axis} parameter, which specifies the direction
@@ -216,7 +216,7 @@
and -1 to traverse to the
\l{QAbstractXmlNodeModel::PreviousSibling} {PreviousSibling}.
- \snippet xmlpatterns/qobjectxmlmodel/qobjectxmlmodel.cpp 5
+ \snippet webkitwidgets/xmlpatterns/qobjectxmlmodel/qobjectxmlmodel.cpp 5
\c{qObjectSibling()} determines whether or not the node has any
siblings. It is called with \c{n}, the index of the current node.
@@ -239,7 +239,7 @@
don't have children. But these two cases simply return the
\l{QXmlNodeModelIndex} {node index} of the current node.
- \snippet xmlpatterns/qobjectxmlmodel/qobjectxmlmodel.cpp 7
+ \snippet webkitwidgets/xmlpatterns/qobjectxmlmodel/qobjectxmlmodel.cpp 7
Since \c n is the QXmlNodeModelIndex of the current node, all this
does is create another QXmlNodeModelIndex for the current node and
@@ -281,13 +281,13 @@
as a vector of pointers to QMetaObject:
\target All MetaObjects
- \snippet xmlpatterns/qobjectxmlmodel/qobjectxmlmodel.h 1
- \snippet xmlpatterns/qobjectxmlmodel/qobjectxmlmodel.h 4
+ \snippet webkitwidgets/xmlpatterns/qobjectxmlmodel/qobjectxmlmodel.h 1
+ \snippet webkitwidgets/xmlpatterns/qobjectxmlmodel/qobjectxmlmodel.h 4
This vector gets populated by the QObjectXmlModel constructor by
calling the private allMetaObjects() function:
- \snippet xmlpatterns/qobjectxmlmodel/qobjectxmlmodel.cpp 9
+ \snippet webkitwidgets/xmlpatterns/qobjectxmlmodel/qobjectxmlmodel.cpp 9
The first half of the function is an example of the standard code
pattern for using QtXmlPatterns to run an XQuery. First it creates an
@@ -313,14 +313,14 @@
\c{MetaObjectXXX} cases:
\target Full Listing of nextFromSimpleAxis
- \snippet xmlpatterns/qobjectxmlmodel/qobjectxmlmodel.cpp 2
- \snippet xmlpatterns/qobjectxmlmodel/qobjectxmlmodel.cpp 3
- \snippet xmlpatterns/qobjectxmlmodel/qobjectxmlmodel.cpp 4
+ \snippet webkitwidgets/xmlpatterns/qobjectxmlmodel/qobjectxmlmodel.cpp 2
+ \snippet webkitwidgets/xmlpatterns/qobjectxmlmodel/qobjectxmlmodel.cpp 3
+ \snippet webkitwidgets/xmlpatterns/qobjectxmlmodel/qobjectxmlmodel.cpp 4
But first, revisit the \c{PreviousSibling} case for the
\c{IsQObject} case:
- \snippet xmlpatterns/qobjectxmlmodel/qobjectxmlmodel.cpp 10
+ \snippet webkitwidgets/xmlpatterns/qobjectxmlmodel/qobjectxmlmodel.cpp 10
When asking for the previous sibling of the root of the QObject
tree, it creates a node model index with a null QObject pointer and
@@ -332,7 +332,7 @@
QObject tree in the \c{NextSibling} case of case \c{MetaObjects},
where the \c{root()} function is called:
- \snippet xmlpatterns/qobjectxmlmodel/qobjectxmlmodel.cpp 11
+ \snippet webkitwidgets/xmlpatterns/qobjectxmlmodel/qobjectxmlmodel.cpp 11
Having jumped from the QObject tree to the QMetaObject tree, the
query engine will use the \c{MetaObject}, \c{MetaObjectClassName},