summaryrefslogtreecommitdiff
path: root/examples/xmlpatterns
diff options
context:
space:
mode:
Diffstat (limited to 'examples/xmlpatterns')
-rw-r--r--examples/xmlpatterns/filetree/doc/src/filetree.qdoc16
-rw-r--r--examples/xmlpatterns/filetree/filetree.cpp6
-rw-r--r--examples/xmlpatterns/filetree/mainwindow.cpp4
-rw-r--r--examples/xmlpatterns/filetree/queries/listCPPFiles.xq2
-rw-r--r--examples/xmlpatterns/recipes/doc/src/recipes.qdoc6
-rw-r--r--examples/xmlpatterns/xquery/doc/src/globalVariables.qdoc12
-rw-r--r--examples/xmlpatterns/xquery/globalVariables/globals.cpp4
-rw-r--r--examples/xmlpatterns/xquery/globalVariables/globals.html2
-rw-r--r--examples/xmlpatterns/xquery/globalVariables/reportGlobals.xq16
9 files changed, 34 insertions, 34 deletions
diff --git a/examples/xmlpatterns/filetree/doc/src/filetree.qdoc b/examples/xmlpatterns/filetree/doc/src/filetree.qdoc
index 1ad2c3d..b1204b6 100644
--- a/examples/xmlpatterns/filetree/doc/src/filetree.qdoc
+++ b/examples/xmlpatterns/filetree/doc/src/filetree.qdoc
@@ -31,7 +31,7 @@
\ingroup xmlpattern_examples
This example shows how to use Qt XML Patterns for querying non-XML
- data that is modeled to look like XML.
+ data that is modeled to look like XML.
\tableofcontents
@@ -108,7 +108,7 @@
\snippet xmlpatterns/filetree/filetree.h 1
The \c{FileTree} class declares four data members:
-
+
\snippet xmlpatterns/filetree/filetree.h 2
The QVector \c{m_fileInfos} will contain the node model. Each
@@ -126,7 +126,7 @@
can use. So we must build an analog of the file system in memory
from instances of QFileInfo, and we use that analog as the custom
node model.
-
+
The two sets of flags, \c{m_filterAllowAll} and \c{m_sortFlags},
contain OR'ed flags from QDir::Filters and QDir::SortFlags
respectively. They are set by the \c{FileTree} constructor and used
@@ -222,7 +222,7 @@
simple as the ones described so far, but the callback function used
for traversing (and building) the node model is more complex.
- \section3 Building And Traversing The Node Model
+ \section3 Building And Traversing The Node Model
The node model in \c{FileTree} is not fully built before the query
engine begins evaluating the query. In fact, when the query engine
@@ -299,7 +299,7 @@
\section2 The UI Class: MainWindow
The example's UI is a conventional Qt GUI application inheriting
- QMainWindow and the Ui_MainWindow base class generated by
+ QMainWindow and the Ui_MainWindow base class generated by
\l{Qt Designer Manual} {Qt Designer}.
\snippet xmlpatterns/filetree/mainwindow.h 0
@@ -360,12 +360,12 @@
The user chooses an XQuery from the menu in the combobox on the
right. Choosing an XQuery signals the
\c{on_queryBox_currentIndexChanged()} slot:
-
+
\snippet xmlpatterns/filetree/mainwindow.cpp 2
The slot function opens and loads the query file and then calls the
private function \c{evaluateResult()} to run the query:
-
+
\snippet xmlpatterns/filetree/mainwindow.cpp 3
\c{evaluateResult()} is a second example of the same code pattern
@@ -403,6 +403,6 @@
build the node model incrementally is important, because it allows
us to only build the region of the model we need for evaluating the
query. In other cases, it will be simpler to just build the entire
- node model.
+ node model.
*/
diff --git a/examples/xmlpatterns/filetree/filetree.cpp b/examples/xmlpatterns/filetree/filetree.cpp
index 5df6afb..bcde110 100644
--- a/examples/xmlpatterns/filetree/filetree.cpp
+++ b/examples/xmlpatterns/filetree/filetree.cpp
@@ -144,7 +144,7 @@ QXmlNodeModelIndex FileTree::toNodeIndex(const QFileInfo &fileInfo) const
/*!
This private helper function is only called by nextFromSimpleAxis().
It is called whenever nextFromSimpleAxis() is called with an axis
- parameter of either \c{PreviousSibling} or \c{NextSibling}.
+ parameter of either \c{PreviousSibling} or \c{NextSibling}.
*/
//! [5]
QXmlNodeModelIndex FileTree::nextSibling(const QXmlNodeModelIndex &nodeIndex,
@@ -213,7 +213,7 @@ FileTree::nextFromSimpleAxis(SimpleAxis axis, const QXmlNodeModelIndex &nodeInde
switch (axis) {
case Parent:
return toNodeIndex(QFileInfo(fi.path()), Directory);
-
+
case FirstChild:
{
if (type == File) // A file has no children.
@@ -233,7 +233,7 @@ FileTree::nextFromSimpleAxis(SimpleAxis axis, const QXmlNodeModelIndex &nodeInde
return toNodeIndex(firstChild);
}
}
-
+
case PreviousSibling:
return nextSibling(nodeIndex, fi, -1);
diff --git a/examples/xmlpatterns/filetree/mainwindow.cpp b/examples/xmlpatterns/filetree/mainwindow.cpp
index 9bf71cd..0147a83 100644
--- a/examples/xmlpatterns/filetree/mainwindow.cpp
+++ b/examples/xmlpatterns/filetree/mainwindow.cpp
@@ -144,9 +144,9 @@ void MainWindow::loadDirectory(const QString &directory)
treeInfo->setText(tr("Model of %1 output as XML.").arg(directory));
fileTree->setText(QString::fromLatin1(output.constData()));
evaluateResult();
-//! [6]
+//! [6]
}
-//! [6]
+//! [6]
//! [4]
void MainWindow::on_actionAbout_triggered()
diff --git a/examples/xmlpatterns/filetree/queries/listCPPFiles.xq b/examples/xmlpatterns/filetree/queries/listCPPFiles.xq
index e311d27..ab8dc35 100644
--- a/examples/xmlpatterns/filetree/queries/listCPPFiles.xq
+++ b/examples/xmlpatterns/filetree/queries/listCPPFiles.xq
@@ -10,7 +10,7 @@ declare variable $where as xs:string := string($fileTree/@filePath);
<ul> {
for $file in $fileTree//file[@suffix = "cpp"]
order by xs:integer($file/@size)
- return
+ return
<li>
{string($file/@fileName)}, size: {string($file/@size)}
</li>
diff --git a/examples/xmlpatterns/recipes/doc/src/recipes.qdoc b/examples/xmlpatterns/recipes/doc/src/recipes.qdoc
index ced3323..3e8b396 100644
--- a/examples/xmlpatterns/recipes/doc/src/recipes.qdoc
+++ b/examples/xmlpatterns/recipes/doc/src/recipes.qdoc
@@ -31,7 +31,7 @@
\ingroup xmlpattern_examples
The Recipes example shows how to use Qt XML Patterns to query XML data
- loaded from a file.
+ loaded from a file.
\tableofcontents
@@ -40,7 +40,7 @@
In this case, the XML data represents a cookbook, \c{cookbook.xml},
which contains \c{<cookbook>} as its document element, which in turn
contains a sequence of \c{<recipe>} elements. This XML data is
- searched using queries stored in XQuery files (\c{*.xq}).
+ searched using queries stored in XQuery files (\c{*.xq}).
\section2 The User Interface
@@ -97,7 +97,7 @@
display its contents in the top group box's \l{QTextEdit} {text
viewer} . Finally, it finds the XQuery files (\c{.xq}) and adds each
one to the \l{QComboBox} {combo box} menu.
-
+
\snippet xmlpatterns/recipes/querymainwindow.cpp 0
The work is done in the \l{displayQuery() slot} {displayQuery()}
diff --git a/examples/xmlpatterns/xquery/doc/src/globalVariables.qdoc b/examples/xmlpatterns/xquery/doc/src/globalVariables.qdoc
index 02d2af0..94777cd 100644
--- a/examples/xmlpatterns/xquery/doc/src/globalVariables.qdoc
+++ b/examples/xmlpatterns/xquery/doc/src/globalVariables.qdoc
@@ -62,7 +62,7 @@
do is protect the global variables to prevent the bugs described
above. How can we use XQuery and
\l{http://public.kitware.com/GCC_XML/HTML/Index.html} {GCC-XML} to
- find the variables that need protecting?
+ find the variables that need protecting?
\section3 A C++ application
@@ -72,7 +72,7 @@
\section3 The XML description of the C++ application
- Submitting this C++ source to
+ Submitting this C++ source to
\l{http://public.kitware.com/GCC_XML/HTML/Index.html} {GCC-XML}
produces this XML description:
@@ -102,7 +102,7 @@
The \c xmlpatterns command loads and parses \c globals.gccxml,
runs the XQuery \c reportGlobals.xq, and generates this report:
- \div {class="details"}
+ \div {class="details"}
Start report: 2008-12-16T13:43:49.65Z
\enddiv
@@ -122,7 +122,7 @@
\div {class="details"} End report: 2008-12-16T13:43:49.65Z \enddiv
- \section1 XQuery Code Walk-Through
+ \section1 XQuery Code Walk-Through
The XQuery source is in
\c{examples/xmlpatterns/xquery/globalVariables/reportGlobals.xq}
@@ -175,12 +175,12 @@
\quotefromfile xmlpatterns/xquery/globalVariables/globals.html
\skipto <body>
\printuntil </body>
-
+
The XQuery declares three more local functions that are called in
turn by the \c{local:report()} function. \c{isComplexType()}
returns true if the variable has a complex type. The variable can
be mutable or const.
-
+
\quotefromfile xmlpatterns/xquery/globalVariables/reportGlobals.xq
\skipto declare function local:isComplexType
\printuntil };
diff --git a/examples/xmlpatterns/xquery/globalVariables/globals.cpp b/examples/xmlpatterns/xquery/globalVariables/globals.cpp
index 6c1f954..0edb9cf 100644
--- a/examples/xmlpatterns/xquery/globalVariables/globals.cpp
+++ b/examples/xmlpatterns/xquery/globalVariables/globals.cpp
@@ -43,7 +43,7 @@
2. int mutablePrimitive2;
3. const int constPrimitive1 = 4;
4. const int constPrimitive2 = 3;
- 5.
+ 5.
6. class ComplexClass
7. {
8. public:
@@ -56,7 +56,7 @@
15. ComplexClass mutableComplex2;
16. const ComplexClass constComplex1;
17. const ComplexClass constComplex2;
-18.
+18.
19. int main()
20. {
22. int localVariable;
diff --git a/examples/xmlpatterns/xquery/globalVariables/globals.html b/examples/xmlpatterns/xquery/globalVariables/globals.html
index d8affc8..1b888da 100644
--- a/examples/xmlpatterns/xquery/globalVariables/globals.html
+++ b/examples/xmlpatterns/xquery/globalVariables/globals.html
@@ -12,7 +12,7 @@
.variableName
{
font-family: courier;
- color: blue
+ color: blue
}
</style>
<body>
diff --git a/examples/xmlpatterns/xquery/globalVariables/reportGlobals.xq b/examples/xmlpatterns/xquery/globalVariables/reportGlobals.xq
index 026679d..4bc4243 100644
--- a/examples/xmlpatterns/xquery/globalVariables/reportGlobals.xq
+++ b/examples/xmlpatterns/xquery/globalVariables/reportGlobals.xq
@@ -1,5 +1,5 @@
-(:
- This XQuery loads a GCC-XML file and reports the locations of all
+(:
+ This XQuery loads a GCC-XML file and reports the locations of all
global variables in the original C++ source. To run the query,
use the command line:
@@ -12,10 +12,10 @@
declare variable $fileToOpen as xs:anyURI external;
declare variable $inDoc as document-node() := doc($fileToOpen);
-(:
+(:
This function determines whether the typeId is a complex type,
e.g. QString. We only check whether it's a class. To be strictly
- correct, we should check whether the class has a non-synthesized
+ correct, we should check whether the class has a non-synthesized
constructor. We accept both mutable and const types.
:)
declare function local:isComplexType($typeID as xs:string) as xs:boolean
@@ -33,7 +33,7 @@ declare function local:isPrimitive($typeId as xs:string) as xs:boolean
exists($inDoc/GCC_XML/FundamentalType[@id = $typeId])
};
-(:
+(:
This function constructs a line for the report. The line contains
a variable name, the source file, and the line number.
:)
@@ -42,7 +42,7 @@ declare function local:location($block as element()) as xs:string
concat($inDoc/GCC_XML/File[@id = $block/@file]/@name, " at line ", $block/@line)
};
-(:
+(:
This function generates the report. Note that it is called once
in the <body> element of the <html> output.
@@ -76,7 +76,7 @@ declare function local:report() as element()+
};
(:
- This is where the <html> report is output. First
+ This is where the <html> report is output. First
there is some style stuff, then the <body> element,
which contains the call to the \c{local:report()}
declared above.
@@ -95,7 +95,7 @@ declare function local:report() as element()+
.variableName
{{
font-family: courier;
- color: blue
+ color: blue
}}
</style>