<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet title="XSL formatting" type="text/xsl" href="http://www.shadoware.org/feed/rss2/xslt" ?><rss version="2.0"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:wfw="http://wellformedweb.org/CommentAPI/"
  xmlns:content="http://purl.org/rss/1.0/modules/content/"
  xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
  <title>Shadoware.Org - Mot-clé - libre</title>
  <link>http://www.shadoware.org/</link>
  <atom:link href="http://www.shadoware.org/index.php/feed/tag/libre/rss2" rel="self" type="application/rss+xml"/>
  <description>Moi, mes idées, mes logiciels ...</description>
  <language>fr</language>
  <pubDate>Mon, 06 Feb 2012 15:38:11 +0100</pubDate>
  <copyright>Ulrich VANDENHEKKE</copyright>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Dotclear</generator>
  
    
  <item>
    <title>KMDAlert - Logiciel de surveillance de périphérique RAID - Version pour KDE 4.0</title>
    <link>http://www.shadoware.org/post/kmdalert-0.2</link>
    <guid isPermaLink="false">urn:md5:34b6a6d32b5e50755d5fe92a063ea2be</guid>
    <pubDate>Sun, 14 Aug 2011 20:43:00 +0200</pubDate>
    <dc:creator>Ulrich Van Den Hekke</dc:creator>
        <category>KMDAlert</category>
        <category>kde</category><category>kmdalert</category><category>libre</category><category>mdadm</category><category>planet</category><category>raid</category><category>systray</category>    
    <description>    &lt;h2&gt;Présentation&lt;/h2&gt;


&lt;p&gt;Possédant chez moi des disques durs en RAID logiciels sous Gnu/Linux, en 2007 (cela fait déjà 4 ans), &lt;a href=&quot;http://www.shadoware.org/post/kmdalert&quot;&gt;j'avais écrit un petit logiciel&lt;/a&gt; dont le but était de faire du monitoring RAID.&lt;/p&gt;


&lt;p&gt;En cas de reconstruction du RAID ou de  disque défectueux, le logiciel affiche une notification à l'utilisateur, et change le statut affiché dans la barre de notification (&lt;em&gt;systray&lt;/em&gt;). L'icône change bien sur en fonction de l'état du RAID&amp;nbsp;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;dégradé (avec un point d'exclamation)&lt;/li&gt;
&lt;li&gt;en cours de synchronisation (avec une barre de progression)&lt;/li&gt;
&lt;li&gt;disque RAID dans un état normal&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Ce logiciel ne tournait que sous KDE 3.X.&lt;/p&gt;


&lt;p&gt;Voici donc une nouvelle version (qui a mis le temps de sortir) qui est un portage de l'application sous KDE 4.X. Elle utilise donc le nouveau système de notification de KDE (pour l'instant en passant uniquement par les notifications standard). Quelques améliorations y seront apportées plus tard.&lt;/p&gt;


&lt;h2&gt;Requis&lt;/h2&gt;


&lt;p&gt;Pour fonctionner &lt;em&gt;KMDAlert&lt;/em&gt; nécessite que le dossier &lt;code&gt;/sys&lt;/code&gt; soit monté et que &lt;code&gt;/sys/block/&lt;/code&gt; soit renseigné pour chaque volume RAID (exemple &lt;code&gt;/sys/block/md0&lt;/code&gt;, &lt;code&gt;/sys/block/md1&lt;/code&gt;, ...). &lt;code&gt;KMDAlert&lt;/code&gt; observe ensuite les modifications faites sur les fichiers pour informer l'utilisateur des modifications faites sur le volume RAID ou sur les disques le composant.&lt;/p&gt;


&lt;p&gt;De nos jours le dossier &lt;code&gt;/sys&lt;/code&gt; et &lt;code&gt;/sys/block&lt;/code&gt; devraient être toujours présents.&lt;/p&gt;


&lt;p&gt;L'application a été développée sur &lt;em&gt;Gnu/Debian Squeeze&lt;/em&gt;, sur un KDE 4.4.5 avec un noyau 2.6.32.&lt;/p&gt;


&lt;p&gt;&lt;em&gt;KMDAlert&lt;/em&gt; ne nécessite pas de &lt;em&gt;Inotify&lt;/em&gt;. &lt;em&gt;KMDAlert&lt;/em&gt; lit le contenu de plusieurs fichiers dans le dossier &lt;code&gt;/sys&lt;/code&gt; toutes les 6 secondes pour être informé de la modification de l'état du périphérique. Sur l'application d'origine, développé sous un noyau 2.6.18, &lt;em&gt;Inotify&lt;/em&gt; n'est pas averti des modifications faites sur le système de fichier &lt;code&gt;/sys&lt;/code&gt;. Les dates de ces fichiers ne sont pas non plus modifiées. Si quelqu'un a une autre méthode à me proposer, je reste ouvert à toutes propositions.&lt;/p&gt;


&lt;p&gt;&lt;em&gt;KMDAlert&lt;/em&gt; est une application écrite en utilisant les librairies de KDE, mais devrait tout de même fonctionner sous Gnome. Les messages de notification utilisent donc le système de notification de KDE (bien que je n'utilise pas toutes ses possibilités).&lt;/p&gt;


&lt;h2&gt;Compilation / Installation&lt;/h2&gt;


&lt;p&gt;La compilation et l'installation de &lt;em&gt;KMDAlert&lt;/em&gt; se fait à l'aide du trio habituel&amp;nbsp;:&lt;/p&gt;

&lt;pre class=&quot;bash bash&quot; style=&quot;font-family:inherit&quot;&gt;&lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;# Décompression de KMDAlert&lt;/span&gt;
&lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;tar&lt;/span&gt; xjfv kmdalert-&lt;span style=&quot;color: #000000;&quot;&gt;0.2&lt;/span&gt;-77c0d6b4d49f.tar.gz
&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;cd&lt;/span&gt; kmdalert-77c0d6b4d49f
&amp;nbsp;
&lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;# Préparation de la compilation&lt;/span&gt;
&lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;mkdir&lt;/span&gt; build
&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;cd&lt;/span&gt; build
&amp;nbsp;
&lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;# Comilation&lt;/span&gt;
cmake ..&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;
&lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;make&lt;/span&gt;
&amp;nbsp;
&lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;# Installation&lt;/span&gt;
&lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;make&lt;/span&gt; &lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;install&lt;/span&gt;&lt;/pre&gt;


&lt;p&gt;La compilation nécessite les librairies de développement KDE et Qt3, ainsi que le compilateur GCC.&lt;/p&gt;


&lt;h2&gt;Licence&lt;/h2&gt;


&lt;p&gt;La licence choisie est la  &lt;a href=&quot;http://www.gnu.org/licenses/gpl-2.0.txt&quot; hreflang=&quot;en&quot; title=&quot;GNU GENERAL PUBLIC LICENCE&quot;&gt;GNU GENERAL PUBLIC LICENSE&lt;/a&gt;&lt;/p&gt;


&lt;h2&gt;Téléchargement&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Vous pouvez télécharger une archive déjà construite de l'application sur &lt;a href=&quot;http://kde-apps.org/content/show.php/KMDAlert?content=73373&quot; hreflang=&quot;fr&quot;&gt;KDE-Apps.org&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Le dépôt officiel pour télécharger les sources et participer&amp;nbsp;: &lt;a href=&quot;http://hg.shadoware.org/kmdalert?pk_campaign=shadoware&quot;&gt;http://hg.shadoware.org/kmdalert&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Vous pouvez également télécharger la version attachée au billet.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Système de suivi&lt;/h2&gt;


&lt;p&gt;Il n'y a actuellement plus de système de suivi pour ce logiciel. En cas de problème, vous pouvez laisser un message dans les commentaires ou m'envoyer un mail.&lt;/p&gt;</description>
    
          <enclosure url="http://www.shadoware.org/public/download/kmdalert/kmdalert-0.2-77c0d6b4d49f.tar.gz"
      length="50726" type="application/x-gzip" />
    
    
          <comments>http://www.shadoware.org/post/kmdalert-0.2#comment-form</comments>
      <wfw:comment>http://www.shadoware.org/post/kmdalert-0.2#comment-form</wfw:comment>
      <wfw:commentRss>http://www.shadoware.org/feed/atom/comments/674</wfw:commentRss>
      </item>
    
  <item>
    <title>XINX v0.10.1</title>
    <link>http://www.shadoware.org/post/XINX-v0.10.1</link>
    <guid isPermaLink="false">urn:md5:9724be160d0bd6ff2bd95468ae56238e</guid>
    <pubDate>Tue, 03 May 2011 18:46:00 +0200</pubDate>
    <dc:creator>Ulrich Van Den Hekke</dc:creator>
        <category>XINX</category>
        <category>egx</category><category>generix</category><category>generix group</category><category>libre</category><category>logiciel</category><category>qt</category><category>xinx</category><category>xml</category><category>xsl</category>    
    <description>&lt;p&gt;Bonjour à tous,&lt;/p&gt;


&lt;p&gt;Je suis heureux de vous annoncer la nouvelle version de &lt;a href=&quot;http://xinx.shadoware.org?piwik_campaign=20110504_0.10.1_blog&quot; hreflang=&quot;fr&quot; title=&quot;Site internet de XINX&quot;&gt;XINX&lt;/a&gt;. Cette version apporte, en plus de la ré-écriture complète de la gestion du contenu et de la complétion, son petit lot de nouveautés et de corrections.&lt;/p&gt;


&lt;p&gt;La version &lt;em&gt;0.10.1&lt;/em&gt; est beaucoup plus stable que sa grande soeur &lt;em&gt;0.9&lt;/em&gt;. Un soin particulier a été apporté à la recherche des sources d'anomalie possible, ainsi que des fuites mémoires. Ces opérations ont été faites grâce à des outils tels que &lt;a href=&quot;http://valgrind.org/&quot; hreflang=&quot;en&quot;&gt;valgrind&lt;/a&gt;, mais aussi grâce aux béta-testeurs (Merci à eux).&lt;/p&gt;


&lt;p&gt;De plus l'utilisation des pointeurs intelligents de &lt;a href=&quot;http://qt.nokia.com/&quot; hreflang=&quot;en&quot; title=&quot;Nokia Qt&quot;&gt;Qt&lt;/a&gt; ont permis de passer plus de temps, sur la gestion des structures et moins de temps sur la gestion de la mémoire, sur des parties du code assez critiques (comme ContentView et CodeCompletion). Ils ont également permis un partage plus facile des structures entre les différents threads avec moins de contrôle de synchronisation.&lt;/p&gt;


&lt;h3&gt;Liens&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://xinx.shadoware.org?piwik_campaign=20110504_0.10.1_blog&quot; hreflang=&quot;fr&quot; title=&quot;Site Internet de XINX&quot;&gt;Site Internet de XINX&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://xinx.shadoware.org/wiki/Download?piwik_campaign=20110504_0.10.1_blog&quot; hreflang=&quot;fr&quot; title=&quot;Téléchargement de XINX&quot;&gt;Téléchargement de XINX&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://xinx.shadoware.org/newticket?piwik_campaign=20110504_0.10.1_blog&quot; hreflang=&quot;fr&quot; title=&quot;Reporter un ticket&quot;&gt;Faire une demande d'évolution ou reporter un bug&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;    &lt;h3&gt;Gestion Projet et Gestion des sessions&lt;/h3&gt;


&lt;h4&gt;Multi-projet&lt;/h4&gt;


&lt;p&gt;&lt;img src=&quot;http://www.shadoware.org/public/billets/xinx/projectDirectory10.png&quot; alt=&quot;Project Directory v0.10.1&quot; style=&quot;float:right; margin: 0 0 1em 1em;&quot; title=&quot;Project Directory v0.10.1, mai 2011&quot; /&gt;
&lt;strong&gt;XINX&lt;/strong&gt; est maintenant capable d'ouvrir plusieurs projets en même temps. Cela permet donc plusieurs choses&amp;nbsp;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Rechercher un fichier pouvant se trouver dans plusieurs projets différents (par exemple un projet trunk et un projet branche).&lt;/li&gt;
&lt;li&gt;Comparer des fichiers venant de plusieurs projets différents.&lt;/li&gt;
&lt;li&gt;Ne pas basculer d'un projet à l'autre en continu, lorsque l'on travaille sur plusieurs projets en même temps.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A cause de cette gestion de plusieurs projets en même temps, toute la partie de gestion de projet de XINX a été ré-écrite (entre autre la partie concernant la session, que l'on verra ensuite).&lt;/p&gt;


&lt;p&gt;De plus à l'ouverture du projet, l'application recherche l'ensemble des fichiers présents sur le disque afin de permettre une recherche beaucoup plus rapide. Cela a néanmoins quelques répercussions&amp;nbsp;: il n'est pas possible de supprimer un dossier du projet sans fermer XINX.&lt;/p&gt;


&lt;h4&gt;Inclusion / Exclusion de chemin&lt;/h4&gt;


&lt;p&gt;Afin d'avoir une vue propre, XINX affiche déjà uniquement les fichiers qu'il est capable de gérer. Il est également possible de lui définir une liste de chemin qu'il doit ignorer.&lt;/p&gt;


&lt;p&gt;Exemple&amp;nbsp;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;WEB-INF/lib&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;dico&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;configuration&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img src=&quot;http://www.shadoware.org/public/billets/xinx/.projectpropertyIncludeExclude10_m.jpg&quot; alt=&quot;Project Property v0.10.1&quot; style=&quot;display:block; margin:0 auto;&quot; title=&quot;Project Property v0.10.1, mai 2011&quot; /&gt;&lt;/p&gt;


&lt;p&gt;Il est possible d'utiliser des expressions régulières pour définir ces chemins.&lt;/p&gt;


&lt;p&gt;A l'inverse il est possible d'inclure un dossier externe au projet directement dans la vue de celui-ci. L'équivalent d'un lien symbolique mais propre au projet sous XINX. Il est alors possible d'inclure dans le dossier projet, un répertoire temporaire contenant les données utilisées par les feuilles de styles, ou inclure un dossier contenant des fichiers de logs, ...&lt;/p&gt;


&lt;h4&gt;Sessions&lt;/h4&gt;


&lt;p&gt;&lt;img src=&quot;http://www.shadoware.org/public/billets/xinx/.welcomDialog10_s.jpg&quot; alt=&quot;Welcom Dialog v0.10.1&quot; style=&quot;float:left; margin: 0 1em 1em 0;&quot; title=&quot;Welcom Dialog v0.10.1, mai 2011&quot; /&gt;
Suite à la gestion du multi-projet, il a fallu ré-écrire le système de gestion des sessions. Il est maintenant plus proche des systèmes de session des autres applications.&lt;/p&gt;


&lt;p&gt;Alors que sur la version &lt;em&gt;0.9&lt;/em&gt; et précédente, la session était directement associée à un projet (et donc ouverte en même temps), maintenant la session est séparée de la notion de projet.&lt;/p&gt;


&lt;p&gt;Une session peut alors désormais contenir une liste de projet ouvert, une liste de fichier ouvert (associé ou non à un projet), des signets. Plusieurs sessions différentes peuvent pointer vers un même projet mais proposer une vue (un ensemble de fichier ouvert) différente. Une session par défaut est créée pour l'utilisation courante de l'application.&lt;/p&gt;


&lt;h3&gt;Modification du système de complétion&lt;/h3&gt;


