{"id":273,"date":"2014-10-27T16:38:26","date_gmt":"2014-10-27T16:38:26","guid":{"rendered":"http:\/\/www.creatis.insa-lyon.fr\/~grenier\/?p=273"},"modified":"2014-11-07T10:00:33","modified_gmt":"2014-11-07T10:00:33","slug":"contextuel-help-qtcreator","status":"publish","type":"post","link":"https:\/\/www.creatis.insa-lyon.fr\/~grenier\/?p=273","title":{"rendered":"Contextual Help QtCreator"},"content":{"rendered":"<p>In QtCreator, when pressing &#8220;F1&#8221; while editing your code you can get help on the selected word.<\/p>\n<p>Natively, this is working well for Qt classes, but not for std::vector nor itk::Image and so on&#8230;<\/p>\n<p>In fact it is possible to add dedicated help file to QtCreator: <a href=\"http:\/\/qt-project.org\/wiki\/Qt_Creator_Documentation_Gallery\">see here<\/a>.<\/p>\n<p>The way to add a new help file (say .qch file) in Qt Creator is every time the same:<\/p>\n<ol>\n<li>Get the desired qch file<\/li>\n<li>in QtCreator go in Tools &#8211;&gt; options &#8211;&gt; Help. The documentation tab and clic &#8220;add&#8221;, then select your .qch file.<\/li>\n<li>restart QtCreator<\/li>\n<\/ol>\n<p>On the previous link you can found many ressources about classical libraries. Here is my own selection (the qch file are linked):<\/p>\n<ul>\n<li><a href=\"https:\/\/www.creatis.insa-lyon.fr\/~grenier\/wp-content\/uploads\/TaT\/qch\/cppreference-doc-en-cpp.qch\">C++<\/a> (25.5 Mo)<\/li>\n<li><a href=\"https:\/\/www.creatis.insa-lyon.fr\/~grenier\/wp-content\/uploads\/TaT\/qch\/ITK-4-6-0.qch\">ITK 4 6 0<\/a>\u00a0 (<strong>810.6 Mo<\/strong>)<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" title=\"Configuring help\" src=\"https:\/\/www.creatis.insa-lyon.fr\/~grenier\/wp-content\/uploads\/TaT\/qch\/QtCreator_HelpConf.PNG\" alt=\"Configuring help\" width=\"600\" height=\"187\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>In order to generate new qch files, Doxygen is able to produce QHP files. Then there is a tool from Qt that produces the QCH file from QHP. If well configured, doxygen can produce a .qch file. remind to set properly these flags:<\/p>\n<ul>\n<li>GENERATE_QHP = YES\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 (produce QHP file)<\/li>\n<li>QCH_FILE\u00a0 = TheFile.qch\u00a0\u00a0\u00a0\u00a0 (as said in the help file : you have to specify QHG_LOCATIION)<\/li>\n<li>QHP_NAMESPACE = The.Lib.name<\/li>\n<li>QHG_LOCATION\u00a0 =\u00a0 \/bin\/qhelpgenerator\u00a0\u00a0\u00a0\u00a0 (or qhelpgenerator &#8230; the tool to go from qhp to qch)<\/li>\n<\/ul>\n<p>As example for ITK, CMake allow us to build documentation using doxygen and produces the doxygen.config file:<\/p>\n<ol>\n<li>set the flag &#8220;BUILD_DOCUMENTATION&#8221; to ON (in the advanced mode), then configure.<\/li>\n<li>then, set also to ON the flag &#8220;ITK_DOXYGEN_QHP&#8221;.<\/li>\n<li>configure and generate,<\/li>\n<li>then &#8220;make -j8&#8221; (and remind that the documentation generation tools is very very long).<\/li>\n<\/ol>\n<p>These steps should produce an &#8220;index.qhp&#8221; file (close to &#8220;.\/Utilities\/Doxygen\/html\/index.qhp&#8221; in your building directory) as\u00a0 ITK don&#8217;t complete properly QHP_NAMESPACE and\u00a0QHG_LOCATION (but you can edit the doxygen.config.in before all&#8230;). So, in order to convert your QHP file into a qch file, execute qhelpgenerator manually: <em>qhelpgenerator index.qhp -o ~\/ITK.qch<\/em><\/p>\n<p>Done!<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" title=\"Qt Creator with C++ help (and examples :) \" src=\"https:\/\/www.creatis.insa-lyon.fr\/~grenier\/wp-content\/uploads\/TaT\/qch\/QT_Cpp.PNG\" alt=\"Qt Creator with C++ help (and examples :) \" width=\"800\" height=\"444\" \/><\/p>\n<p>&nbsp;<\/p>\n<figure style=\"width: 800px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" title=\"QtCreator with ITK Documentation\" src=\"https:\/\/www.creatis.insa-lyon.fr\/~grenier\/wp-content\/uploads\/TaT\/qch\/QT_ITK.PNG\" alt=\"\" width=\"800\" height=\"456\" \/><figcaption class=\"wp-caption-text\">QtCreator with ITK Documentation<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In QtCreator, when pressing &#8220;F1&#8221; while editing your code you can get help on the selected word. Natively, this is working well for Qt classes, but not for std::vector nor itk::Image and so on&#8230; In fact it is possible to add dedicated help file to QtCreator: see here. The way to add a new help [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[],"class_list":["post-273","post","type-post","status-publish","format-standard","hentry","category-tips-and-tricks"],"_links":{"self":[{"href":"https:\/\/www.creatis.insa-lyon.fr\/~grenier\/index.php?rest_route=\/wp\/v2\/posts\/273","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.creatis.insa-lyon.fr\/~grenier\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.creatis.insa-lyon.fr\/~grenier\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.creatis.insa-lyon.fr\/~grenier\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.creatis.insa-lyon.fr\/~grenier\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=273"}],"version-history":[{"count":9,"href":"https:\/\/www.creatis.insa-lyon.fr\/~grenier\/index.php?rest_route=\/wp\/v2\/posts\/273\/revisions"}],"predecessor-version":[{"id":276,"href":"https:\/\/www.creatis.insa-lyon.fr\/~grenier\/index.php?rest_route=\/wp\/v2\/posts\/273\/revisions\/276"}],"wp:attachment":[{"href":"https:\/\/www.creatis.insa-lyon.fr\/~grenier\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=273"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.creatis.insa-lyon.fr\/~grenier\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=273"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.creatis.insa-lyon.fr\/~grenier\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=273"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}