statisticsInHTML.xq Example Filexmlpatterns/qobjectxmlmodel/queries/statisticsInHTML.xq <html>
<head>
<title></title>
</head>
<body>
<p>In total the tree has {count($root//QObject)} QObject instances.</p>
<p>Order by occurrence, the QObjects are:</p>
<ol>
{
for $i in $root/preceding-sibling::metaObjects/metaObject
let $count := count($root//QObject[@className eq $i/@className])
stable order by $count descending
return if($count > 1)
then <li>{string($i/@className), $count} occurrences</li>
else ()
}
</ol>
<h1>Properties</h1>
{
(: For each QObject, we create a table listing
: the properties of that object. :)
for $object in $root//QObject
return (<h2>{let $name := string($object/@objectName)
return if(string-length($name))
then $name
else "[no name]",
'(', string($object/@className), ')'}</h2>,
<table border="1">
<thead>
<tr>
<td>Property Name</td>
<td>Value</td>
</tr>
</thead>
<tbody>
{
$object/@*/<tr>
<td>
{
name()
}
</td>
<td>
{
if(data(.))
then string(.)
else "N/A"
}
</td>
</tr>
}
</tbody>
</table>)
}
</body>
</html>
|
| Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. | Qt 4.8 | |
| Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD. | ||
| Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP ! | ||
Copyright © 2000-2012 - www.developpez.com