&lt;p&gt;&lt;img src=&quot;http://www.shadoware.org/public/billets/xinx/.Completion10_m.jpg&quot; alt=&quot;Code Completion v0.10.1&quot; style=&quot;float:right; margin: 0 0 1em 1em;&quot; title=&quot;Code Completion v0.10.1, mai 2011&quot; /&gt;
Le système de vue contenue et de code complétion a complètement été ré-écrit. La lecture des différents imports des différents fichiers est faite en mémoire (et non plus dans une base de donnée SQL) et en parallèle (s'il y a plusieurs processeurs sur la machine). La lecture des fichiers est ainsi plus rapide. Le système a complètement été ré-écrit pour que la complétion du code soit rapide et stable en même temps.&lt;/p&gt;


&lt;p&gt;La complétion du code affiche désormais les différentes lignes dans des catégories suivant leur emplacement (par exemple le fichier où se trouve chaque template), les snipets dans une catégorie différente...&lt;/p&gt;


&lt;p&gt;XINX est maintenant capable également de compléter&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;les paramètres des templates du type call-template&lt;/li&gt;
&lt;li&gt;les imports (proposition des différents fichiers, et des alias si le plugin Generix est activé)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;et plein d'autres choses &lt;img src=&quot;/dotclear/themes/default/smilies/smile.png&quot; alt=&quot;:)&quot; class=&quot;smiley&quot; /&gt;&lt;/p&gt;


&lt;h3&gt;Et plein d'autres nouveautés&lt;/h3&gt;

&lt;h4&gt;Utilisation de la librairie SVN directement&lt;/h4&gt;


&lt;p&gt;Un nouveau plugin pour SubVersion a été écrit. Ce plugin utilise directement les librairies de SubVersion au lieu d'utiliser l'exécutable svn. Ce plugin est plus performant que le wrapper et ne nécessite pas l'installation d'un client SubVersion (tel que &lt;a href=&quot;http://www.collab.net/downloads/subversion/&quot; hreflang=&quot;en&quot;&gt;CollabNet SubVersion&lt;/a&gt; sous Windows ou le client svn sous linux.&lt;/p&gt;


&lt;p&gt;L'ancien plugin est toujours disponible et utilisable.&lt;/p&gt;


&lt;h4&gt;Créer des tickets depuis XINX&lt;/h4&gt;


&lt;p&gt;&lt;img src=&quot;http://www.shadoware.org/public/billets/xinx/.TicketCreation10_m.jpg&quot; alt=&quot;Create Ticket v0.10.1&quot; style=&quot;display:block; margin:0 auto;&quot; title=&quot;Create Ticket v0.10.1, mai 2011&quot; /&gt;&lt;/p&gt;


&lt;p&gt;Une boite de dialogue permet maintenant de créer automatiquement un compte et un ticket sur le site Internet de XINX. Vous pouvez ainsi créer facilement des demandes d'évolution, des demandes de correction, ...
De plus lors de la sortie d'une nouvelle version, XINX vous informera automatiquement qu'une nouvelle version est disponible.&lt;/p&gt;


&lt;h4&gt;Dock des logs et des erreurs&lt;/h4&gt;


&lt;p&gt;&lt;img src=&quot;http://www.shadoware.org/public/billets/xinx/.ErrorLog10_m.jpg&quot; alt=&quot;Error dock v0.10.1&quot; style=&quot;display:block; margin:0 auto;&quot; title=&quot;Error dock v0.10.1, mai 2011&quot; /&gt;&lt;/p&gt;


&lt;p&gt;Le dock d'affichage des erreurs a été amélioré pour ne plus perturber l'utilisateur en s'ouvrant de façon intempestive. Il est maintenant possible de définir que le dock doit rester fermé, un compteur affiche alors le nombre d'erreur .&lt;/p&gt;


&lt;h4&gt;Modification de la recherche&lt;/h4&gt;


&lt;p&gt;&lt;img src=&quot;http://www.shadoware.org/public/billets/xinx/.SearchDock10_m.jpg&quot; alt=&quot;Search Dock 10&quot; style=&quot;float:right; margin: 0 0 1em 1em;&quot; title=&quot;Search Dock 10, mai 2011&quot; /&gt;&lt;/p&gt;


&lt;p&gt;Suite à la gestion du multi-projet, XINX peut maintenant rechercher dans plusieurs projets en même temps. Il est aussi possible d'arrêter la recherche en plein milieu.&lt;/p&gt;


&lt;h4&gt;Validation d'un fichier XML&lt;/h4&gt;


&lt;p&gt;XINX peut également valider un fichier XML à partir d'un schéma. Il ne peut malheureusement pas encore valider de fichier XSL (les parseurs XSL trouvés n'arrivent pas à lire les schémas des fichiers XSLT).&lt;/p&gt;


&lt;h4&gt;Correction de bugs&lt;/h4&gt;


&lt;p&gt;Beaucoup de corrections de bug ont été faites ce qui rend cette version très stable.&lt;/p&gt;


&lt;h3&gt;Et pour la suite&amp;nbsp;?&lt;/h3&gt;


&lt;p&gt;Dans la même série, j'ai l'intention de sortir une version avec de nouveaux modèles, de la documentation, ....&lt;/p&gt;


&lt;p&gt;Pour la version suivante, le moteur JavaScript sera amélioré pour ne plus donner d'erreur, voir proposer de la complétion plus performante.&lt;/p&gt;</description>
    
    
    
          <comments>http://www.shadoware.org/post/XINX-v0.10.1#comment-form</comments>
      <wfw:comment>http://www.shadoware.org/post/XINX-v0.10.1#comment-form</wfw:comment>
      <wfw:commentRss>http://www.shadoware.org/feed/atom/comments/644</wfw:commentRss>
      </item>
    
  <item>
    <title>[C++/Qt] Concaténation de chaînes de caractères</title>
    <link>http://www.shadoware.org/post/2010/12/21/%5BC/Qt%5D-Concat%C3%A9nation-de-chaine-de-caract%C3%A8re</link>
    <guid isPermaLink="false">urn:md5:5f35cced448e3f18b1997d657393c995</guid>
    <pubDate>Wed, 22 Dec 2010 13:03:00 +0100</pubDate>
    <dc:creator>Ulrich Van Den Hekke</dc:creator>
        <category>Performances</category>
        <category>libre</category><category>nokia</category><category>performance</category><category>planet</category><category>qstring</category><category>qt</category><category>trolltech</category>    
    <description>&lt;h3&gt;Présentation&lt;/h3&gt;


&lt;p&gt;Qt est un framework orienté objet écrit en C++ et permettant de faire des interfaces graphiques à l’aide de ces widgets. Ce framework est utilisé par le projet KDE depuis ses débuts pour en faire un environnement très complet.&lt;/p&gt;


&lt;p&gt;Qt permet donc de faire des interfaces graphiques mais aussi d’accéder à des bases de données SQL, de faire de la communication réseau, une gestion simplifiée des threads, la lecture de fichier XML. Qt intègre aussi le moteur HTML Webkit.&lt;/p&gt;


&lt;p&gt;Qt ajoute une couche supplémentaire au C++ permettant de faire de l’introspection de classe un peu plus poussée (comme l’appel d’une méthode dont on ne connaît le nom qu’à l’exécution). Qt permet également la gestion d’évènement par l’intermédiaire d’un système puissant de SIGNALS et de SLOTS.&lt;/p&gt;


&lt;p&gt;Dans la suite de cet article nous allons nous concentrer sur une très petite partie de Qt mais qui est utilisée dans beaucoup d’applications écrites en Qt&amp;nbsp;: les chaînes de caractères, et plus précisément, la concaténation de chaînes de caractères.&lt;/p&gt;    &lt;h2&gt;Concaténation de chaînes de caractères.&lt;/h2&gt;


&lt;p&gt;Comme dans d’autres langages, la concaténation de chaînes de caractères se fait à l'aide de l'opérateur &lt;code&gt;+&lt;/code&gt;. Prenons un exemple simple&amp;nbsp;:&lt;/p&gt;

&lt;pre class=&quot;cpp cpp&quot; style=&quot;font-family:inherit&quot;&gt;&lt;span style=&quot;color: #339900;&quot;&gt;#include &amp;lt;QString&amp;gt;&lt;/span&gt;
&amp;nbsp;
QString abc &lt;span style=&quot;color: #000080;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;quot;abc&amp;quot;&lt;/span&gt;, def &lt;span style=&quot;color: #000080;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;quot;def&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #008080;&quot;&gt;;&lt;/span&gt;
QString result&lt;span style=&quot;color: #008080;&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
result &lt;span style=&quot;color: #000080;&quot;&gt;=&lt;/span&gt; abc &lt;span style=&quot;color: #000040;&quot;&gt;+&lt;/span&gt; def&lt;span style=&quot;color: #008080;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;



&lt;p&gt;L'utilisation de l'opérateur &lt;code&gt;+&lt;/code&gt; facilite l'écriture de la concaténation des chaînes de caractères (tout comme l'opérateur &lt;code&gt;==&lt;/code&gt; permet de facilement comparer des chaînes de caractères de type QString).&lt;/p&gt;


&lt;p&gt;Malheureusement cette écriture rend le code peu performant pour diverses raisons (que l’on peut retrouver dans la documentation de l’objet QString).&lt;/p&gt;


&lt;h3&gt;Concaténation rapide de chaînes de caractères&lt;/h3&gt;


&lt;p&gt;A partir de Qt 4.6, Nokia, a ajouté un &lt;code&gt;template&lt;/code&gt; nommé QStringBuilder (cet objet fait beaucoup penser à l'objet StringBuilder de JAVA permettant d'accélérer les concaténations de chaînes de caractères).&lt;/p&gt;


&lt;p&gt;Ce template ne s’utilise pas directement mais au travers de l'opérateur &lt;code&gt;%&lt;/code&gt;. En remplaçant donc l'opérateur &lt;code&gt;+&lt;/code&gt; par &lt;code&gt;%&lt;/code&gt; on gagne en performance (dixit la doc de Qt).&lt;/p&gt;


&lt;p&gt;Pour pouvoir utiliser l'opérateur, il suffit d'inclure le fichier &lt;code&gt;QStringBuilder&lt;/code&gt;&amp;nbsp;:&lt;/p&gt;

&lt;pre class=&quot;cpp cpp&quot; style=&quot;font-family:inherit&quot;&gt;&lt;span style=&quot;color: #339900;&quot;&gt;#include &amp;lt;QStringBuilder&amp;gt;&lt;/span&gt;
&amp;nbsp;
QString abc &lt;span style=&quot;color: #000080;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;quot;abc&amp;quot;&lt;/span&gt;, def &lt;span style=&quot;color: #000080;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;quot;def&amp;quot;&lt;/span&gt;, ghi &lt;span style=&quot;color: #000080;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;quot;ghi&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #008080;&quot;&gt;;&lt;/span&gt;
QString result&lt;span style=&quot;color: #008080;&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
result &lt;span style=&quot;color: #000080;&quot;&gt;=&lt;/span&gt; abc &lt;span style=&quot;color: #000040;&quot;&gt;%&lt;/span&gt; def &lt;span style=&quot;color: #000040;&quot;&gt;%&lt;/span&gt; ghi&lt;span style=&quot;color: #008080;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;


&lt;p&gt;Une autre possibilité est de définir (par exemple dans votre fichier .pro ou dans un include général de votre application)  les définitions &lt;code&gt;QT_USE_FAST_CONCATENATION&lt;/code&gt;,  et &lt;code&gt;QT_USE_FAST_OPERATOR_PLUS&lt;/code&gt;.&lt;/p&gt;


&lt;p&gt;Ces définitions permettent de remplacer l'opérateur &lt;code&gt;+&lt;/code&gt; par l'opérateur &lt;code&gt;%&lt;/code&gt; dans toute l'application. Par contre cette opération peut demander quelques modifications de votre code.&lt;/p&gt;

&lt;pre class=&quot;cpp cpp&quot; style=&quot;font-family:inherit&quot;&gt;&lt;span style=&quot;color: #339900;&quot;&gt;#define QT_USE_FAST_CONCATENATION&lt;/span&gt;
&lt;span style=&quot;color: #339900;&quot;&gt;#define QT_USE_FAST_OPERATOR_PLUS&lt;/span&gt;
&amp;nbsp;
&lt;span style=&quot;color: #339900;&quot;&gt;#include &amp;lt;QString&amp;gt;&lt;/span&gt;
&amp;nbsp;
QString abc &lt;span style=&quot;color: #000080;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;quot;abc&amp;quot;&lt;/span&gt;, def &lt;span style=&quot;color: #000080;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;quot;def&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #008080;&quot;&gt;;&lt;/span&gt;
QString result&lt;span style=&quot;color: #008080;&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
result &lt;span style=&quot;color: #000080;&quot;&gt;=&lt;/span&gt; abc &lt;span style=&quot;color: #000040;&quot;&gt;+&lt;/span&gt; def&lt;span style=&quot;color: #008080;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;


&lt;h3&gt;Benchmark&lt;/h3&gt;


&lt;p&gt;Nous allons donc dans la suite du document vérifier que l'opérateur &lt;code&gt;%&lt;/code&gt; est plus rapide que l'opérateur &lt;code&gt;+&lt;/code&gt;. Pour cela nous allons utiliser le module de benchmark de Qt.&lt;/p&gt;


&lt;h4&gt;Code source&lt;/h4&gt;


&lt;p&gt;Voici le petit programme permettant de tester la performance de la concaténation. Notre exemple simple va constituer à la concaténation de 26 chaînes de caractères créées au début. L'appel se fera une première fois en utilisant l'opérateur &lt;code&gt;+&lt;/code&gt; et une seconde fois en utilisant l'opérateur &lt;code&gt;%&lt;/code&gt;.&lt;/p&gt;

&lt;pre class=&quot;cpp cpp&quot; style=&quot;font-family:inherit&quot;&gt;&lt;span style=&quot;color: #339900;&quot;&gt;#include &amp;lt;QtCore/QString&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #339900;&quot;&gt;#include &amp;lt;QtTest/QtTest&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: #339900;&quot;&gt;#include &amp;lt;QStringBuilder&amp;gt;&lt;/span&gt;
&amp;nbsp;
&lt;span style=&quot;color: #0000ff;&quot;&gt;class&lt;/span&gt; TestPerf &lt;span style=&quot;color: #008080;&quot;&gt;:&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;public&lt;/span&gt; QObject
&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#123;&lt;/span&gt;
    Q_OBJECT
&amp;nbsp;
&lt;span style=&quot;color: #0000ff;&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;color: #008080;&quot;&gt;:&lt;/span&gt;
    TestPerf&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #008080;&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
&lt;span style=&quot;color: #0000ff;&quot;&gt;private&lt;/span&gt; Q_SLOTS&lt;span style=&quot;color: #008080;&quot;&gt;:&lt;/span&gt;
    &lt;span style=&quot;color: #0000ff;&quot;&gt;void&lt;/span&gt; concat&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #008080;&quot;&gt;;&lt;/span&gt;
    &lt;span style=&quot;color: #0000ff;&quot;&gt;void&lt;/span&gt; concat_data&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #008080;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span style=&quot;color: #008080;&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
TestPerf&lt;span style=&quot;color: #008080;&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color: #007788;&quot;&gt;TestPerf&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#123;&lt;/span&gt;
&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
&lt;span style=&quot;color: #0000ff;&quot;&gt;void&lt;/span&gt; TestPerf&lt;span style=&quot;color: #008080;&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color: #007788;&quot;&gt;concat&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#123;&lt;/span&gt;
	QFETCH&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;bool&lt;/span&gt;, useStringBuilder&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #008080;&quot;&gt;;&lt;/span&gt;
	QString result&lt;span style=&quot;color: #008080;&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
	QString a&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;quot;a&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#41;&lt;/span&gt;, b&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;quot;b&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#41;&lt;/span&gt;, c&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;quot;c&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#41;&lt;/span&gt;, d&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;quot;d&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#41;&lt;/span&gt;, e&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;quot;e&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#41;&lt;/span&gt;, f&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;quot;f&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#41;&lt;/span&gt;, g&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;quot;g&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#41;&lt;/span&gt;, h&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;quot;h&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#41;&lt;/span&gt;, i&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;quot;i&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#41;&lt;/span&gt;, j&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;quot;j&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#41;&lt;/span&gt;, k&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;quot;k&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#41;&lt;/span&gt;, l&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;quot;l&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#41;&lt;/span&gt;, m&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;quot;m&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#41;&lt;/span&gt;, n&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;quot;n&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#41;&lt;/span&gt;, o&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;quot;o&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#41;&lt;/span&gt;, p&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;quot;p&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#41;&lt;/span&gt;, q&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;quot;q&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#41;&lt;/span&gt;, r&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;quot;r&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#41;&lt;/span&gt;, s&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;quot;s&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#41;&lt;/span&gt;, t&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;quot;t&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#41;&lt;/span&gt;, u&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;quot;u&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#41;&lt;/span&gt;, v&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;quot;v&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#41;&lt;/span&gt;, w&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;quot;w&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#41;&lt;/span&gt;, x&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;quot;x&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#41;&lt;/span&gt;, y&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;quot;y&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#41;&lt;/span&gt;, z&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;quot;z&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #008080;&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
	&lt;span style=&quot;color: #0000ff;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #008000;&quot;&gt;&amp;#40;&lt;/span&gt;useStringBuilder&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#41;&lt;/span&gt;
	&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#123;&lt;/span&gt;
		QBENCHMARK
		&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#123;&lt;/span&gt;
			&lt;span style=&quot;color: #666666;&quot;&gt;// Concaténation en utilisant QStringBuilder&lt;/span&gt;
			&lt;span style=&quot;color: #666666;&quot;&gt;// Dans ce cas la concaténation devrait être plus rapide&lt;/span&gt;
			result &lt;span style=&quot;color: #000080;&quot;&gt;=&lt;/span&gt; a &lt;span style=&quot;color: #000040;&quot;&gt;%&lt;/span&gt; b &lt;span style=&quot;color: #000040;&quot;&gt;%&lt;/span&gt; c &lt;span style=&quot;color: #000040;&quot;&gt;%&lt;/span&gt; d &lt;span style=&quot;color: #000040;&quot;&gt;%&lt;/span&gt; e &lt;span style=&quot;color: #000040;&quot;&gt;%&lt;/span&gt; f &lt;span style=&quot;color: #000040;&quot;&gt;%&lt;/span&gt; g &lt;span style=&quot;color: #000040;&quot;&gt;%&lt;/span&gt; h &lt;span style=&quot;color: #000040;&quot;&gt;%&lt;/span&gt; i &lt;span style=&quot;color: #000040;&quot;&gt;%&lt;/span&gt; j &lt;span style=&quot;color: #000040;&quot;&gt;%&lt;/span&gt; k &lt;span style=&quot;color: #000040;&quot;&gt;%&lt;/span&gt; l &lt;span style=&quot;color: #000040;&quot;&gt;%&lt;/span&gt; m &lt;span style=&quot;color: #000040;&quot;&gt;%&lt;/span&gt; n &lt;span style=&quot;color: #000040;&quot;&gt;%&lt;/span&gt; o &lt;span style=&quot;color: #000040;&quot;&gt;%&lt;/span&gt; p &lt;span style=&quot;color: #000040;&quot;&gt;%&lt;/span&gt; q &lt;span style=&quot;color: #000040;&quot;&gt;%&lt;/span&gt; r &lt;span style=&quot;color: #000040;&quot;&gt;%&lt;/span&gt; s &lt;span style=&quot;color: #000040;&quot;&gt;%&lt;/span&gt; t &lt;span style=&quot;color: #000040;&quot;&gt;%&lt;/span&gt; u &lt;span style=&quot;color: #000040;&quot;&gt;%&lt;/span&gt; v &lt;span style=&quot;color: #000040;&quot;&gt;%&lt;/span&gt; w &lt;span style=&quot;color: #000040;&quot;&gt;%&lt;/span&gt; x &lt;span style=&quot;color: #000040;&quot;&gt;%&lt;/span&gt; y &lt;span style=&quot;color: #000040;&quot;&gt;%&lt;/span&gt; z&lt;span style=&quot;color: #008080;&quot;&gt;;&lt;/span&gt;
		&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#125;&lt;/span&gt;
	&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#125;&lt;/span&gt;
	&lt;span style=&quot;color: #0000ff;&quot;&gt;else&lt;/span&gt;
	&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#123;&lt;/span&gt;
		QBENCHMARK
		&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#123;&lt;/span&gt;
			&lt;span style=&quot;color: #666666;&quot;&gt;// Concaténation en n'utilisant pas QStringBuilder. On utilise alors la concaténation normal de chaînes de caractères en utilisant&lt;/span&gt;
			&lt;span style=&quot;color: #666666;&quot;&gt;// QString&lt;/span&gt;
			result &lt;span style=&quot;color: #000080;&quot;&gt;=&lt;/span&gt; a &lt;span style=&quot;color: #000040;&quot;&gt;+&lt;/span&gt; b &lt;span style=&quot;color: #000040;&quot;&gt;+&lt;/span&gt; c &lt;span style=&quot;color: #000040;&quot;&gt;+&lt;/span&gt; d &lt;span style=&quot;color: #000040;&quot;&gt;+&lt;/span&gt; e &lt;span style=&quot;color: #000040;&quot;&gt;+&lt;/span&gt; f &lt;span style=&quot;color: #000040;&quot;&gt;+&lt;/span&gt; g &lt;span style=&quot;color: #000040;&quot;&gt;+&lt;/span&gt; h &lt;span style=&quot;color: #000040;&quot;&gt;+&lt;/span&gt; i &lt;span style=&quot;color: #000040;&quot;&gt;+&lt;/span&gt; j &lt;span style=&quot;color: #000040;&quot;&gt;+&lt;/span&gt; k &lt;span style=&quot;color: #000040;&quot;&gt;+&lt;/span&gt; l &lt;span style=&quot;color: #000040;&quot;&gt;+&lt;/span&gt; m &lt;span style=&quot;color: #000040;&quot;&gt;+&lt;/span&gt; n &lt;span style=&quot;color: #000040;&quot;&gt;+&lt;/span&gt; o &lt;span style=&quot;color: #000040;&quot;&gt;+&lt;/span&gt; p &lt;span style=&quot;color: #000040;&quot;&gt;+&lt;/span&gt; q &lt;span style=&quot;color: #000040;&quot;&gt;+&lt;/span&gt; r &lt;span style=&quot;color: #000040;&quot;&gt;+&lt;/span&gt; s &lt;span style=&quot;color: #000040;&quot;&gt;+&lt;/span&gt; t &lt;span style=&quot;color: #000040;&quot;&gt;+&lt;/span&gt; u &lt;span style=&quot;color: #000040;&quot;&gt;+&lt;/span&gt; v &lt;span style=&quot;color: #000040;&quot;&gt;+&lt;/span&gt; w &lt;span style=&quot;color: #000040;&quot;&gt;+&lt;/span&gt; x &lt;span style=&quot;color: #000040;&quot;&gt;+&lt;/span&gt; y &lt;span style=&quot;color: #000040;&quot;&gt;+&lt;/span&gt; z&lt;span style=&quot;color: #008080;&quot;&gt;;&lt;/span&gt;
		&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#125;&lt;/span&gt;
	&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
&lt;span style=&quot;color: #0000ff;&quot;&gt;void&lt;/span&gt; TestPerf&lt;span style=&quot;color: #008080;&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color: #007788;&quot;&gt;concat_data&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#123;&lt;/span&gt;
	QTest&lt;span style=&quot;color: #008080;&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color: #007788;&quot;&gt;addColumn&lt;/span&gt;&lt;span style=&quot;color: #000080;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #0000ff;&quot;&gt;bool&lt;/span&gt;&lt;span style=&quot;color: #000080;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;quot;useStringBuilder&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #008080;&quot;&gt;;&lt;/span&gt;
	QTest&lt;span style=&quot;color: #008080;&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color: #007788;&quot;&gt;newRow&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;quot;Don't use QStringBuilder&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #000080;&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color: #008080;&quot;&gt;;&lt;/span&gt;
	QTest&lt;span style=&quot;color: #008080;&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color: #007788;&quot;&gt;newRow&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;quot;Use QStringBuilder&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #000080;&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;color: #0000ff;&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;color: #008080;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
QTEST_APPLESS_MAIN&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#40;&lt;/span&gt;TestPerf&lt;span style=&quot;color: #008000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #008080;&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
&lt;span style=&quot;color: #339900;&quot;&gt;#include &amp;quot;tst_testperf.moc&amp;quot;&lt;/span&gt;&lt;/pre&gt;


&lt;h4&gt;Résultat du test&lt;/h4&gt;


&lt;p&gt;Le test a été fait en utilisant la version 4.6.3 de Qt. Le résultat est sensiblement le même avec la version 4.7.0&lt;/p&gt;

&lt;table&gt;
&lt;tr&gt;&lt;th&gt;Sans QStringBuilder&lt;/th&gt;&lt;td&gt;0.00367 msec&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;th&gt;Avec QStringBuilder&lt;/th&gt;&lt;td&gt;0.00046 msec&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;



&lt;p&gt;On voit dans ce test que la version en utilisant QStringBuilder est 8 fois plus rapide que sans. Bien sûr vu le temps que prend la concaténation de chaînes de caractères, ce test commence à avoir de l'intérêt uniquement à partir du moment où on fait beaucoup de concaténation dans la seconde, ou si les temps de réponses sont critiques.&lt;/p&gt;


&lt;p&gt;Sur ce, je vous souhaite à tous un Joyeux noël et une bonne année.&lt;/p&gt;</description>
    
          <enclosure url="http://www.shadoware.org/public/billets/concat/test-perfconcat.7z"
      length="862" type="text/plain" />
    
    
          <comments>http://www.shadoware.org/post/2010/12/21/%5BC/Qt%5D-Concat%C3%A9nation-de-chaine-de-caract%C3%A8re#comment-form</comments>
      <wfw:comment>http://www.shadoware.org/post/2010/12/21/%5BC/Qt%5D-Concat%C3%A9nation-de-chaine-de-caract%C3%A8re#comment-form</wfw:comment>
      <wfw:commentRss>http://www.shadoware.org/feed/atom/comments/626</wfw:commentRss>
      </item>
    
  <item>
    <title>Calcul de la distance entre deux fichiers</title>
    <link>http://www.shadoware.org/post/2010/06/06/Calcul-de-la-Distance</link>
    <guid isPermaLink="false">urn:md5:a8e01d8f9c4c3ba53558afe790f6d995</guid>
    <pubDate>Sun, 06 Jun 2010 11:40:00 +0200</pubDate>
    <dc:creator>Ulrich Van Den Hekke</dc:creator>
        <category>C++</category>
        <category>cartographie</category><category>compression</category><category>distance</category><category>libre</category><category>planet</category><category>qt</category>    
    <description>&lt;h3&gt;Présentation&lt;/h3&gt;


&lt;p&gt;Suite à un &lt;a href=&quot;http://linuxfr.org/forums/20/28366.html&quot; hreflang=&quot;fr&quot;&gt;billet sur LinuxFR&lt;/a&gt;, où je demandais comment calculer la distance (ou le pourcentage de similitude entre deux logiciels), j'ai obtenu la formule suivante&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
distance = 1 - ( C(A) + C(B) - C(AB) ) / Max(C(A), C(B))
&lt;/pre&gt;


&lt;p&gt;où C(X) est la taille du fichier X compressé&lt;sup&gt;[&lt;a href=&quot;http://www.shadoware.org/post/2010/06/06/Calcul-de-la-Distance#pnote-625-1&quot; id=&quot;rev-pnote-625-1&quot;&gt;1&lt;/a&gt;]&lt;/sup&gt;.&lt;/p&gt;


&lt;p&gt;Après avoir testé les formats &lt;code&gt;gzip&lt;/code&gt;, &lt;code&gt;bzip2&lt;/code&gt; et &lt;code&gt;lzma&lt;/code&gt;, j'ai conclu que le format de compression le plus performant pour le calcul, est le format &lt;code&gt;lzma&lt;/code&gt;, car le dictionnaire avec &lt;em&gt;la mise en commun&lt;/em&gt; était le plus gros, et donc le calcul de distance est plus efficace.&lt;/p&gt;
&lt;div class=&quot;footnotes&quot;&gt;&lt;h4&gt;Notes&lt;/h4&gt;
&lt;p&gt;[&lt;a href=&quot;http://www.shadoware.org/post/2010/06/06/Calcul-de-la-Distance#rev-pnote-625-1&quot; id=&quot;pnote-625-1&quot;&gt;1&lt;/a&gt;] On peut retrouver l'explication de cette formule &lt;a href=&quot;http://interstices.info/jcms/c_21828/classer-musiques-langues-images-textes-et-genomes&quot; hreflang=&quot;fr&quot;&gt;ici&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;
    &lt;h3&gt;Le programme&lt;/h3&gt;


&lt;p&gt;J'ai donc décidé d'écrire un programme parcourant un dossier (avec plusieurs milliers de fichiers) et de calculer pour toutes les combinaisons des fichiers la distance entre chaque fichier. Ce programme consommant énormément de mémoire, il se peut que pour un grand nombre de fichier, le programme se plante avec une erreur d'allocation de mémoire.&lt;/p&gt;


&lt;p&gt;Ce programme permet de pouvoir faire une cartographie de ces fichiers et ainsi de pouvoir les classer. Testé sur des fichiers textes (sources de logiciels), le programme est assez efficace.&lt;/p&gt;


&lt;p&gt;Testé sur des images, ou des vidéos, les fichiers sont considérés comme tous éloignés les uns des autres, même s'ils sont identiques à  compression différente près, ou s'ils sont identiques à un mouvement près sur la photo (du genre une photo où une même personne se tient dans une position différente).&lt;/p&gt;


&lt;p&gt;Si vous avez une idée sur comment calculer la distance entre deux fichiers déjà compressés (avec perte qui plus est), ca m'intéresse. &lt;img src=&quot;/dotclear/themes/default/smilies/smile.png&quot; alt=&quot;:)&quot; class=&quot;smiley&quot; /&gt;&lt;/p&gt;


&lt;p&gt;Comme l'exécution est très lente (compression lzma niveau 9), le programme peut être arrêté et redémarré.&lt;/p&gt;


&lt;p&gt;Pour démarrer le programme, il faut exécuter la commande&amp;nbsp;:&lt;/p&gt;

&lt;pre class=&quot;bash bash&quot; style=&quot;font-family:inherit&quot;&gt;.&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;calcul_distance &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;mon&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;dossier&lt;/pre&gt;


&lt;p&gt;Le programme va alors créer un fichier &lt;code&gt;{5ac1fd3c-504f-4110-9f7e-d6fc89e57bdb}.db&lt;/code&gt; où &lt;code&gt;{5ac1fd3c-504f-4110-9f7e-d6fc89e57bdb}&lt;/code&gt; est différent à chaque nouveau lancement.&lt;/p&gt;


&lt;p&gt;Pour reprendre le traitement où il était, il suffit alors de lancer&amp;nbsp;:&lt;/p&gt;

&lt;pre class=&quot;bash bash&quot; style=&quot;font-family:inherit&quot;&gt;.&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;calcul_distance &lt;span style=&quot;color: #660033;&quot;&gt;--uuid&lt;/span&gt; &lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#123;&lt;/span&gt;5ac1fd3c-504f-&lt;span style=&quot;color: #000000;&quot;&gt;4110&lt;/span&gt;-9f7e-d6fc89e57bdb&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;


&lt;p&gt;Si on veut ajouter un dossier au traitement après coup&amp;nbsp;:&lt;/p&gt;

&lt;pre class=&quot;bash bash&quot; style=&quot;font-family:inherit&quot;&gt;.&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;calcul_distance &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;nouveau&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;dossier &lt;span style=&quot;color: #660033;&quot;&gt;--uuid&lt;/span&gt; &lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#123;&lt;/span&gt;5ac1fd3c-504f-&lt;span style=&quot;color: #000000;&quot;&gt;4110&lt;/span&gt;-9f7e-d6fc89e57bdb&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;


&lt;h3&gt;Exemple&lt;/h3&gt;


&lt;p&gt;Par exemple soit les différentes versions d'un logiciel, mis dans des archives &lt;code&gt;tar&lt;/code&gt;. Pour ne prendre que le code source des versions, on va supprimer tous les fichiers suivants de l'archive &lt;code&gt;tar&lt;/code&gt;&amp;nbsp;: &lt;code&gt;*.jpg, *.png, *.ico, *.qm, *.db&lt;/code&gt;, ... les sources externes à l'application. On ne garde donc que les fichiers textes dont nous avons la possession.&lt;/p&gt;


&lt;p&gt;Après le nettoyage des dossiers&amp;nbsp;:&lt;/p&gt;

&lt;pre class=&quot;bash bash&quot; style=&quot;font-family:inherit&quot;&gt;$ &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;for&lt;/span&gt; i &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;in&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;`&lt;/span&gt;&lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;ls&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;`&lt;/span&gt; ; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;do&lt;/span&gt;
&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;tar&lt;/span&gt; &lt;span style=&quot;color: #660033;&quot;&gt;-c&lt;/span&gt; &lt;span style=&quot;color: #007800;&quot;&gt;$i&lt;/span&gt;&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/*&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: #007800;&quot;&gt;$i&lt;/span&gt;.tar
&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;done&lt;/span&gt;
$ &lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;ls&lt;/span&gt; &lt;span style=&quot;color: #660033;&quot;&gt;-l&lt;/span&gt;
&lt;span style=&quot;color: #660033;&quot;&gt;-rw-r--r--&lt;/span&gt; &lt;span style=&quot;color: #000000;&quot;&gt;1&lt;/span&gt; phoenix phoenix &lt;span style=&quot;color: #000000;&quot;&gt;2&lt;/span&gt;,5M  &lt;span style=&quot;color: #000000;&quot;&gt;6&lt;/span&gt; juin  &lt;span style=&quot;color: #000000;&quot;&gt;13&lt;/span&gt;:&lt;span style=&quot;color: #000000;&quot;&gt;24&lt;/span&gt; v0.6.10.tar
&lt;span style=&quot;color: #660033;&quot;&gt;-rw-r--r--&lt;/span&gt; &lt;span style=&quot;color: #000000;&quot;&gt;1&lt;/span&gt; phoenix phoenix 440K  &lt;span style=&quot;color: #000000;&quot;&gt;6&lt;/span&gt; juin  &lt;span style=&quot;color: #000000;&quot;&gt;13&lt;/span&gt;:&lt;span style=&quot;color: #000000;&quot;&gt;24&lt;/span&gt; v0.6.4.tar
&lt;span style=&quot;color: #660033;&quot;&gt;-rw-r--r--&lt;/span&gt; &lt;span style=&quot;color: #000000;&quot;&gt;1&lt;/span&gt; phoenix phoenix 530K  &lt;span style=&quot;color: #000000;&quot;&gt;6&lt;/span&gt; juin  &lt;span style=&quot;color: #000000;&quot;&gt;13&lt;/span&gt;:&lt;span style=&quot;color: #000000;&quot;&gt;24&lt;/span&gt; v0.6.5.tar
&lt;span style=&quot;color: #660033;&quot;&gt;-rw-r--r--&lt;/span&gt; &lt;span style=&quot;color: #000000;&quot;&gt;1&lt;/span&gt; phoenix phoenix 610K  &lt;span style=&quot;color: #000000;&quot;&gt;6&lt;/span&gt; juin  &lt;span style=&quot;color: #000000;&quot;&gt;13&lt;/span&gt;:&lt;span style=&quot;color: #000000;&quot;&gt;24&lt;/span&gt; v0.6.6.tar
&lt;span style=&quot;color: #660033;&quot;&gt;-rw-r--r--&lt;/span&gt; &lt;span style=&quot;color: #000000;&quot;&gt;1&lt;/span&gt; phoenix phoenix 690K  &lt;span style=&quot;color: #000000;&quot;&gt;6&lt;/span&gt; juin  &lt;span style=&quot;color: #000000;&quot;&gt;13&lt;/span&gt;:&lt;span style=&quot;color: #000000;&quot;&gt;24&lt;/span&gt; v0.6.7.tar
&lt;span style=&quot;color: #660033;&quot;&gt;-rw-r--r--&lt;/span&gt; &lt;span style=&quot;color: #000000;&quot;&gt;1&lt;/span&gt; phoenix phoenix &lt;span style=&quot;color: #000000;&quot;&gt;1&lt;/span&gt;,2M  &lt;span style=&quot;color: #000000;&quot;&gt;6&lt;/span&gt; juin  &lt;span style=&quot;color: #000000;&quot;&gt;13&lt;/span&gt;:&lt;span style=&quot;color: #000000;&quot;&gt;24&lt;/span&gt; v0.6.8.tar
&lt;span style=&quot;color: #660033;&quot;&gt;-rw-r--r--&lt;/span&gt; &lt;span style=&quot;color: #000000;&quot;&gt;1&lt;/span&gt; phoenix phoenix &lt;span style=&quot;color: #000000;&quot;&gt;1&lt;/span&gt;,3M  &lt;span style=&quot;color: #000000;&quot;&gt;6&lt;/span&gt; juin  &lt;span style=&quot;color: #000000;&quot;&gt;13&lt;/span&gt;:&lt;span style=&quot;color: #000000;&quot;&gt;24&lt;/span&gt; v0.6.9.tar
&lt;span style=&quot;color: #660033;&quot;&gt;-rw-r--r--&lt;/span&gt; &lt;span style=&quot;color: #000000;&quot;&gt;1&lt;/span&gt; phoenix phoenix &lt;span style=&quot;color: #000000;&quot;&gt;2&lt;/span&gt;,9M  &lt;span style=&quot;color: #000000;&quot;&gt;6&lt;/span&gt; juin  &lt;span style=&quot;color: #000000;&quot;&gt;13&lt;/span&gt;:&lt;span style=&quot;color: #000000;&quot;&gt;24&lt;/span&gt; v0.7.0.tar
&lt;span style=&quot;color: #660033;&quot;&gt;-rw-r--r--&lt;/span&gt; &lt;span style=&quot;color: #000000;&quot;&gt;1&lt;/span&gt; phoenix phoenix &lt;span style=&quot;color: #000000;&quot;&gt;2&lt;/span&gt;,2M  &lt;span style=&quot;color: #000000;&quot;&gt;6&lt;/span&gt; juin  &lt;span style=&quot;color: #000000;&quot;&gt;13&lt;/span&gt;:&lt;span style=&quot;color: #000000;&quot;&gt;24&lt;/span&gt; v0.7.1.tar
&lt;span style=&quot;color: #660033;&quot;&gt;-rw-r--r--&lt;/span&gt; &lt;span style=&quot;color: #000000;&quot;&gt;1&lt;/span&gt; phoenix phoenix &lt;span style=&quot;color: #000000;&quot;&gt;3&lt;/span&gt;,3M  &lt;span style=&quot;color: #000000;&quot;&gt;6&lt;/span&gt; juin  &lt;span style=&quot;color: #000000;&quot;&gt;13&lt;/span&gt;:&lt;span style=&quot;color: #000000;&quot;&gt;24&lt;/span&gt; v0.7.2.tar
&lt;span style=&quot;color: #660033;&quot;&gt;-rw-r--r--&lt;/span&gt; &lt;span style=&quot;color: #000000;&quot;&gt;1&lt;/span&gt; phoenix phoenix &lt;span style=&quot;color: #000000;&quot;&gt;3&lt;/span&gt;,3M  &lt;span style=&quot;color: #000000;&quot;&gt;6&lt;/span&gt; juin  &lt;span style=&quot;color: #000000;&quot;&gt;13&lt;/span&gt;:&lt;span style=&quot;color: #000000;&quot;&gt;24&lt;/span&gt; v0.8.0.tar
&lt;span style=&quot;color: #660033;&quot;&gt;-rw-r--r--&lt;/span&gt; &lt;span style=&quot;color: #000000;&quot;&gt;1&lt;/span&gt; phoenix phoenix &lt;span style=&quot;color: #000000;&quot;&gt;3&lt;/span&gt;,1M  &lt;span style=&quot;color: #000000;&quot;&gt;6&lt;/span&gt; juin  &lt;span style=&quot;color: #000000;&quot;&gt;13&lt;/span&gt;:&lt;span style=&quot;color: #000000;&quot;&gt;24&lt;/span&gt; v0.8.1_services.tar
&lt;span style=&quot;color: #660033;&quot;&gt;-rw-r--r--&lt;/span&gt; &lt;span style=&quot;color: #000000;&quot;&gt;1&lt;/span&gt; phoenix phoenix &lt;span style=&quot;color: #000000;&quot;&gt;3&lt;/span&gt;,1M  &lt;span style=&quot;color: #000000;&quot;&gt;6&lt;/span&gt; juin  &lt;span style=&quot;color: #000000;&quot;&gt;13&lt;/span&gt;:&lt;span style=&quot;color: #000000;&quot;&gt;24&lt;/span&gt; v0.8.1.tar
&lt;span style=&quot;color: #660033;&quot;&gt;-rw-r--r--&lt;/span&gt; &lt;span style=&quot;color: #000000;&quot;&gt;1&lt;/span&gt; phoenix phoenix &lt;span style=&quot;color: #000000;&quot;&gt;3&lt;/span&gt;,8M  &lt;span style=&quot;color: #000000;&quot;&gt;6&lt;/span&gt; juin  &lt;span style=&quot;color: #000000;&quot;&gt;13&lt;/span&gt;:&lt;span style=&quot;color: #000000;&quot;&gt;24&lt;/span&gt; v0.9.0.tar
$ &lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;cd&lt;/span&gt; ..
$ calcul_distance .&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;xinx&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;/&lt;/span&gt;
Step &lt;span style=&quot;color: #000000;&quot;&gt;0&lt;/span&gt; : Create database
Step &lt;span style=&quot;color: #000000;&quot;&gt;1&lt;/span&gt; : Create &lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;file&lt;/span&gt; list
Step &lt;span style=&quot;color: #000000;&quot;&gt;2&lt;/span&gt; : Compress single &lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;file&lt;/span&gt;                                     
Step &lt;span style=&quot;color: #000000;&quot;&gt;3&lt;/span&gt; : Compress pair &lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;file&lt;/span&gt;                                       
$ &lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;ls&lt;/span&gt; 
&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#123;&lt;/span&gt;051b93a0-d9a9-&lt;span style=&quot;color: #000000;&quot;&gt;4778&lt;/span&gt;-ac73-81ee01a3905d&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#125;&lt;/span&gt;.db
xinx
$ sqlite3 &lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#123;&lt;/span&gt;051b93a0-d9a9-&lt;span style=&quot;color: #000000;&quot;&gt;4778&lt;/span&gt;-ac73-81ee01a3905d&lt;span style=&quot;color: #7a0874; font-weight: bold;&quot;&gt;&amp;#125;&lt;/span&gt;.db&lt;/pre&gt;


&lt;p&gt;Nous allons maintenant faire une requête dans la base de données sqlite&amp;nbsp;:&lt;/p&gt;

&lt;pre class=&quot;sql sql&quot; style=&quot;font-family:inherit&quot;&gt;$ &lt;span style=&quot;color: #66cc66;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;TABLES&lt;/span&gt;
distances  files 
$ &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;SELECT&lt;/span&gt; files1&lt;span style=&quot;color: #66cc66;&quot;&gt;.&lt;/span&gt;path&lt;span style=&quot;color: #66cc66;&quot;&gt;,&lt;/span&gt; files2&lt;span style=&quot;color: #66cc66;&quot;&gt;.&lt;/span&gt;path&lt;span style=&quot;color: #66cc66;&quot;&gt;,&lt;/span&gt; distances&lt;span style=&quot;color: #66cc66;&quot;&gt;.&lt;/span&gt;distance &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;FROM&lt;/span&gt; distances&lt;span style=&quot;color: #66cc66;&quot;&gt;,&lt;/span&gt; files files1&lt;span style=&quot;color: #66cc66;&quot;&gt;,&lt;/span&gt; files files2 &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;WHERE&lt;/span&gt; distances&lt;span style=&quot;color: #66cc66;&quot;&gt;.&lt;/span&gt;id1&lt;span style=&quot;color: #66cc66;&quot;&gt;=&lt;/span&gt;files1&lt;span style=&quot;color: #66cc66;&quot;&gt;.&lt;/span&gt;id &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;AND&lt;/span&gt; distances&lt;span style=&quot;color: #66cc66;&quot;&gt;.&lt;/span&gt;id2&lt;span style=&quot;color: #66cc66;&quot;&gt;=&lt;/span&gt;files2&lt;span style=&quot;color: #66cc66;&quot;&gt;.&lt;/span&gt;id &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;ORDER&lt;/span&gt; &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;BY&lt;/span&gt; distance &lt;span style=&quot;color: #993333; font-weight: bold;&quot;&gt;ASC&lt;/span&gt;;&lt;/pre&gt;

&lt;table&gt;
&lt;tr&gt;&lt;th&gt;Version 1&lt;/th&gt;&lt;th&gt;Version 2&lt;/th&gt;&lt;th&gt;Distance&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.8.1&lt;/td&gt;&lt;td&gt;v0.8.1_services&lt;/td&gt;&lt;td&gt;0.0350740694634633&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.8&lt;/td&gt;&lt;td&gt;v0.6.9&lt;/td&gt;&lt;td&gt;0.132275346477201&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.8.0&lt;/td&gt;&lt;td&gt;v0.8.1&lt;/td&gt;&lt;td&gt;0.142321125298336&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.8.0&lt;/td&gt;&lt;td&gt;v0.8.1_services&lt;/td&gt;&lt;td&gt;0.161719318637048&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.5&lt;/td&gt;&lt;td&gt;v0.6.6&lt;/td&gt;&lt;td&gt;0.196933113059686&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.4&lt;/td&gt;&lt;td&gt;v0.6.5&lt;/td&gt;&lt;td&gt;0.231812199675573&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.6&lt;/td&gt;&lt;td&gt;v0.6.7&lt;/td&gt;&lt;td&gt;0.266593999923953&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.10&lt;/td&gt;&lt;td&gt;v0.7.0&lt;/td&gt;&lt;td&gt;0.27412838729727&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.7.2&lt;/td&gt;&lt;td&gt;v0.8.0&lt;/td&gt;&lt;td&gt;0.312111739912996&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.5&lt;/td&gt;&lt;td&gt;v0.6.7&lt;/td&gt;&lt;td&gt;0.351347925829225&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.4&lt;/td&gt;&lt;td&gt;v0.6.6&lt;/td&gt;&lt;td&gt;0.364115163581424&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.7.2&lt;/td&gt;&lt;td&gt;v0.8.1&lt;/td&gt;&lt;td&gt;0.386971922637303&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.7.2&lt;/td&gt;&lt;td&gt;v0.8.1_services&lt;/td&gt;&lt;td&gt;0.401055941017259&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.7.1&lt;/td&gt;&lt;td&gt;v0.7.2&lt;/td&gt;&lt;td&gt;0.436705836223058&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.7.0&lt;/td&gt;&lt;td&gt;v0.7.1&lt;/td&gt;&lt;td&gt;0.465121645779551&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.4&lt;/td&gt;&lt;td&gt;v0.6.7&lt;/td&gt;&lt;td&gt;0.468472350726879&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.8.1_services&lt;/td&gt;&lt;td&gt;v0.9.0&lt;/td&gt;&lt;td&gt;0.516795574578859&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.8.1&lt;/td&gt;&lt;td&gt;v0.9.0&lt;/td&gt;&lt;td&gt;0.51733623689019&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.8.0&lt;/td&gt;&lt;td&gt;v0.9.0&lt;/td&gt;&lt;td&gt;0.544376861655528&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.7&lt;/td&gt;&lt;td&gt;v0.6.8&lt;/td&gt;&lt;td&gt;0.558824765667689&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.7.1&lt;/td&gt;&lt;td&gt;v0.8.0&lt;/td&gt;&lt;td&gt;0.560609480175814&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.10&lt;/td&gt;&lt;td&gt;v0.6.9&lt;/td&gt;&lt;td&gt;0.594036969567445&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.7.1&lt;/td&gt;&lt;td&gt;v0.8.1&lt;/td&gt;&lt;td&gt;0.604226316444666&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.7.1&lt;/td&gt;&lt;td&gt;v0.8.1_services&lt;/td&gt;&lt;td&gt;0.613613062086946&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.7&lt;/td&gt;&lt;td&gt;v0.6.9&lt;/td&gt;&lt;td&gt;0.622950487834501&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.7.0&lt;/td&gt;&lt;td&gt;v0.7.2&lt;/td&gt;&lt;td&gt;0.631060763867616&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.10&lt;/td&gt;&lt;td&gt;v0.7.1&lt;/td&gt;&lt;td&gt;0.632444883185258&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.10&lt;/td&gt;&lt;td&gt;v0.6.8&lt;/td&gt;&lt;td&gt;0.637234847328374&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.6&lt;/td&gt;&lt;td&gt;v0.6.8&lt;/td&gt;&lt;td&gt;0.6494052372746&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.9&lt;/td&gt;&lt;td&gt;v0.7.1&lt;/td&gt;&lt;td&gt;0.666200571812458&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.7.2&lt;/td&gt;&lt;td&gt;v0.9.0&lt;/td&gt;&lt;td&gt;0.678423568871868&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.5&lt;/td&gt;&lt;td&gt;v0.6.8&lt;/td&gt;&lt;td&gt;0.692250570944195&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.8&lt;/td&gt;&lt;td&gt;v0.7.1&lt;/td&gt;&lt;td&gt;0.701063946130892&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.6&lt;/td&gt;&lt;td&gt;v0.6.9&lt;/td&gt;&lt;td&gt;0.701698986545754&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.9&lt;/td&gt;&lt;td&gt;v0.7.0&lt;/td&gt;&lt;td&gt;0.717262408423359&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.7.0&lt;/td&gt;&lt;td&gt;v0.8.0&lt;/td&gt;&lt;td&gt;0.720311680104721&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.5&lt;/td&gt;&lt;td&gt;v0.6.9&lt;/td&gt;&lt;td&gt;0.738013305804084&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.4&lt;/td&gt;&lt;td&gt;v0.6.8&lt;/td&gt;&lt;td&gt;0.747495551539097&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.10&lt;/td&gt;&lt;td&gt;v0.7.2&lt;/td&gt;&lt;td&gt;0.747929200720491&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.8&lt;/td&gt;&lt;td&gt;v0.7.0&lt;/td&gt;&lt;td&gt;0.748031544518325&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.7.0&lt;/td&gt;&lt;td&gt;v0.8.1&lt;/td&gt;&lt;td&gt;0.758510349354368&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.7.0&lt;/td&gt;&lt;td&gt;v0.8.1_services&lt;/td&gt;&lt;td&gt;0.767204482779187&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.4&lt;/td&gt;&lt;td&gt;v0.6.9&lt;/td&gt;&lt;td&gt;0.772451857549627&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.10&lt;/td&gt;&lt;td&gt;v0.8.0&lt;/td&gt;&lt;td&gt;0.796649043913944&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.7.1&lt;/td&gt;&lt;td&gt;v0.9.0&lt;/td&gt;&lt;td&gt;0.801221496333008&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.9&lt;/td&gt;&lt;td&gt;v0.7.2&lt;/td&gt;&lt;td&gt;0.804765901655414&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.8&lt;/td&gt;&lt;td&gt;v0.7.2&lt;/td&gt;&lt;td&gt;0.819917045496318&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.10&lt;/td&gt;&lt;td&gt;v0.8.1&lt;/td&gt;&lt;td&gt;0.823540395867048&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.10&lt;/td&gt;&lt;td&gt;v0.8.1_services&lt;/td&gt;&lt;td&gt;0.831055117394626&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.10&lt;/td&gt;&lt;td&gt;v0.6.7&lt;/td&gt;&lt;td&gt;0.838850951377793&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.9&lt;/td&gt;&lt;td&gt;v0.8.0&lt;/td&gt;&lt;td&gt;0.849001032539087&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.7&lt;/td&gt;&lt;td&gt;v0.7.1&lt;/td&gt;&lt;td&gt;0.853848016623182&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.7.0&lt;/td&gt;&lt;td&gt;v0.9.0&lt;/td&gt;&lt;td&gt;0.860291356912217&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.8&lt;/td&gt;&lt;td&gt;v0.8.0&lt;/td&gt;&lt;td&gt;0.86075956509228&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.10&lt;/td&gt;&lt;td&gt;v0.6.6&lt;/td&gt;&lt;td&gt;0.863340151908353&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.9&lt;/td&gt;&lt;td&gt;v0.8.1&lt;/td&gt;&lt;td&gt;0.872265541006983&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.6&lt;/td&gt;&lt;td&gt;v0.7.1&lt;/td&gt;&lt;td&gt;0.873275579233521&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.10&lt;/td&gt;&lt;td&gt;v0.6.5&lt;/td&gt;&lt;td&gt;0.875332023895544&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.9&lt;/td&gt;&lt;td&gt;v0.8.1_services&lt;/td&gt;&lt;td&gt;0.87987037883801&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.7&lt;/td&gt;&lt;td&gt;v0.7.0&lt;/td&gt;&lt;td&gt;0.879941907871053&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.8&lt;/td&gt;&lt;td&gt;v0.8.1&lt;/td&gt;&lt;td&gt;0.881174812987336&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.5&lt;/td&gt;&lt;td&gt;v0.7.1&lt;/td&gt;&lt;td&gt;0.886172606121206&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.8&lt;/td&gt;&lt;td&gt;v0.8.1_services&lt;/td&gt;&lt;td&gt;0.889515283880001&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.10&lt;/td&gt;&lt;td&gt;v0.6.4&lt;/td&gt;&lt;td&gt;0.892364892140999&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.6&lt;/td&gt;&lt;td&gt;v0.7.0&lt;/td&gt;&lt;td&gt;0.894375709613201&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.10&lt;/td&gt;&lt;td&gt;v0.9.0&lt;/td&gt;&lt;td&gt;0.895694726039398&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.7&lt;/td&gt;&lt;td&gt;v0.7.2&lt;/td&gt;&lt;td&gt;0.898582911617307&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.4&lt;/td&gt;&lt;td&gt;v0.7.1&lt;/td&gt;&lt;td&gt;0.902038058337369&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.5&lt;/td&gt;&lt;td&gt;v0.7.0&lt;/td&gt;&lt;td&gt;0.904821831317442&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.6&lt;/td&gt;&lt;td&gt;v0.7.2&lt;/td&gt;&lt;td&gt;0.910637046476578&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.4&lt;/td&gt;&lt;td&gt;v0.7.0&lt;/td&gt;&lt;td&gt;0.918347943544789&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.5&lt;/td&gt;&lt;td&gt;v0.7.2&lt;/td&gt;&lt;td&gt;0.919716704855963&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.9&lt;/td&gt;&lt;td&gt;v0.9.0&lt;/td&gt;&lt;td&gt;0.921714099772221&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.7&lt;/td&gt;&lt;td&gt;v0.8.0&lt;/td&gt;&lt;td&gt;0.924717744438112&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.8&lt;/td&gt;&lt;td&gt;v0.9.0&lt;/td&gt;&lt;td&gt;0.925849165227404&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.4&lt;/td&gt;&lt;td&gt;v0.7.2&lt;/td&gt;&lt;td&gt;0.928888262611658&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.7&lt;/td&gt;&lt;td&gt;v0.8.1&lt;/td&gt;&lt;td&gt;0.933685479216414&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.6&lt;/td&gt;&lt;td&gt;v0.8.0&lt;/td&gt;&lt;td&gt;0.933940067594635&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.7&lt;/td&gt;&lt;td&gt;v0.8.1_services&lt;/td&gt;&lt;td&gt;0.939898268404416&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.5&lt;/td&gt;&lt;td&gt;v0.8.0&lt;/td&gt;&lt;td&gt;0.940789807767177&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.6&lt;/td&gt;&lt;td&gt;v0.8.1&lt;/td&gt;&lt;td&gt;0.94210246370087&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.6&lt;/td&gt;&lt;td&gt;v0.8.1_services&lt;/td&gt;&lt;td&gt;0.946464528845253&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.4&lt;/td&gt;&lt;td&gt;v0.8.0&lt;/td&gt;&lt;td&gt;0.948830071149278&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.5&lt;/td&gt;&lt;td&gt;v0.8.1&lt;/td&gt;&lt;td&gt;0.94922082772201&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.5&lt;/td&gt;&lt;td&gt;v0.8.1_services&lt;/td&gt;&lt;td&gt;0.951278461132112&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.4&lt;/td&gt;&lt;td&gt;v0.8.1&lt;/td&gt;&lt;td&gt;0.955572468114482&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.4&lt;/td&gt;&lt;td&gt;v0.8.1_services&lt;/td&gt;&lt;td&gt;0.95567206186826&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.7&lt;/td&gt;&lt;td&gt;v0.9.0&lt;/td&gt;&lt;td&gt;0.96084453455483&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.6&lt;/td&gt;&lt;td&gt;v0.9.0&lt;/td&gt;&lt;td&gt;0.964619158469125&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.5&lt;/td&gt;&lt;td&gt;v0.9.0&lt;/td&gt;&lt;td&gt;0.965955795849916&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;v0.6.4&lt;/td&gt;&lt;td&gt;v0.9.0&lt;/td&gt;&lt;td&gt;0.968866861905835&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;



&lt;p&gt;On peut ainsi voir d'après ce tableau, les versions ayant peu de différences et celles qui ont fait des plus gros bonds en avant.&lt;/p&gt;


&lt;p&gt;On voit ainsi qu'il y a plus de différences entre la version 0.8.0 et la 0.9.0, qu'il y en a eu entre la version 0.6.8 et la 0.6.9.
On peut également voir que les versions 0.6.4 et 0.9.0 n'ont plus rien à voir entre elles.&lt;/p&gt;


&lt;p&gt;Vous pouvez télécharger le logiciel attaché à ce billet.&lt;/p&gt;</description>
    
          <enclosure url="http://www.shadoware.org/public/billets/calcul_distance/calcul_distance.7z"
      length="437666" type="text/plain" />
    
    
          <comments>http://www.shadoware.org/post/2010/06/06/Calcul-de-la-Distance#comment-form</comments>
      <wfw:comment>http://www.shadoware.org/post/2010/06/06/Calcul-de-la-Distance#comment-form</wfw:comment>
      <wfw:commentRss>http://www.shadoware.org/feed/atom/comments/625</wfw:commentRss>
      </item>
    
  <item>
    <title>Présentation de XINX</title>
    <link>http://www.shadoware.org/post/2010/01/13/Presentation_XINX</link>
    <guid isPermaLink="false">urn:md5:0edc55e4ed72a6a0c0e21f3ac74a2c19</guid>
    <pubDate>Sun, 02 May 2010 21:55:00 +0200</pubDate>
    <dc:creator>Ulrich Van Den Hekke</dc:creator>
        <category>XINX</category>
        <category>debian</category><category>egx</category><category>generix</category><category>generix group</category><category>libre</category><category>planet</category><category>qt</category><category>stylesheet</category><category>xinx</category><category>xsl</category>    
    <description>&lt;p&gt;Ce billet fait suite à la sortie de la version 0.9.0 de &lt;strong&gt;XINX&lt;/strong&gt; et va vous décrire ce logiciel. &lt;strong&gt;XINX&lt;/strong&gt; est éditeur de feuille de style &lt;em&gt;XSL&lt;/em&gt; (il fait également éditeur &lt;em&gt;JavaScript&lt;/em&gt; et &lt;em&gt;CSS&lt;/em&gt; mais actuellement moins bien que ce que peuvent faire d'autres).&lt;/p&gt;


&lt;p&gt;Il permet l'édition des feuilles de styles en proposant de compléter sur le nom des balises (normal), sur les attributs (normal), sur les valeurs d'attributs&amp;nbsp;: les variables, les paramètres, ... Il propose également automatiquement les différents paramètres lors de l'utilisation d'un &lt;code&gt;call:template&lt;/code&gt;.&lt;/p&gt;


&lt;p&gt;L'éditeur est fortement tourné vers l'édition de feuille de style &lt;em&gt;XSL&lt;/em&gt; pour génération d&lt;em&gt;'HTML&lt;/em&gt; mais peut être utilisé pour générer du &lt;em&gt;XML&lt;/em&gt;.&lt;/p&gt;


&lt;p&gt;&lt;img src=&quot;http://www.shadoware.org/public/billets/xinx/0.9.0/splash.png&quot; alt=&quot;XINX Logo&quot; style=&quot;display:block; margin:0 auto;&quot; title=&quot;XINX Logo, mai 2010&quot; /&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;    &lt;h3&gt;Historique&lt;/h3&gt;


&lt;p&gt;Depuis un certain temps déjà (5 ans), je travaille pour la société &lt;em&gt;Generix Group&lt;/em&gt; éditant et intégrant un ERP&lt;sup&gt;[&lt;a href=&quot;http://www.shadoware.org/post/2010/01/13/Presentation_XINX#pnote-624-1&quot; id=&quot;rev-pnote-624-1&quot;&gt;1&lt;/a&gt;]&lt;/sup&gt; du nom de &lt;em&gt;GCE&lt;/em&gt;.&lt;/p&gt;


&lt;p&gt;Sur la partie Web de cet ERP, il est possible d'intervenir à plusieurs endroits pour modifier son fonctionnement&amp;nbsp;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Le paramétrage (&lt;em&gt;BDD&lt;/em&gt;)&amp;nbsp;: Modification d'un paramètre pour agir sur le comportement du logiciel&lt;/li&gt;
&lt;li&gt;La couche métier (&lt;em&gt;JAVA&lt;/em&gt;)&amp;nbsp;: Lit le paramétrage (&lt;em&gt;BDD&lt;/em&gt;) et réalise les traitements. Il est possible de développer de nouveaux objets, mais aussi de dériver ceux existants.&lt;/li&gt;
&lt;li&gt;La couche de présentation (&lt;em&gt;XSL&lt;/em&gt;)&amp;nbsp;: A l'aide d'un flux de présentation généré par la couche métier et d'un fichier de configuration, présente les données à l'écran.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;La dernière couche est donc l'interprétation d'un flux de donnée, générée à partir de la couche métier (JAVA), à l'aide de feuille de style XSL.&lt;/p&gt;


&lt;p&gt;&lt;strong&gt;XINX&lt;/strong&gt; sert à modifier la couche de présentation (&lt;em&gt;XSL&lt;/em&gt;). Sur cette dernière couche, on crée et modifie des feuilles de styles pour modifier la présentation des données à l'écran (Déplacer des champs, supprimer des champs, ajouter des champs, règle de gestion simple ...).&lt;/p&gt;


&lt;p&gt;En mode &lt;em&gt;projet&lt;/em&gt;, chez les clients, les modifications ne sont pas faites directement sur les feuilles de styles standard livrées, mais sur des feuilles de styles dérivées, afin de faciliter les migrations, et la correction des anomalies.&lt;/p&gt;


&lt;p&gt;&lt;img src=&quot;http://www.shadoware.org/public/billets/xinx/0.9.0/structure_dossier.png&quot; alt=&quot;Structure dossier &amp;lt;= 140&quot; style=&quot;float:right; margin: 0 0 1em 1em;&quot; title=&quot;Structure dossier &amp;lt;= 140, mai 2010&quot; /&gt;&lt;/p&gt;


&lt;p&gt;Lors de la modification de feuille de style &lt;em&gt;standard&lt;/em&gt;, il faut alors renommer et placer ce fichier dans un dossier séparé. C'est de cette tâche récurrente qu'est venue la création de l'éditeur de feuille de style &lt;strong&gt;XINX&lt;/strong&gt;.&lt;/p&gt;


&lt;p&gt;Le but était alors, lors de la sauvegarde d'un fichier standard, de proposer automatiquement la sauvegarde dans le bon dossier.&lt;/p&gt;


&lt;p&gt;L'autre point à l'origine de la création de &lt;strong&gt;XINX&lt;/strong&gt; est la non-existence d'un logiciel de développement de feuille de style &lt;em&gt;XSL&lt;/em&gt; gratuit et/ou libre (Il y a bien &lt;em&gt;XML Spy&lt;/em&gt; qui correspondait à peu prés mais qui était payant, et dont nous n'avions pas la licence).&lt;/p&gt;


&lt;p&gt;Sont alors venu s'ajouter d'autres fonctionnalités&amp;nbsp;: la complétion sur les balises, les attributs, les variables, .... &lt;img src=&quot;/dotclear/themes/default/smilies/smile.png&quot; alt=&quot;:)&quot; class=&quot;smiley&quot; /&gt;&lt;/p&gt;


&lt;h3&gt;Qu'est que XINX aujourd'hui&amp;nbsp;?&lt;/h3&gt;


&lt;p&gt;&lt;strong&gt;XINX&lt;/strong&gt; prévu initialement comme aide au développement des consultants qui font des développements de feuille de style, est maintenant un éditeur de feuille de style &lt;em&gt;XSL&lt;/em&gt; avec gestion des plugins. L'un des plugins contient des petites fonctionnalités utiles au quotidien par les consultants travaillants sur l'ERP, fonctionnalité auparavant implémenté directement dans le logiciel.&lt;/p&gt;


&lt;p&gt;Dit autrement, cette nouvelle version marque donc une étape&amp;nbsp;: La partie de &lt;strong&gt;XINX&lt;/strong&gt; propre à &lt;em&gt;Generix Group&lt;/em&gt; à été séparée dans un plugin. &lt;strong&gt;XINX&lt;/strong&gt; en lui même n'est alors plus qu'un éditeur de feuille de style, extensible via des plugins, mais il retrouve les mêmes fonctionnalités grâce à ce plugin.&lt;/p&gt;


&lt;h3&gt;Licence&lt;/h3&gt;


&lt;p&gt;&lt;img src=&quot;http://www.gnu.org/graphics/gplv3-127x51.png&quot; alt=&quot;&quot; style=&quot;float:right; margin: 0 0 1em 1em;&quot; /&gt;&lt;/p&gt;


&lt;p&gt;&lt;strong&gt;XINX&lt;/strong&gt; est un logiciel libre dont la licence choisie est la GPLv3. Ce qui signifie que vous pouvez&amp;nbsp;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;télécharger le logiciel&lt;/li&gt;
&lt;li&gt;utiliser le logiciel pour faire ce que vous voulez&lt;/li&gt;
&lt;li&gt;télécharger les sources du logiciels&lt;/li&gt;
&lt;li&gt;modifier les sources du logiciels&lt;/li&gt;
&lt;li&gt;utiliser le logiciel modifié par vos soins&lt;/li&gt;
&lt;li&gt;distribuer le logiciel ou la version modifiée (attention à différencier les parties originales du logiciel avec le bon copyright, et les parties modifiées).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;En tant que logiciel libre &lt;strong&gt;XINX&lt;/strong&gt; possède une plateforme de contribution (ticket, wiki, source, ...) qui se trouve à l'adresse &lt;a href=&quot;http://xinx.shadoware.org&quot; hreflang=&quot;fr&quot;&gt;http://xinx.shadoware.org&lt;/a&gt;. Vous pouvez donc y aller pour contribuer.&lt;/p&gt;


&lt;p&gt;Vous pouvez contribuer de plusieurs façons&amp;nbsp;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Développement d'un Plugin&lt;/li&gt;
&lt;li&gt;Développement d'un script &lt;em&gt;ECMAScript&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;Développement d'un petit patch&lt;/li&gt;
&lt;li&gt;Développement d'un gros patch&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Technologie&lt;/h3&gt;


&lt;p&gt;&lt;strong&gt;XINX&lt;/strong&gt; est un logiciel développé en &lt;em&gt;Qt&lt;/em&gt;. Il compile et tourne sous &lt;em&gt;Gnu/Debian&lt;/em&gt; (normalement n'importe quelle distribution devrait faire l'affaire, mais &lt;em&gt;Gnu/Debian&lt;/em&gt; est la seule distribution testée), et sous &lt;em&gt;MS/Windows&lt;/em&gt;. Il devrait normalement également tourner sous &lt;em&gt;MacOS&lt;/em&gt; (si les dépendances comme les librairies &lt;em&gt;libxml2&lt;/em&gt; et &lt;em&gt;libxslt&lt;/em&gt; sont compilables sous cet OS).&lt;/p&gt;


&lt;p&gt;A chaque version un paquet &lt;em&gt;Gnu/Debian&lt;/em&gt; est mis à disposition sur le dépôt (&lt;code&gt;apt.shadoware.org&lt;/code&gt;) et un binaire &lt;em&gt;MS/Windows&lt;/em&gt; est proposé en téléchargement. &lt;strong&gt;XINX&lt;/strong&gt; est toujours compilable à partir des sources pour les autres distributions ou juste parce que vous préférez ainsi. :D&lt;/p&gt;


&lt;h3&gt;Intégration continue &amp;amp; Tests&lt;/h3&gt;


&lt;p&gt;A chaque &lt;em&gt;validation&lt;/em&gt; sur le référenciel &lt;em&gt;SubVersion&lt;/em&gt;, l'application est compilée et testée (vous pouvez voir le résultat des tests à l'adresse &lt;a href=&quot;http://xinx.shadoware.org/build&quot; hreflang=&quot;fr&quot;&gt;suivante&lt;/a&gt;. A la sortie de la version 0.9.0, les tests couvrent 27% de la librairie principale. Je dois donc encore écrire d'autres jeux de tests.&lt;/p&gt;


&lt;p&gt;&lt;img src=&quot;http://www.shadoware.org/public/billets/xinx/0.9.0/.bitten_m.jpg&quot; alt=&quot;Intégration continue&quot; style=&quot;display:block; margin:0 auto;&quot; title=&quot;Intégration continue, mai 2010&quot; /&gt;&lt;/p&gt;


&lt;h3&gt;Code réutilisable pour d'autres projets&lt;/h3&gt;


&lt;p&gt;&lt;strong&gt;XINX&lt;/strong&gt; peut également être intéressant pour d'autres développeurs &lt;em&gt;Qt&lt;/em&gt;.&lt;/p&gt;


&lt;p&gt;En effet, vous pouvez trouver dans la dernière version, ainsi que dans les versions précédentes plusieurs classes utilitaires.
Par exemple (liste presque non exhaustive)&amp;nbsp;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://xinx.shadoware.org/doxygen/devel/html/classTreeProxyItemModel.html&quot; hreflang=&quot;en&quot;&gt;TreeProxyItemModel&lt;/a&gt;&amp;nbsp;: convertit un modèle format table en modèle format arbre. Utile lorsque l'arbre est représenté dans une base de donnée relationnelle par exemple.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://xinx.shadoware.org/doxygen/devel/html/classRecursiveSortFilterProxyModel.html&quot; hreflang=&quot;en&quot;&gt;RecursiveSortFilterProxyModel&lt;/a&gt;&amp;nbsp;: Utilisé pour rechercher facilement des données dans un arbre et permet d'afficher les enfants.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://xinx.shadoware.org/doxygen/devel/html/classXinxLineEdit.html&quot; hreflang=&quot;en&quot;&gt;XinxLineEdit&lt;/a&gt;&amp;nbsp;: Inspiré de KDE, affiche un bouton pour effacer le texte dans la ligne d'édition&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://xinx.shadoware.org/doxygen/devel/html/classXinxListWidgetImpl.html&quot; hreflang=&quot;en&quot;&gt;XinxListWidgetImpl&lt;/a&gt;&amp;nbsp;: Permet de modifier une liste de valeur (ajout, suppression, valeur par défaut, classement, ...)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://xinx.shadoware.org/doxygen/devel/html/classPluginSelector.html&quot; hreflang=&quot;en&quot;&gt;PluginSelector&lt;/a&gt;&amp;nbsp;: Inspiré de KDE, permet d'afficher une liste des plugins, avec un bouton &lt;em&gt;A propos de ...&lt;/em&gt; et un bouton &lt;em&gt;Configurer ...&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://xinx.shadoware.org/doxygen/devel/html/classQMenuView.html&quot; hreflang=&quot;en&quot;&gt;QMenuView&lt;/a&gt;&amp;nbsp;: Inspiré d'un exemple de Qt et permet d'afficher un menu à partir d'un modèle.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Fonctionnalités&lt;/h3&gt;


&lt;h4&gt;Recherche parmi les fichiers d'un dossier&lt;/h4&gt;


&lt;p&gt;Un dock sur le coté permet en mode projet de rechercher et d'ouvrir un fichier parmi une multitude de fichier d'un projet (utile pour les fichiers avec beaucoup de feuille de style).&lt;/p&gt;


&lt;p&gt;La recherche peut se faire avec des Jockers (*)&lt;/p&gt;


&lt;p&gt;&lt;img src=&quot;http://www.shadoware.org/public/billets/xinx/0.9.0/dockprojet.png&quot; alt=&quot;Dock projet&quot; style=&quot;display:block; margin:0 auto;&quot; title=&quot;Dock projet, mai 2010&quot; /&gt;&lt;/p&gt;


&lt;h4&gt;La complétion XSL&lt;/h4&gt;


&lt;p&gt;&lt;img src=&quot;http://www.shadoware.org/public/billets/xinx/0.9.0/.completion_s.jpg&quot; alt=&quot;Completion&quot; style=&quot;float:right; margin: 0 0 1em 1em;&quot; title=&quot;Completion, mai 2010&quot; /&gt;&lt;/p&gt;


&lt;p&gt;&lt;strong&gt;XINX&lt;/strong&gt; permet  de compléter sur les feuilles de styles à plusieurs niveaux&lt;sup&gt;[&lt;a href=&quot;http://www.shadoware.org/post/2010/01/13/Presentation_XINX#pnote-624-2&quot; id=&quot;rev-pnote-624-2&quot;&gt;2&lt;/a&gt;]&lt;/sup&gt;&amp;nbsp;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;la balise (fonctionnalité standard vous allez me dire)&amp;nbsp;: &lt;strong&gt;XINX&lt;/strong&gt; permet de compléter sur les balises xsl:, les balises html ...&lt;/li&gt;
&lt;li&gt;les attributs (encore standard). Pour chaque balise, &lt;strong&gt;XINX&lt;/strong&gt; est capable de compléter sur les attributs de la balise saisie.&lt;/li&gt;
&lt;li&gt;les valeurs d'attribut (là c'est intéressant). Permet de compléter sur les variables déclarées dans le fichier &lt;em&gt;XSL&lt;/em&gt;, ainsi que dans les fichiers importés (pour retrouver les fichiers importés, &lt;strong&gt;XINX&lt;/strong&gt;, utilise le mode projet et les paramètres qui y sont définits). De plus sur les attributs non &lt;em&gt;XSL&lt;/em&gt;, &lt;strong&gt;XINX&lt;/strong&gt; ajoute automatiquement les accolades &lt;code&gt;{  }&lt;/code&gt; et les &lt;code&gt;$&lt;/code&gt; pour les variables et les paramètres.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;De plus lors de l'utilisation de la balise call:template, &lt;strong&gt;XINX&lt;/strong&gt; va chercher automatiquement les paramètres (&lt;code&gt;xsl:param&lt;/code&gt;) du template donné, et les ajoute automatiquement en &lt;code&gt;xsl:with-param&lt;/code&gt;.
Pour les balises &lt;code&gt;xsl:apply-templates&lt;/code&gt; &lt;strong&gt;XINX&lt;/strong&gt; propose la liste des modes des templates existants.&lt;/p&gt;


&lt;p&gt;&lt;img src=&quot;http://www.shadoware.org/public/billets/xinx/0.9.0/completion2.png&quot; alt=&quot;Completion 2&quot; style=&quot;display:block; margin:0 auto;&quot; title=&quot;Completion 2, mai 2010&quot; /&gt;&lt;/p&gt;


&lt;h4&gt;Le parsing de la feuille de style&lt;/h4&gt;


&lt;p&gt;Fonctionnalité du moment, si vous indiquez un flux de données et une feuille de style, &lt;strong&gt;XINX&lt;/strong&gt; est capable d'afficher le résultat (la source &lt;em&gt;HTML&lt;/em&gt; et le résultat dans un navigateur Webkit)&lt;/p&gt;


&lt;p&gt;Si l'emplacement où doivent s'exécuter les pages est définit alors, les feuilles de styles, les images, ... pourront être affichées.&lt;/p&gt;


&lt;p&gt;&lt;img src=&quot;http://www.shadoware.org/public/billets/xinx/0.9.0/.representation_html_m.jpg&quot; alt=&quot;Représentation HTML&quot; style=&quot;display:block; margin:0 auto;&quot; title=&quot;Représentation HTML, mai 2010&quot; /&gt;&lt;/p&gt;


&lt;h3&gt;A venir&lt;/h3&gt;


&lt;p&gt;Bien que l'avenir du logiciel dépend de ces utilisateurs, voici les nouvelles fonctionnalités que devrait apporter la prochaine version&amp;nbsp;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Déverminage de feuille de style XSL&lt;/li&gt;
&lt;li&gt;Amélioration du parseur JavaScript et CSS&lt;/li&gt;
&lt;li&gt;Quelques réécritures (Vue projet, ...)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Le plugin GCE&lt;/h3&gt;


&lt;p&gt;Comme indiqué ci-dessous, il existe un plugin &lt;em&gt;GCE&lt;/em&gt; utilisé par les consultants travaillants sur l'ERP &lt;em&gt;GCE&lt;/em&gt;.&lt;/p&gt;


&lt;p&gt;Ce plugin permet de dupliquer une feuille de style d'un dossier à un autre (sans modification des fichiers standards), de lire les dictionnaires de libellé de l'ERP GCE, la lecture du fichier de configuration du lecteur &lt;em&gt;GCE&lt;/em&gt;.&lt;/p&gt;


&lt;p&gt;&lt;img src=&quot;http://www.shadoware.org/public/billets/xinx/0.9.0/.derivation_m.jpg&quot; alt=&quot;Dérivation de feuille de style&quot; style=&quot;display:block; margin:0 auto;&quot; title=&quot;Dérivation de feuille de style, mai 2010&quot; /&gt;&lt;/p&gt;


&lt;h3&gt;Téléchargement&lt;/h3&gt;


&lt;p&gt;Vous pouvez télécharger &lt;strong&gt;XINX&lt;/strong&gt; à l'adresse &lt;a href=&quot;http://xinx.shadoware.org/downloads&quot; hreflang=&quot;fr&quot;&gt;http://xinx.shadoware.org/downloads&lt;/a&gt; (source et version Windows).&lt;/p&gt;


&lt;p&gt;Si vous voulez installer &lt;strong&gt;XINX&lt;/strong&gt; sur une Gnu/Debian (32 ou 64 bits) vous pouvez inclure le dépôt suivant&amp;nbsp;:&lt;/p&gt;

&lt;pre&gt;
# Shadoware.Org
deb http://apt.shadoware.org/ squeeze main
&lt;/pre&gt;


&lt;p&gt;Et installé de la façon suivante&amp;nbsp;:&lt;/p&gt;

&lt;pre class=&quot;bash bash&quot; style=&quot;font-family:inherit&quot;&gt;&lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;aptitude&lt;/span&gt; &lt;span style=&quot;color: #c20cb9; font-weight: bold;&quot;&gt;install&lt;/span&gt; xinx&lt;/pre&gt;


&lt;p&gt;Vous pouvez vous tenir au courant des sorties de version grâce à la &lt;a href=&quot;http://lists.shadoware.org/listinfo/xinx&quot; hreflang=&quot;fr&quot;&gt;mailing list&lt;/a&gt;&lt;/p&gt;
&lt;div class=&quot;footnotes&quot;&gt;&lt;h4&gt;Notes&lt;/h4&gt;
&lt;p&gt;[&lt;a href=&quot;http://www.shadoware.org/post/2010/01/13/Presentation_XINX#rev-pnote-624-1&quot; id=&quot;pnote-624-1&quot;&gt;1&lt;/a&gt;] Un ERP et un logiciel de gestion d'entreprise. Un ERP permet de gérer, par exemple, les produits, les clients, les fournisseurs, les stocks, les ventes, les achats, la logistique, la comptabilité, .... Je ne vais pas vous faire une présentation des ERPs, car même si cela pourrait faire un billet intéressant, ce n'est pas le but ici.&lt;/p&gt;
&lt;p&gt;[&lt;a href=&quot;http://www.shadoware.org/post/2010/01/13/Presentation_XINX#rev-pnote-624-2&quot; id=&quot;pnote-624-2&quot;&gt;2&lt;/a&gt;] Merci à &lt;a href=&quot;http://qcodeedit.edyuk.org/&quot; hreflang=&quot;en&quot;&gt;QCodeEdit&lt;/a&gt; qui me fournit quelques fonctionnalités utiles.&lt;/p&gt;&lt;/div&gt;
</description>
    
    
    
          <comments>http://www.shadoware.org/post/2010/01/13/Presentation_XINX#comment-form</comments>
      <wfw:comment>http://www.shadoware.org/post/2010/01/13/Presentation_XINX#comment-form</wfw:comment>
      <wfw:commentRss>http://www.shadoware.org/feed/atom/comments/624</wfw:commentRss>
      </item>
    
  <item>
    <title>[Qt] Transformation d'une vue tableau en une vue hiérarchique</title>
    <link>http://www.shadoware.org/post/2009/09/10/%5BQt%5D-Transformation-d-une-vue-tableau-en-une-vue-hi%C3%A9rarchique</link>
    <guid isPermaLink="false">urn:md5:a2b92942f5d31facf73b6df365c09893</guid>
    <pubDate>Mon, 21 Sep 2009 13:50:00 +0200</pubDate>
    <dc:creator>Ulrich Van Den Hekke</dc:creator>
        <category>C++</category>
        <category>article</category><category>libre</category><category>model</category><category>nokia</category><category>planet</category><category>qt</category><category>trolltech</category>    
    <description>&lt;p&gt;Pour visualiser des données internes à l'écran, Nokia/Qt nous propose l'architecture MVC à l'aide des classes QAbstractItemModel et de ses sous classes (QAbstractListModel, QAbstractTableModel, ...). Le but de l'architecture MVC est de séparer la représentation mémoire des données, de l'affichage qu'elles auront.&lt;/p&gt;


&lt;p&gt;&lt;img src=&quot;http://www.shadoware.org/public/billets/qt/table2tree/mvc1.png&quot; alt=&quot;mvc1.png&quot; style=&quot;display:block; margin:0 auto;&quot; title=&quot;mvc1.png, sept. 2009&quot; /&gt;&lt;/p&gt;


&lt;p&gt;Si les données sont par exemple issue d'une requête SQL, le modèle QSqlQueryModel permet de représenter la sélection SQL, à l'écran dans un composant QTableView. Ces données sont alors représentées sous forme d'un tableau deux dimensions.&lt;/p&gt;


&lt;p&gt;&lt;img src=&quot;http://www.shadoware.org/public/billets/qt/table2tree/tableau.png&quot; alt=&quot;tableau.png&quot; style=&quot;display:block; margin:0 auto;&quot; title=&quot;tableau.png, sept. 2009&quot; /&gt;&lt;/p&gt;


&lt;p&gt;Si l'on veut représenter les dossiers de l'ordinateur, le modèle QDirView permet d'afficher les données de façon hiérarchique.&lt;/p&gt;


&lt;p&gt;&lt;img src=&quot;http://www.shadoware.org/public/billets/qt/table2tree/qdirview.png&quot; alt=&quot;qdirview.png&quot; style=&quot;display:block; margin:0 auto;&quot; title=&quot;qdirview.png, sept. 2009&quot; /&gt;&lt;/p&gt;


&lt;p&gt;Il est également possible d'écrire nos propres modèles pour représenter nos propres données.&lt;/p&gt;


&lt;p&gt;Le but de cet article est de présenter l'écriture d'un modèle, transformant une vue plane (tableau deux dimensions) en vue hiérarchique. Pour cela nous allons prendre l'exemple de l'affichage d'une liste de catégorie&lt;sup&gt;[&lt;a href=&quot;http://www.shadoware.org/post/2009/09/10/%5BQt%5D-Transformation-d-une-vue-tableau-en-une-vue-hi%C3%A9rarchique#pnote-623-1&quot; id=&quot;rev-pnote-623-1&quot;&gt;1&lt;/a&gt;]&lt;/sup&gt;.&lt;/p&gt;
&lt;div class=&quot;footnotes&quot;&gt;&lt;h4&gt;Notes&lt;/h4&gt;
&lt;p&gt;[&lt;a href=&quot;http://www.shadoware.org/post/2009/09/10/%5BQt%5D-Transformation-d-une-vue-tableau-en-une-vue-hi%C3%A9rarchique#rev-pnote-623-1&quot; id=&quot;pnote-623-1&quot;&gt;1&lt;/a&gt;] La construction de notre objet s'est basé sur l'analyse de l'objet QSortFilterProxyModel de Nokia.&lt;/p&gt;&lt;/div&gt;
    &lt;h3&gt;Présentation de l'exemple&lt;/h3&gt;


&lt;p&gt;Nous allons voir ci-dessous comment transformer une vue plane en une vue hiérarchique. Pour cela nous allons prendre l'exemple d'une liste de catégorie. Ces catégories seront stockées dans une base de données Sqlite. Ceci n'a pas d'importance mais permet d'expliquer pourquoi les données en mémoire ne sont pas déjà sous forme hiérarchique.&lt;/p&gt;


&lt;p&gt;&lt;img src=&quot;http://www.shadoware.org/public/billets/qt/table2tree/proxymodel.png&quot; alt=&quot;proxymodel.png&quot; style=&quot;display:block; margin:0 auto;&quot; title=&quot;proxymodel.png, sept. 2009&quot; /&gt;&lt;/p&gt;


&lt;p&gt;La description d'une catégorie passe donc par&amp;nbsp;:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;un identifiant unique appelé &lt;em&gt;id&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;un nom de catégorie&lt;/li&gt;
&lt;li&gt;un lien vers la catégorie parente appelé &lt;em&gt;parent_id&lt;/em&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;C'est le champ &lt;em&gt;parent_id&lt;/em&gt; qui permettra de déterminer dans quelle catégorie notre sous-catégorie se trouve. Dans notre cas, &lt;em&gt;test3&lt;/em&gt; a comme &lt;em&gt;parent_id&lt;/em&gt; l'identifiant 11 qui est la catégorie &lt;em&gt;test&lt;/em&gt;.&lt;/p&gt;


&lt;p&gt;Dans notre exemple, nous allons nous conditionner à un modèle en lecture seul. Il est également possible de faire un modèle en lecture/écriture mais nous n'en parlerons pas dans cet article. Nous nous cantonnerons donc à un modèle lecture seul sur un modèle source de type &lt;em&gt;QSqlTableView&lt;/em&gt;. (Un modèle en lecture/écriture peut nécessiter de mettre à jour notre structure, ce qui peut être assez compliqué, par exemple en cas de changement de la catégorie parente).&lt;/p&gt;


&lt;h3&gt;Déclaration d'un modèle&lt;/h3&gt;


&lt;h4&gt;Qu'est qu'un proxy&amp;nbsp;?&lt;/h4&gt;


&lt;p&gt;Notre interface se basera sur la classe &lt;em&gt;QAbstractProxyModel&lt;/em&gt;. Le but de cette classe est de permettre de faire une transposition entre un premier modèle et une vue. Elle peut par exemple (à l'aide de &lt;em&gt;QSortFilterProxyModel&lt;/em&gt;) permettre de filtrer ou trier les données d'une vue.&lt;/p&gt;


&lt;p&gt;&lt;img src=&quot;http://www.shadoware.org/public/billets/qt/table2tree/mvc.png&quot; alt=&quot;mvc.png&quot; style=&quot;display:block; margin:0 auto;&quot; title=&quot;mvc.png, sept. 2009&quot; /&gt;&lt;/p&gt;


&lt;p&gt;Cette vue nous permettra de faire la transposition entre un modèle tableau et une vue arborescente.&lt;/p&gt;


&lt;h4&gt;Interface du proxy&lt;/h4&gt;


&lt;p&gt;Les méthodes à ré-implémenter pour faire fonctionner une proxy, sont les suivantes&amp;nbsp;:&lt;/p&gt;

&lt;pre class=&quot;c c&quot; style=&quot;font-family:inherit&quot;&gt;virtual QModelIndex index&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #993333;&quot;&gt;int&lt;/span&gt; row&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #993333;&quot;&gt;int&lt;/span&gt; column&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #993333;&quot;&gt;const&lt;/span&gt; QModelIndex &lt;span style=&quot;color: #339933;&quot;&gt;&amp;amp;&lt;/span&gt; parent &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #993333;&quot;&gt;const&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
virtual QModelIndex parent&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #993333;&quot;&gt;const&lt;/span&gt; QModelIndex &lt;span style=&quot;color: #339933;&quot;&gt;&amp;amp;&lt;/span&gt; index &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #993333;&quot;&gt;const&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
virtual &lt;span style=&quot;color: #993333;&quot;&gt;int&lt;/span&gt; rowCount&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #993333;&quot;&gt;const&lt;/span&gt; QModelIndex &lt;span style=&quot;color: #339933;&quot;&gt;&amp;amp;&lt;/span&gt; parent &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; QModelIndex&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #993333;&quot;&gt;const&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
virtual &lt;span style=&quot;color: #993333;&quot;&gt;int&lt;/span&gt; columnCount&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #993333;&quot;&gt;const&lt;/span&gt; QModelIndex &lt;span style=&quot;color: #339933;&quot;&gt;&amp;amp;&lt;/span&gt; parent &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; QModelIndex&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #993333;&quot;&gt;const&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
virtual QModelIndex mapFromSource &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #993333;&quot;&gt;const&lt;/span&gt; QModelIndex &lt;span style=&quot;color: #339933;&quot;&gt;&amp;amp;&lt;/span&gt; sourceIndex &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #993333;&quot;&gt;const&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
virtual QModelIndex mapToSource &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #993333;&quot;&gt;const&lt;/span&gt; QModelIndex &lt;span style=&quot;color: #339933;&quot;&gt;&amp;amp;&lt;/span&gt; proxyIndex &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #993333;&quot;&gt;const&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;


&lt;p&gt;Les quatre premières méthodes appartiennent à l'objet &lt;em&gt;QAbstractItemModel&lt;/em&gt; et seront questionnées par la vue (liste, arbre, …) pour connaître la représentation à l'écran.&lt;/p&gt;


&lt;p&gt;Les méthodes &lt;em&gt;mapFromSource()&lt;/em&gt;, et &lt;em&gt;mapToSource()&lt;/em&gt; sont à implémenter pour l'objet &lt;em&gt;QAbstractProxyModel&lt;/em&gt;. Elles permettent de faire la liaison entre les indexes (&lt;em&gt;QModelIndex&lt;/em&gt;) du modèle d'origine et les indexes du nouveau modèle.&lt;/p&gt;


&lt;p&gt;Les méthodes &lt;em&gt;data()&lt;/em&gt;, &lt;em&gt;headerData()&lt;/em&gt;, &lt;em&gt;flags()&lt;/em&gt; sont réimplémentées par l'objet &lt;em&gt;QAbstractProxyModel&lt;/em&gt; et utilisent les méthodes &lt;em&gt;mapFromSource()&lt;/em&gt; et &lt;em&gt;mapToSource()&lt;/em&gt; pour, lors de l'appel d'une de ces méthodes, récupérer les informations stockées sur le modèle d'origine.&lt;/p&gt;


&lt;p&gt;Des méthodes &lt;em&gt;sourceModel()&lt;/em&gt; et &lt;em&gt;setSourceModel()&lt;/em&gt; permettent de spécifier le modèle d'origine.&lt;/p&gt;


&lt;h3&gt;Implémentation de notre modèle&lt;/h3&gt;


&lt;h4&gt;Structure interne&lt;/h4&gt;


&lt;p&gt;Nous allons, dans cette partie, parler de la structure interne utilisée par notre objet.&lt;/p&gt;

&lt;pre class=&quot;c c&quot; style=&quot;font-family:inherit&quot;&gt;&lt;span style=&quot;color: #993333;&quot;&gt;struct&lt;/span&gt; Mapping &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;
	&lt;span style=&quot;color: #993333;&quot;&gt;int&lt;/span&gt; id&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; parrentId&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
	&lt;span style=&quot;color: #993333;&quot;&gt;int&lt;/span&gt; index&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; parentIndex&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
	QVector&lt;span style=&quot;color: #339933;&quot;&gt;&amp;lt;&lt;/span&gt;int&lt;span style=&quot;color: #339933;&quot;&gt;&amp;gt;&lt;/span&gt; source_rows&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: #993333;&quot;&gt;typedef&lt;/span&gt; QMap&lt;span style=&quot;color: #339933;&quot;&gt;&amp;lt;&lt;/span&gt;int&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;Mapping&lt;span style=&quot;color: #339933;&quot;&gt;*&amp;gt;&lt;/span&gt; IndexMap&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
IndexMap m_sourcesIndexMapping&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
QHash&lt;span style=&quot;color: #339933;&quot;&gt;&amp;lt;&lt;/span&gt;int&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt;int&lt;span style=&quot;color: #339933;&quot;&gt;&amp;gt;&lt;/span&gt; m_categoryIdMapping&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;


&lt;p&gt;Nous allons créer une structure &lt;em&gt;Mapping&lt;/em&gt; qui associera pour une ligne dans le modèle source, les informations concernant&amp;nbsp;:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;l'identifiant de la ligne.&lt;/li&gt;
&lt;li&gt;l'identifiant de la ligne parente.&lt;/li&gt;
&lt;li&gt;l'index dans  le modèle source.&lt;/li&gt;
&lt;li&gt;l'index du parent dans le modèle source.&lt;/li&gt;
&lt;li&gt;la liste des indexes dans le modèle source des enfants dans notre modèle.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Une table de hashage permettra de retrouver à partir d'un identifiant (id), la ligne dans le modèle source correspondante. On ne gardera que la seconde colonne (le nom de la catégorie), on ne fera donc l'association qu'entre le nom de la colonne de notre modèle et le modèle source en dure dans le programme.&lt;/p&gt;


&lt;h4&gt;createMapping()&lt;/h4&gt;


&lt;p&gt;Le but de cette méthode est de générer l'arborescence qui sera ensuite utilisée dans la suite des méthodes. Cette arborescence étant générée une fois pour toute (ou à chaque fois que le modèle source sera réinitialisé), il faudra parcourir l'ensemble des lignes du modèle source pour construire notre arbre. Parcourir l'ensemble des lignes du modèle source peut prendre du temps si ce dernier contient beaucoup de ligne.&lt;/p&gt;


&lt;p&gt;Nous allons considérer dans la suite, que l'identifiant de ligne 1 (id) correspond à la catégorie de plus haut niveau (ci-dessus du nom de &lt;em&gt;Categories&lt;/em&gt;). Nous allons créer une catégorie fictive 0 qui correspondra à la racine de notre modèle. Cette catégorie sera donc la catégorie parente de celle à l'identifiant 1.
Dans notre modèle source, la catégorie 0 n'a pas d'équivalence parmi les lignes du modèle source. Nous allons donc lui associer la ligne -1 dans le modèle source.&lt;/p&gt;


&lt;p&gt;Maintenant voyons la génération de la structure interne.&lt;/p&gt;

&lt;pre class=&quot;c c&quot; style=&quot;font-family:inherit&quot;&gt;qDeleteAll&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; m_sourcesIndexMapping &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
m_sourcesIndexMapping.&lt;span style=&quot;color: #202020;&quot;&gt;clear&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
m_categoryIdMapping.&lt;span style=&quot;color: #202020;&quot;&gt;clear&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;


&lt;p&gt;Nous commençons ci-dessous par nettoyer les différentes structures afin de les régénérer. Il faudra à la suite de la création du mapping appeler la méthode &lt;em&gt;reset()&lt;/em&gt; afin de prévenir la vue que l'ensemble des indexes du modèle sont obsolètes.&lt;/p&gt;

&lt;pre class=&quot;c c&quot; style=&quot;font-family:inherit&quot;&gt;&lt;span style=&quot;color: #993333;&quot;&gt;int&lt;/span&gt; source_rows &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; m_sourceModel&lt;span style=&quot;color: #339933;&quot;&gt;-&amp;gt;&lt;/span&gt;rowCount&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: #b1b100;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #993333;&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #0000dd;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt; i &lt;span style=&quot;color: #339933;&quot;&gt;&amp;lt;&lt;/span&gt; source_rows&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;++&lt;/span&gt;i &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;
	Mapping &lt;span style=&quot;color: #339933;&quot;&gt;*&lt;/span&gt; m &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; new Mapping&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
	IndexMap&lt;span style=&quot;color: #339933;&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color: #202020;&quot;&gt;const_iterator&lt;/span&gt; it &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; IndexMap&lt;span style=&quot;color: #339933;&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color: #202020;&quot;&gt;const_iterator&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; m_sourcesIndexMapping.&lt;span style=&quot;color: #202020;&quot;&gt;insert&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; i&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; m &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
	m&lt;span style=&quot;color: #339933;&quot;&gt;-&amp;gt;&lt;/span&gt;index &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; i&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
	m&lt;span style=&quot;color: #339933;&quot;&gt;-&amp;gt;&lt;/span&gt;parrentId &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000dd;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
	m&lt;span style=&quot;color: #339933;&quot;&gt;-&amp;gt;&lt;/span&gt;parentIndex &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000dd;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
	&lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; i &lt;span style=&quot;color: #339933;&quot;&gt;&amp;gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000dd;&quot;&gt;0&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;
		QSqlRecord record &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; m_sourceModel&lt;span style=&quot;color: #339933;&quot;&gt;-&amp;gt;&lt;/span&gt;record&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; i &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
		m_categoryIdMapping&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt; record.&lt;span style=&quot;color: #202020;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; list_id &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #202020;&quot;&gt;toInt&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; i&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
		m&lt;span style=&quot;color: #339933;&quot;&gt;-&amp;gt;&lt;/span&gt;id &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; record.&lt;span style=&quot;color: #202020;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; list_id &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #202020;&quot;&gt;toInt&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
	&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt; &lt;span style=&quot;color: #b1b100;&quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt; &lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;// Create the root Item&lt;/span&gt;
		m&lt;span style=&quot;color: #339933;&quot;&gt;-&amp;gt;&lt;/span&gt;id &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000dd;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
		m_categoryIdMapping&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#91;&lt;/span&gt; &lt;span style=&quot;color: #0000dd;&quot;&gt;0&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #0000dd;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
	&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;


&lt;p&gt;Nous récupérons le nombre de ligne dans le modèle source et commençons à initialiser notre structure. Le but de cette boucle est surtout d'initialiser dans notre correspondance identifiant/index (&lt;em&gt;m_categoryIdMapping&lt;/em&gt;), l'emplacement des identifiants dans notre tableau. Ainsi dans la suite lorsque l'on essaiera d'associer une ligne à son parent, nous pourrons savoir à quel emplacement retrouver notre id dans la structure &lt;em&gt;m_sourcesIndexMapping&lt;/em&gt;.&lt;/p&gt;


&lt;p&gt;Nous profitons également de cette boucle pour initialiser les différents champs de notre structure comme l'index (qui correspond à la ligne dans le modèle source), et l'id qui correspond à un identifiant unique dans notre liste.&lt;/p&gt;


&lt;p&gt;Nous n'oublions pas notre cas particulier que représente notre racine (ligne source -1 inexistante).&lt;/p&gt;

&lt;pre class=&quot;c c&quot; style=&quot;font-family:inherit&quot;&gt;&lt;span style=&quot;color: #b1b100;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #993333;&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #0000dd;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt; i &lt;span style=&quot;color: #339933;&quot;&gt;&amp;lt;&lt;/span&gt; source_rows&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;++&lt;/span&gt;i &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;
	QSqlRecord record &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; m_sourceModel&lt;span style=&quot;color: #339933;&quot;&gt;-&amp;gt;&lt;/span&gt;record&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; i &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
	&lt;span style=&quot;color: #993333;&quot;&gt;int&lt;/span&gt; parentCategoryId &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; record.&lt;span style=&quot;color: #202020;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; list_parentid &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #202020;&quot;&gt;toInt&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
	&lt;span style=&quot;color: #993333;&quot;&gt;int&lt;/span&gt; parentCategoryIndex &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; m_categoryIdMapping.&lt;span style=&quot;color: #202020;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; parentCategoryId&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #0000dd;&quot;&gt;2&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
	Q_ASSERT&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; parentCategoryIndex &lt;span style=&quot;color: #339933;&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #0000dd;&quot;&gt;2&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
	Mapping &lt;span style=&quot;color: #339933;&quot;&gt;*&lt;/span&gt; mapping &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; m_sourcesIndexMapping.&lt;span style=&quot;color: #202020;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; i &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
	mapping&lt;span style=&quot;color: #339933;&quot;&gt;-&amp;gt;&lt;/span&gt;parentIndex &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; parentCategoryIndex&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
	mapping&lt;span style=&quot;color: #339933;&quot;&gt;-&amp;gt;&lt;/span&gt;parrentId   &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; parentCategoryId&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
	Mapping &lt;span style=&quot;color: #339933;&quot;&gt;*&lt;/span&gt; categoryMapping &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; m_sourcesIndexMapping.&lt;span style=&quot;color: #202020;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; parentCategoryIndex &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
	categoryMapping&lt;span style=&quot;color: #339933;&quot;&gt;-&amp;gt;&lt;/span&gt;source_rows.&lt;span style=&quot;color: #202020;&quot;&gt;append&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; i &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;


&lt;p&gt;Enfin pour chaque enregistrement de notre modèle source, nous récupérons l'identifiant du parent et   recherchons dans la structure que nous venons de créer l'index dans le modèle source de la  catégorie parente.&lt;/p&gt;


&lt;p&gt;Ces valeurs sont alors renseignées dans le modèle. Nos ajoutons également dans la structure de &lt;em&gt;mapping&lt;/em&gt; de la catégorie parent, notre ligne dans la liste des enfants.&lt;/p&gt;


&lt;p&gt;Notre structure est ainsi complètement initialisé. Un identifiant connaît donc son parent, et la liste de ses enfants. C'est sur cette structure que se basera le reste des méthodes de notre modèle.&lt;/p&gt;


&lt;h4&gt;mapFromSource()&lt;/h4&gt;


&lt;p&gt;Le but de cette méthode est de convertir notre index venant du modèle source vers un index de notre modèle à nous.&lt;/p&gt;


&lt;p&gt;L'index du modèle source nous donne l'emplacement de la donnée dans le modèle source sous forme (ligne, colonne) alors que l'index de notre modèle doit donner l'emplacement dans notre modèle sous la forme (ligne, colonne, pointeur indiquant le parent).&lt;/p&gt;

&lt;pre class=&quot;c c&quot; style=&quot;font-family:inherit&quot;&gt;&lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;!&lt;/span&gt; sourceIndex.&lt;span style=&quot;color: #202020;&quot;&gt;isValid&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; QModelIndex&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; sourceIndex.&lt;span style=&quot;color: #202020;&quot;&gt;model&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;!=&lt;/span&gt; m_sourceModel &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;
	qWarning&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;CategoryItemModel: index from wrong model passed to mapFromSource&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
	&lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; QModelIndex&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;


&lt;p&gt;Il faut donc d'abord vérifier que l'index du modèle source est valide. S'il n'est pas valide, alors il ne sera pas valide non plus dans notre modèle à nous.&lt;/p&gt;

&lt;pre class=&quot;c c&quot; style=&quot;font-family:inherit&quot;&gt;&lt;span style=&quot;color: #993333;&quot;&gt;int&lt;/span&gt; row &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; sourceIndex.&lt;span style=&quot;color: #202020;&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
IndexMap&lt;span style=&quot;color: #339933;&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color: #202020;&quot;&gt;const_iterator&lt;/span&gt; it &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; m_sourcesIndexMapping.&lt;span style=&quot;color: #202020;&quot;&gt;constFind&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; row &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
Q_ASSERT&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; it &lt;span style=&quot;color: #339933;&quot;&gt;!=&lt;/span&gt; m_sourcesIndexMapping.&lt;span style=&quot;color: #202020;&quot;&gt;constEnd&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;


&lt;p&gt;Nous récupérons l'index dans le modèle source, et à l'aide de notre tableau d'index source, nous allons retrouver l'objet &lt;em&gt;Mapping&lt;/em&gt; correspondant. Cette objet &lt;em&gt;Mapping&lt;/em&gt; correspondra à celui de notre index source. Ce dont nous avons besoin pour notre modèle est l'objet &lt;em&gt;Mapping&lt;/em&gt; de l'objet parent (En effet, notre index est construit sous la forme&amp;nbsp;: ligne, colonne, pointeur sur la structure &lt;em&gt;Mapping&lt;/em&gt; du parent de notre index). Nous récupérons donc l'index de la ligne source dans l'objet parent.&lt;/p&gt;

&lt;pre class=&quot;c c&quot; style=&quot;font-family:inherit&quot;&gt;&lt;span style=&quot;color: #993333;&quot;&gt;int&lt;/span&gt; parentRow &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; it.&lt;span style=&quot;color: #202020;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;-&amp;gt;&lt;/span&gt;parentIndex&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
IndexMap&lt;span style=&quot;color: #339933;&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color: #202020;&quot;&gt;const_iterator&lt;/span&gt; parentIt &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; m_sourcesIndexMapping.&lt;span style=&quot;color: #202020;&quot;&gt;constFind&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; parentRow &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
Q_ASSERT&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; parentIt &lt;span style=&quot;color: #339933;&quot;&gt;!=&lt;/span&gt; m_sourcesIndexMapping.&lt;span style=&quot;color: #202020;&quot;&gt;constEnd&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
Mapping &lt;span style=&quot;color: #339933;&quot;&gt;*&lt;/span&gt; m &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; parentIt.&lt;span style=&quot;color: #202020;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;


&lt;p&gt;Cela nous permet de récupérer l'objet &lt;em&gt;Mapping&lt;/em&gt; de l'index parent.&lt;/p&gt;

&lt;pre class=&quot;c c&quot; style=&quot;font-family:inherit&quot;&gt;&lt;span style=&quot;color: #993333;&quot;&gt;int&lt;/span&gt; proxyRow    &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; m&lt;span style=&quot;color: #339933;&quot;&gt;-&amp;gt;&lt;/span&gt;source_rows.&lt;span style=&quot;color: #202020;&quot;&gt;indexOf&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; row &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: #993333;&quot;&gt;int&lt;/span&gt; proxyColumn &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; sourceColumnToProxy&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; sourceIndex.&lt;span style=&quot;color: #202020;&quot;&gt;column&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; proxyColumn &lt;span style=&quot;color: #339933;&quot;&gt;==&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #0000dd;&quot;&gt;1&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; QModelIndex&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;


&lt;p&gt;La méthode &lt;em&gt;sourceColumnToProxy()&lt;/em&gt; permet de transformer une colonne de l'objet source en une colonne de l'objet courant. Cela signifie que la colonne 2 sera convertie en colonne 1, et que les colonnes 1 et 3 ne seront pas converties (et cachées). Dans ce dernier cas, nous retournons &lt;em&gt;QModelIndex()&lt;/em&gt;.&lt;/p&gt;


&lt;p&gt;L'index de la ligne dans notre modèle sera donné par la position dans la liste &lt;em&gt;source_rows&lt;/em&gt; dans notre structure de conversion.&lt;/p&gt;

&lt;pre class=&quot;c c&quot; style=&quot;font-family:inherit&quot;&gt;&lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; createIndex&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; proxyRow&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; proxyColumn&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;*&lt;/span&gt;parentIt &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;


&lt;p&gt;Nous pouvons alors créer notre index.&lt;/p&gt;


&lt;h4&gt;mapToSource()&lt;/h4&gt;


&lt;p&gt;De la manière inverse à la méthode &lt;em&gt;mapFromSource()&lt;/em&gt;, cette méthode permet de convertir un index de notre objet en un index du modèle source.&lt;/p&gt;

&lt;pre class=&quot;c c&quot; style=&quot;font-family:inherit&quot;&gt;&lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;!&lt;/span&gt; proxyIndex.&lt;span style=&quot;color: #202020;&quot;&gt;isValid&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; QModelIndex&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; proxyIndex.&lt;span style=&quot;color: #202020;&quot;&gt;model&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;!=&lt;/span&gt; this &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;
	qWarning&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;&amp;quot;CategoryItemModel: index from wrong model passed to mapToSource&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
	&lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; QModelIndex&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;


&lt;p&gt;Si le modèle est invalide  dans notre modèle, il l'est aussi dans le modèle source. Il n'y a pas d'équivalent dans le modèle source de l'index racine.&lt;/p&gt;

&lt;pre class=&quot;c c&quot; style=&quot;font-family:inherit&quot;&gt;Mapping &lt;span style=&quot;color: #339933;&quot;&gt;*&lt;/span&gt; m &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; static_cast&lt;span style=&quot;color: #339933;&quot;&gt;&amp;lt;&lt;/span&gt;Mapping&lt;span style=&quot;color: #339933;&quot;&gt;*&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; proxyIndex.&lt;span style=&quot;color: #202020;&quot;&gt;internalPointer&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;


&lt;p&gt;Nous récupérons la structure dans le pointeur interne de notre index.&lt;/p&gt;

&lt;pre class=&quot;c c&quot; style=&quot;font-family:inherit&quot;&gt;&lt;span style=&quot;color: #993333;&quot;&gt;int&lt;/span&gt; sourceColumn &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; proxyColumnToSource&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; proxyIndex.&lt;span style=&quot;color: #202020;&quot;&gt;column&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; sourceColumn &lt;span style=&quot;color: #339933;&quot;&gt;==&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #0000dd;&quot;&gt;1&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; QModelIndex&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;


&lt;p&gt;Nous récupérons également les informations sur notre colonne (Soit, conversion de la colonne 0 dans notre modèle, en la colonne 1 dans le modèle source).&lt;/p&gt;

&lt;pre class=&quot;c c&quot; style=&quot;font-family:inherit&quot;&gt;&lt;span style=&quot;color: #993333;&quot;&gt;int&lt;/span&gt; sourceRow &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; m&lt;span style=&quot;color: #339933;&quot;&gt;-&amp;gt;&lt;/span&gt;source_rows.&lt;span style=&quot;color: #202020;&quot;&gt;at&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; proxyIndex.&lt;span style=&quot;color: #202020;&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;


&lt;p&gt;Nous recherchons dans notre liste &lt;em&gt;source_rows&lt;/em&gt; la ligne dans le modèle source qui correspond à la ligne (relative au père) indiqué par notre index et nous construisons un index de type (ligne, colonne) correspondant au modèle source.&lt;/p&gt;

&lt;pre class=&quot;c c&quot; style=&quot;font-family:inherit&quot;&gt;&lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; m_sourceModel&lt;span style=&quot;color: #339933;&quot;&gt;-&amp;gt;&lt;/span&gt;index&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; sourceRow&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; sourceColumn &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;


&lt;p&gt;L'implémentation des méthodes &lt;em&gt;mapFromSource()&lt;/em&gt; et &lt;em&gt;mapToSource()&lt;/em&gt; permettent de faire fonctionner les implémentations des méthodes &lt;em&gt;data()&lt;/em&gt;, &lt;em&gt;headerData()&lt;/em&gt;, et &lt;em&gt;flags()&lt;/em&gt;. Il n'y aura donc aucun intérêt à ré-implémenter ces méthodes à moins de vouloir traiter les données de ces fonctions. Nous ne les décrirons donc pas ici, mais vous pourrez voir dans le fichier attaché, un exemple d'utilisation.&lt;/p&gt;


&lt;h4&gt;index()&lt;/h4&gt;

&lt;p&gt;Le principe de cette méthode est de générer un index pour notre modèle. L'index doit être valide et réutilisable dans les méthodes &lt;em&gt;rowCount()&lt;/em&gt;, &lt;em&gt;flags()&lt;/em&gt;, &lt;em&gt;columnCount()&lt;/em&gt;, &lt;em&gt;data()&lt;/em&gt;, &lt;em&gt;mapToSource()&lt;/em&gt;.&lt;/p&gt;

&lt;pre class=&quot;c c&quot; style=&quot;font-family:inherit&quot;&gt;&lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; row &lt;span style=&quot;color: #339933;&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;color: #0000dd;&quot;&gt;0&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;||&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; column &lt;span style=&quot;color: #339933;&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;color: #0000dd;&quot;&gt;0&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; QModelIndex&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;


&lt;p&gt;Si la ligne ou la colonne est inférieure à 0, l'index n'est pas valide.&lt;/p&gt;

&lt;pre class=&quot;c c&quot; style=&quot;font-family:inherit&quot;&gt;IndexMap&lt;span style=&quot;color: #339933;&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;color: #202020;&quot;&gt;const_iterator&lt;/span&gt; it &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; m_sourcesIndexMapping.&lt;span style=&quot;color: #202020;&quot;&gt;constFind&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #0000dd;&quot;&gt;1&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
QModelIndex sourceParent &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; mapToSource&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; parent &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; sourceParent.&lt;span style=&quot;color: #202020;&quot;&gt;isValid&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;
	it &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; m_sourcesIndexMapping.&lt;span style=&quot;color: #202020;&quot;&gt;constFind&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; sourceParent.&lt;span style=&quot;color: #202020;&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;


&lt;p&gt;A partir de l'index &lt;em&gt;parent&lt;/em&gt; nous retrouvons l'index qui correspond dans le modèle source (&lt;em&gt;sourceParent').  Si l'on ne trouve pas d'index dans le modèle source, nous considérons être sur l'élément racine de notre arbre. Sinon nous recherchons dans la table de &lt;/em&gt;Mapping'' la structure qui correspond.&lt;/p&gt;

&lt;pre class=&quot;c c&quot; style=&quot;font-family:inherit&quot;&gt;Q_ASSERT&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; it &lt;span style=&quot;color: #339933;&quot;&gt;!=&lt;/span&gt; m_sourcesIndexMapping.&lt;span style=&quot;color: #202020;&quot;&gt;constEnd&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; it.&lt;span style=&quot;color: #202020;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;-&amp;gt;&lt;/span&gt;source_rows.&lt;span style=&quot;color: #202020;&quot;&gt;count&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;&amp;lt;=&lt;/span&gt; row &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;
	&lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; QModelIndex&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;


&lt;p&gt;Nous vérifions le nombre d'élément dans la structure et nous retournons un index non valide si l'index demandé va au delà de la taille du tableau.&lt;/p&gt;

&lt;pre class=&quot;c c&quot; style=&quot;font-family:inherit&quot;&gt;&lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; createIndex&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; row&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; column&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;*&lt;/span&gt;it &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;


&lt;p&gt;Finalement nous retournons l'index créé avec le pointeur vers la structure &lt;em&gt;Mapping&lt;/em&gt; du père en &lt;em&gt;internalData&lt;/em&gt;.&lt;/p&gt;


&lt;h4&gt;parent()&lt;/h4&gt;


&lt;p&gt;Cette méthode permet de retourner pour l'index donné du proxy, l'index du parent. Un index invalide n'a pas de parent.&lt;/p&gt;

&lt;pre class=&quot;c c&quot; style=&quot;font-family:inherit&quot;&gt;&lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;!&lt;/span&gt; index.&lt;span style=&quot;color: #202020;&quot;&gt;isValid&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; QModelIndex&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
Mapping &lt;span style=&quot;color: #339933;&quot;&gt;*&lt;/span&gt; m &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; static_cast&lt;span style=&quot;color: #339933;&quot;&gt;&amp;lt;&lt;/span&gt;Mapping&lt;span style=&quot;color: #339933;&quot;&gt;*&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; index.&lt;span style=&quot;color: #202020;&quot;&gt;internalPointer&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;


&lt;p&gt;On récupère la structure de correspondance stockée dans le pointeur interne de l'objet. Cette  structure nous donne les informations du parent (en effet dans &lt;em&gt;internalPointer()&lt;/em&gt;, on stock la structure &lt;em&gt;Mapping&lt;/em&gt; du parent), et donc l'index dans le modèle source.&lt;/p&gt;

&lt;pre class=&quot;c c&quot; style=&quot;font-family:inherit&quot;&gt;&lt;span style=&quot;color: #993333;&quot;&gt;int&lt;/span&gt; sourceRow &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; m&lt;span style=&quot;color: #339933;&quot;&gt;-&amp;gt;&lt;/span&gt;index&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; sourceRow &lt;span style=&quot;color: #339933;&quot;&gt;==&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #0000dd;&quot;&gt;1&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; QModelIndex&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
QModelIndex sourceParent &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; m_sourceModel&lt;span style=&quot;color: #339933;&quot;&gt;-&amp;gt;&lt;/span&gt;index&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; sourceRow&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; proxyColumnToSource&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #0000dd;&quot;&gt;0&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
QModelIndex proxyParent &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; mapFromSource&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; sourceParent &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;


&lt;p&gt;On utilise alors notre méthode &lt;em&gt;mapFromSource()&lt;/em&gt; pour retrouver l'index du parent dans le référentiel du proxy.&lt;/p&gt;

&lt;pre class=&quot;c c&quot; style=&quot;font-family:inherit&quot;&gt;&lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; proxyParent&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;


&lt;h4&gt;rowCount()&lt;/h4&gt;


&lt;p&gt;Le but de cette méthode est de retourner le nombre de ligne enfant pour un index. Dans le modèle source les indexes n'ont pas d'enfant.
Lorsque l'index vaut &lt;em&gt;QModelIndex()&lt;/em&gt;, cela signifie qu'il faut retourner le nombre de ligne pour notre racine.&lt;/p&gt;

&lt;pre class=&quot;c c&quot; style=&quot;font-family:inherit&quot;&gt;&lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; index.&lt;span style=&quot;color: #202020;&quot;&gt;column&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: #0000dd;&quot;&gt;0&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000dd;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;


&lt;p&gt;Seul la première colonne a des enfants.&lt;/p&gt;

&lt;pre class=&quot;c c&quot; style=&quot;font-family:inherit&quot;&gt;&lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;!&lt;/span&gt; index.&lt;span style=&quot;color: #202020;&quot;&gt;isValid&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;
	Mapping &lt;span style=&quot;color: #339933;&quot;&gt;*&lt;/span&gt; rootMapping &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; m_sourcesIndexMapping.&lt;span style=&quot;color: #202020;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #0000dd;&quot;&gt;1&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
	&lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; rootMapping&lt;span style=&quot;color: #339933;&quot;&gt;-&amp;gt;&lt;/span&gt;source_rows.&lt;span style=&quot;color: #202020;&quot;&gt;count&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;


&lt;p&gt;Pour l'index racine, on récupère le nombre de ligne à la ligne -1 du modèle source.&lt;/p&gt;

&lt;pre class=&quot;c c&quot; style=&quot;font-family:inherit&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt; &lt;span style=&quot;color: #b1b100;&quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#123;&lt;/span&gt;
	Mapping &lt;span style=&quot;color: #339933;&quot;&gt;*&lt;/span&gt; parrentMapping &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; static_cast&lt;span style=&quot;color: #339933;&quot;&gt;&amp;lt;&lt;/span&gt;Mapping&lt;span style=&quot;color: #339933;&quot;&gt;*&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; index.&lt;span style=&quot;color: #202020;&quot;&gt;internalPointer&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
	&lt;span style=&quot;color: #993333;&quot;&gt;int&lt;/span&gt; sourceRowIndex &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; parrentMapping&lt;span style=&quot;color: #339933;&quot;&gt;-&amp;gt;&lt;/span&gt;source_rows.&lt;span style=&quot;color: #202020;&quot;&gt;at&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; index.&lt;span style=&quot;color: #202020;&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
	Mapping &lt;span style=&quot;color: #339933;&quot;&gt;*&lt;/span&gt; rowMapping &lt;span style=&quot;color: #339933;&quot;&gt;=&lt;/span&gt; m_sourcesIndexMapping.&lt;span style=&quot;color: #202020;&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; sourceRowIndex &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
	&lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; rowMapping&lt;span style=&quot;color: #339933;&quot;&gt;-&amp;gt;&lt;/span&gt;source_rows.&lt;span style=&quot;color: #202020;&quot;&gt;count&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;


&lt;p&gt;Sinon on récupère la structure stockée dans le pointeur interne. Cette structure est celle du parent de notre objet. On récupère à l'aide de la méthode &lt;em&gt;row()&lt;/em&gt; de l'index l'emplacement de la ligne source. Cette ligne source nous permet de récupérer la structure de correspondance de notre index, et ainsi le nombre de ligne de notre index.&lt;/p&gt;

&lt;pre class=&quot;c c&quot; style=&quot;font-family:inherit&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;


&lt;h4&gt;columnCount()&lt;/h4&gt;


&lt;p&gt;Notre modèle ne possède qu'une seule colonne.&lt;/p&gt;

&lt;pre class=&quot;c c&quot; style=&quot;font-family:inherit&quot;&gt;&lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000dd;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;


&lt;h4&gt;proxyColumnToSource()&lt;/h4&gt;


&lt;p&gt;Si la colonne du proxy vaut 0, alors on retourne la colonne 1, sinon on retourne la colonne -1&amp;nbsp;: la colonne n'est pas convertible, elle n'existe pas dans notre proxy.&lt;/p&gt;

&lt;pre class=&quot;c c&quot; style=&quot;font-family:inherit&quot;&gt;&lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; proxyColumn &lt;span style=&quot;color: #339933;&quot;&gt;==&lt;/span&gt; &lt;span style=&quot;color: #0000dd;&quot;&gt;0&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;
	&lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; list_name&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #0000dd;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;


&lt;h4&gt;sourceColumToProxy()&lt;/h4&gt;


&lt;p&gt;Si la colonne source est 1, alors nous convertissons celle-ci en la colonne 0. Sinon la colonne n'existe pas dans notre proxy.&lt;/p&gt;

&lt;pre class=&quot;c c&quot; style=&quot;font-family:inherit&quot;&gt;&lt;span style=&quot;color: #b1b100;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;#40;&lt;/span&gt; sourceColumn &lt;span style=&quot;color: #339933;&quot;&gt;==&lt;/span&gt; list_name &lt;span style=&quot;color: #009900;&quot;&gt;&amp;#41;&lt;/span&gt;
	&lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000dd;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;
&lt;span style=&quot;color: #b1b100;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #339933;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;color: #0000dd;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;</description>
    
          <enclosure url="http://www.shadoware.org/public/billets/qt/table2tree/categoryitemmodel.cpp"
      length="8272" type="text/plain" />
          <enclosure url="http://www.shadoware.org/public/billets/qt/table2tree/categoryitemmodel.h"
      length="3018" type="text/plain" />
    
    
          <comments>http://www.shadoware.org/post/2009/09/10/%5BQt%5D-Transformation-d-une-vue-tableau-en-une-vue-hi%C3%A9rarchique#comment-form</comments>
      <wfw:comment>http://www.shadoware.org/post/2009/09/10/%5BQt%5D-Transformation-d-une-vue-tableau-en-une-vue-hi%C3%A9rarchique#comment-form</wfw:comment>
      <wfw:commentRss>http://www.shadoware.org/feed/atom/comments/623</wfw:commentRss>
      </item>
    
  <item>
    <title>KMyMoney - Logiciel de compte</title>
    <link>http://www.shadoware.org/post/2009/02/24/KMyMoney-Logiciel-de-compte</link>
    <guid isPermaLink="false">urn:md5:a8f1185e40fdd9ff15ac06145d59a8af</guid>
    <pubDate>Sat, 23 May 2009 12:31:00 +0200</pubDate>
    <dc:creator>Ulrich Van Den Hekke</dc:creator>
        <category>Logiciels</category>
        <category>argent</category><category>debian</category><category>kde</category><category>libre</category><category>planet</category><category>qt</category>    
    <description>    &lt;p&gt;&lt;img src=&quot;http://www.shadoware.org/public/billets/kmymoney/logo.png&quot; alt=&quot;Logo KMyMoney&quot; style=&quot;float:left; margin: 0 1em 1em 0;&quot; title=&quot;Logo KMyMoney, fév. 2009&quot; /&gt;&lt;/p&gt;


&lt;p&gt;Voilà un bon logiciel sur lequel on peut compter (mouarf&amp;nbsp;! mouarf&amp;nbsp;! mouarf !), KMyMoney est un éditeur de compte. Je l'utilise quotidiennement,  et je décide donc d'en parler un peu, pour que d'autres personnes puissent s'intéresser aussi à  ce logiciel.&lt;/p&gt;


&lt;p&gt;&lt;img src=&quot;http://www.shadoware.org/public/billets/kmymoney/.Summary_m.jpg&quot; alt=&quot;Summary.png&quot; style=&quot;display:block; margin:0 auto;&quot; title=&quot;Summary.png, mai 2009&quot; /&gt;&lt;/p&gt;


&lt;p&gt;KMyMoney est un logiciel de gestion de compte pour particulier. Il vous permet de gérer plusieurs de vos comptes en banque, en vous permettant de saisir les dépenses et les recettes sur chacun de vos comptes.&lt;/p&gt;


&lt;p&gt;&lt;img src=&quot;http://www.shadoware.org/public/billets/kmymoney/.Registres_m.jpg&quot; alt=&quot;Registres.png&quot; style=&quot;display:block; margin:0 auto;&quot; title=&quot;Registres.png, mai 2009&quot; /&gt;&lt;/p&gt;


&lt;p&gt;Vous pouvez également lui indiquer vos échéances (par exemple&amp;nbsp;: forfait téléphone, prêt immobilier&lt;sup&gt;[&lt;a href=&quot;http://www.shadoware.org/post/2009/02/24/KMyMoney-Logiciel-de-compte#pnote-615-1&quot; id=&quot;rev-pnote-615-1&quot;&gt;1&lt;/a&gt;]&lt;/sup&gt;, mais aussi salaire, vos virements internes ou externes, ...) qu'il s'occupera de mettre à jour dans le registre automatiquement ou à votre demande.&lt;/p&gt;


&lt;p&gt;&lt;img src=&quot;http://www.shadoware.org/public/billets/kmymoney/.Echeancier_m.jpg&quot; alt=&quot;Echeancier.png&quot; style=&quot;display:block; margin:0 auto;&quot; title=&quot;Echeancier.png, mai 2009&quot; /&gt;&lt;/p&gt;


&lt;p&gt;Après une année d'utilisation, il vous permet également de sortir un rapport détaillé sur vos dépenses et vos recettes suivant les catégories saisies pour vos opérations. Cette information peut vous être très utile pour voir où se trouve le &quot;trou&quot; de votre porte monnaie et ainsi  faire une rustine. Il vous permet aussi de vous projeter vers l'avenir et de faire votre budget pour l'année prochaine. KMyMoney vous offre pour cela, la saisie de votre budget, ainsi que plusieurs rapports d'écart, vous permettant ainsi de retrouver facilement où vous avez finalement dépensé plus que le budget prévu, et où vous avez dépensé moins.&lt;/p&gt;


&lt;p&gt;&lt;img src=&quot;http://www.shadoware.org/public/billets/kmymoney/.Rapport_m.jpg&quot; alt=&quot;Rapport.png&quot; style=&quot;display:block; margin:0 auto;&quot; title=&quot;Rapport.png, mai 2009&quot; /&gt;&lt;/p&gt;


&lt;p&gt;En plus de vos comptes en banque &lt;em&gt;normaux&lt;/em&gt;, KMyMoney vous permet également de gérer vos comptes titre, et les actions que vous y avez mises. Vous pouvez alors facilement suivre la chute vertigineuse de la bourse et votre portefeuille fondre littéralement, mais aussi la remontée (on espère), des actions d'ici quelques ... siècles.&lt;/p&gt;


&lt;p&gt;Enfin pour les paranos, vos comptes peuvent être cryptés à l'aide de votre clé GnuPG automatiquement par KMyMoney &lt;img src=&quot;/dotclear/themes/default/smilies/smile.png&quot; alt=&quot;:)&quot; class=&quot;smiley&quot; /&gt;&lt;/p&gt;


&lt;p&gt;&lt;img src=&quot;http://www.shadoware.org/public/billets/kmymoney/.Cryptage_m.jpg&quot; alt=&quot;Cryptage.png&quot; style=&quot;display:block; margin:0 auto;&quot; title=&quot;Cryptage.png, mai 2009&quot; /&gt;&lt;/p&gt;


&lt;p&gt;Après cette courte présentation, je vous souhaite bon compte &lt;img src=&quot;/dotclear/themes/default/smilies/wink.png&quot; alt=&quot;;)&quot; class=&quot;smiley&quot; /&gt;&lt;/p&gt;


&lt;blockquote&gt;&lt;p&gt;Pour une vie équilibrée, n'oubliez pas de profiter du soleil, au lieu de passer votre temps sur votre ordinateur&lt;/p&gt;&lt;/blockquote&gt;
&lt;div class=&quot;footnotes&quot;&gt;&lt;h4&gt;Notes&lt;/h4&gt;
&lt;p&gt;[&lt;a href=&quot;http://www.shadoware.org/post/2009/02/24/KMyMoney-Logiciel-de-compte#rev-pnote-615-1&quot; id=&quot;pnote-615-1&quot;&gt;1&lt;/a&gt;] Il s'occupera d'ailleurs de calculer la durée des échéances, ... en fonction des différents chiffres que vous allez lui entrer.&lt;/p&gt;&lt;/div&gt;
</description>
    
    
    
          <comments>http://www.shadoware.org/post/2009/02/24/KMyMoney-Logiciel-de-compte#comment-form</comments>
      <wfw:comment>http://www.shadoware.org/post/2009/02/24/KMyMoney-Logiciel-de-compte#comment-form</wfw:comment>
      <wfw:commentRss>http://www.shadoware.org/feed/atom/comments/615</wfw:commentRss>
      </item>
    
  <item>
    <title>Le net en france ...</title>
    <link>http://www.shadoware.org/post/2009/03/02/Le-net-en-france-...</link>
    <guid isPermaLink="false">urn:md5:67b788e5352e59bf1598900e9a4da5f6</guid>
    <pubDate>Mon, 02 Mar 2009 14:09:00 +0100</pubDate>
    <dc:creator>Ulrich Van Den Hekke</dc:creator>
        <category>Ma Vie</category>
        <category>APRIL</category><category>contre-façon</category><category>HADOPI</category><category>libre</category><category>Quadrature</category><category>vie</category>    
    <description>    &lt;p&gt;&lt;q&gt;Devant le ridicule d'un gouvernement qui s'entête à vouloir déconnecter du Net des familles entières sans preuves valables ni procès, la Quadrature appelle les citoyens épris de liberté à procéder au «&amp;nbsp;black-out&amp;nbsp;» de leurs sites, blogs, profils, avatars, etc. Comme en Nouvelle-Zélande, seul pays avec la France où la «&amp;nbsp;riposte graduée&amp;nbsp;» devait être imposée par la loi, pour finalement être repoussée&amp;nbsp;: pour protester contre cette loi imbécile et sa «&amp;nbsp;liste blanche&amp;nbsp;» de sites autorisés, le Net français doit agir et se draper de noir.&lt;/q&gt;&lt;br /&gt;
La quadrature du net, Paris, le 25 février&lt;/p&gt;

&lt;center&gt;&lt;a href=&quot;http://www.laquadrature.net/HADOPI&quot; title=&quot;HADOPI - Le Net en France : black-out&quot;&gt;&lt;img src=&quot;http://media.laquadrature.net/Quadrature_black-out_HADOPI_336x280px.gif&quot; border=&quot;0&quot; alt=&quot;HADOPI - Le Net en France : black-out&quot; /&gt;&lt;/a&gt;&lt;/center&gt;
</description>
    
    
    
          <comments>http://www.shadoware.org/post/2009/03/02/Le-net-en-france-...#comment-form</comments>
      <wfw:comment>http://www.shadoware.org/post/2009/03/02/Le-net-en-france-...#comment-form</wfw:comment>
      <wfw:commentRss>http://www.shadoware.org/feed/atom/comments/616</wfw:commentRss>
      </item>
    
  <item>
    <title>Outil de sécurisation non intéropérable</title>
    <link>http://www.shadoware.org/post/2009/02/20/Outil-de-s%C3%A9curisation-non-int%C3%A9rop%C3%A9rable</link>
    <guid isPermaLink="false">urn:md5:5c2323fdd9ea7da2557b9263608d3fbe</guid>
    <pubDate>Fri, 20 Feb 2009 10:00:00 +0100</pubDate>
    <dc:creator>Ulrich Van Den Hekke</dc:creator>
        <category>Logiciels</category>
        <category>APRIL</category><category>contre-façon</category><category>libre</category><category>musique</category><category>planet</category><category>vie</category>    
    <description>    &lt;p&gt;&lt;img src=&quot;http://www.shadoware.org/public/billets/piracy/DooFi_Skull.png&quot; alt=&quot;Piracy&quot; style=&quot;float:left; margin: 0 1em 1em 0;&quot; title=&quot;Piracy, fév. 2009&quot; /&gt; Alors que l'UMP est accusé de contrefaçon du groupe MGMT&lt;sup&gt;[&lt;a href=&quot;http://www.shadoware.org/post/2009/02/20/Outil-de-s%C3%A9curisation-non-int%C3%A9rop%C3%A9rable#pnote-614-1&quot; id=&quot;rev-pnote-614-1&quot;&gt;1&lt;/a&gt;]&lt;/sup&gt;, et est donc accusé du terme de &lt;em&gt;piratage&lt;/em&gt; selon le mot utilisé à mauvais escient, nous avons des nouvelles sur le logiciel espion du gouvernement&lt;sup&gt;[&lt;a href=&quot;http://www.shadoware.org/post/2009/02/20/Outil-de-s%C3%A9curisation-non-int%C3%A9rop%C3%A9rable#pnote-614-2&quot; id=&quot;rev-pnote-614-2&quot;&gt;2&lt;/a&gt;]&lt;/sup&gt;.&lt;/p&gt;


&lt;p&gt;Ce dernier sera non seulement payant mais également non interopérable. Pour &lt;em&gt;le rapporteur Riester&lt;/em&gt;, l'interopérabilité est un frein au choix et n'est pas nécessaire&amp;nbsp;:&lt;/p&gt;


&lt;p&gt;&lt;q&gt;Je n’y suis pas favorable, a-t-il expliqué avant de poursuivre il faut laisser au consommateur sa totale liberté de choix en fonction de son système d’exploitation. L’interopérabilité n’est pas nécessaire pour les consommateurs et elle est trop contraignante pour les éditeurs de logiciels&lt;/q&gt;&lt;/p&gt;


&lt;blockquote&gt;&lt;p&gt;les moyens de sécurisation mis en place ne sauraient être gratuits, à l’image des logiciels de contrôle parental, mis à la disposition des consommateurs à titre payant, même si leur prix est modique&lt;/p&gt;&lt;/blockquote&gt;


&lt;p&gt;En plus de l'abonnement internet et du modem ADSL de l'opérateur, il faudra également donc s'acheter ce logiciel espion, ainsi que le système d'exploitation &lt;em&gt;Redmondien&lt;/em&gt; qui va avec. En effet, aucun éditeur de logiciel ne trouvera un intérêt (monétaire) à développer un tel logiciel espion (qui sera, de surcroit, à source fermé) pour un système d'exploitation libre.
Comment donc pourrions-nous nous défendre, nous utilisateurs du logiciel libre, si vis-à-vis de la loi, nous ne pourrons nous justifier d'un téléchargement illégal même s'il n'en est pas le cas.&lt;/p&gt;


&lt;p&gt;Alors que l'on parle de vente lié, &lt;em&gt;M. Henrard&lt;/em&gt; répond &lt;q&gt;On crée une incitation et chacun se détermine en fonction de ses obligations. Il y a des aléas dont on veut se protéger et si on est un tout petit peu rationnel, il est évident qu’on va demander à son FAI l’utilisation d’un tel dispositif.&lt;/q&gt; et donc payer ...&lt;/p&gt;


&lt;p&gt;Le président de l&lt;em&gt;'APRIL&lt;/em&gt;&lt;sup&gt;[&lt;a href=&quot;http://www.shadoware.org/post/2009/02/20/Outil-de-s%C3%A9curisation-non-int%C3%A9rop%C3%A9rable#pnote-614-3&quot; id=&quot;rev-pnote-614-3&quot;&gt;3&lt;/a&gt;]&lt;/sup&gt; s'insurge qu'&lt;q&gt;il reste encore à l'Assemblée nationale des députés qui sont opposés à l'interopérabilité, opposés à la libre concurrence, opposés au libre-choix des utilisateurs, et opposés au logiciel libre&lt;/q&gt;&lt;/p&gt;


&lt;p&gt;Quand au logiciel en lui-même, personne ne connait son fonctionnement&amp;nbsp;:
- Qu'enverra-t-il comme donnée&amp;nbsp;?
- A qui enverra-t-il les données (au FAI&amp;nbsp;? au gens plein de fric (major)&amp;nbsp;? au marketing&amp;nbsp;? au gouvernement&amp;nbsp;? à tout ces gens ?)
- Devras-t-il être sur chaque ordinateur (avec une licence par ordinateur à payer)&amp;nbsp;? Sur le modem ADSL&amp;nbsp;? Sur un seul des ordinateurs (et il nous sera alors interdis d'avoir plus d'un ordinateur par foyer)&amp;nbsp;?&lt;/p&gt;



&lt;p&gt;La France apparaitra alors surement bientôt (pour 2009) dans les pays ennemis d'Internet&lt;sup&gt;[&lt;a href=&quot;http://www.shadoware.org/post/2009/02/20/Outil-de-s%C3%A9curisation-non-int%C3%A9rop%C3%A9rable#pnote-614-4&quot; id=&quot;rev-pnote-614-4&quot;&gt;4&lt;/a&gt;]&lt;/sup&gt;. Vive la république et vive la France.&lt;/p&gt;
&lt;div class=&quot;footnotes&quot;&gt;&lt;h4&gt;Notes&lt;/h4&gt;
&lt;p&gt;[&lt;a href=&quot;http://www.shadoware.org/post/2009/02/20/Outil-de-s%C3%A9curisation-non-int%C3%A9rop%C3%A9rable#rev-pnote-614-1&quot; id=&quot;pnote-614-1&quot;&gt;1&lt;/a&gt;] http://www.lexpress.fr/culture/musique/l-ump-a-t-il-pirate-mgmt_742192.html&lt;/p&gt;
&lt;p&gt;[&lt;a href=&quot;http://www.shadoware.org/post/2009/02/20/Outil-de-s%C3%A9curisation-non-int%C3%A9rop%C3%A9rable#rev-pnote-614-2&quot; id=&quot;pnote-614-2&quot;&gt;2&lt;/a&gt;] http://www.pcinpact.com/actu/news/49218-hadopi-interoperabilite-logiciel-libre-payant.htm?vc=1&lt;/p&gt;
&lt;p&gt;[&lt;a href=&quot;http://www.shadoware.org/post/2009/02/20/Outil-de-s%C3%A9curisation-non-int%C3%A9rop%C3%A9rable#rev-pnote-614-3&quot; id=&quot;pnote-614-3&quot;&gt;3&lt;/a&gt;] Benoît Sibaud, président de l&lt;em&gt;'APRIL&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;[&lt;a href=&quot;http://www.shadoware.org/post/2009/02/20/Outil-de-s%C3%A9curisation-non-int%C3%A9rop%C3%A9rable#rev-pnote-614-4&quot; id=&quot;pnote-614-4&quot;&gt;4&lt;/a&gt;] http://fr.wikipedia.org/wiki/Internet_et_la_censure#Les_ennemis_d.E2.80.99Internet&lt;/p&gt;&lt;/div&gt;
</description>
    
    
    
          <comments>http://www.shadoware.org/post/2009/02/20/Outil-de-s%C3%A9curisation-non-int%C3%A9rop%C3%A9rable#comment-form</comments>
      <wfw:comment>http://www.shadoware.org/post/2009/02/20/Outil-de-s%C3%A9curisation-non-int%C3%A9rop%C3%A9rable#comment-form</wfw:comment>
      <wfw:commentRss>http://www.shadoware.org/feed/atom/comments/614</wfw:commentRss>
      </item>
    
</channel>
</rss>
