qwtinstall.html 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
  5. <meta http-equiv="X-UA-Compatible" content="IE=9"/>
  6. <meta name="generator" content="Doxygen 1.8.20"/>
  7. <meta name="viewport" content="width=device-width, initial-scale=1"/>
  8. <title>Qwt User&#39;s Guide: Installing Qwt</title>
  9. <link href="tabs.css" rel="stylesheet" type="text/css"/>
  10. <script type="text/javascript" src="jquery.js"></script>
  11. <script type="text/javascript" src="dynsections.js"></script>
  12. <link href="navtree.css" rel="stylesheet" type="text/css"/>
  13. <script type="text/javascript" src="resize.js"></script>
  14. <script type="text/javascript" src="navtreedata.js"></script>
  15. <script type="text/javascript" src="navtree.js"></script>
  16. <link href="search/search.css" rel="stylesheet" type="text/css"/>
  17. <script type="text/javascript" src="search/searchdata.js"></script>
  18. <script type="text/javascript" src="search/search.js"></script>
  19. <link href="doxygen.css" rel="stylesheet" type="text/css" />
  20. </head>
  21. <body>
  22. <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
  23. <div id="titlearea">
  24. <table cellspacing="0" cellpadding="0">
  25. <tbody>
  26. <tr style="height: 56px;">
  27. <td id="projectalign" style="padding-left: 0.5em;">
  28. <div id="projectname">Qwt User&#39;s Guide
  29. &#160;<span id="projectnumber">6.1.6</span>
  30. </div>
  31. </td>
  32. </tr>
  33. </tbody>
  34. </table>
  35. </div>
  36. <!-- end header part -->
  37. <!-- Generated by Doxygen 1.8.20 -->
  38. <script type="text/javascript">
  39. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  40. var searchBox = new SearchBox("searchBox", "search",false,'Search');
  41. /* @license-end */
  42. </script>
  43. <script type="text/javascript" src="menudata.js"></script>
  44. <script type="text/javascript" src="menu.js"></script>
  45. <script type="text/javascript">
  46. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  47. $(function() {
  48. initMenu('',true,false,'search.php','Search');
  49. $(document).ready(function() { init_search(); });
  50. });
  51. /* @license-end */</script>
  52. <div id="main-nav"></div>
  53. </div><!-- top -->
  54. <div id="side-nav" class="ui-resizable side-nav-resizable">
  55. <div id="nav-tree">
  56. <div id="nav-tree-contents">
  57. <div id="nav-sync" class="sync"></div>
  58. </div>
  59. </div>
  60. <div id="splitbar" style="-moz-user-select:none;"
  61. class="ui-resizable-handle">
  62. </div>
  63. </div>
  64. <script type="text/javascript">
  65. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  66. $(document).ready(function(){initNavTree('qwtinstall.html',''); initResizable(); });
  67. /* @license-end */
  68. </script>
  69. <div id="doc-content">
  70. <!-- window showing the filter options -->
  71. <div id="MSearchSelectWindow"
  72. onmouseover="return searchBox.OnSearchSelectShow()"
  73. onmouseout="return searchBox.OnSearchSelectHide()"
  74. onkeydown="return searchBox.OnSearchSelectKey(event)">
  75. </div>
  76. <!-- iframe showing the search results (closed by default) -->
  77. <div id="MSearchResultsWindow">
  78. <iframe src="javascript:void(0)" frameborder="0"
  79. name="MSearchResults" id="MSearchResults">
  80. </iframe>
  81. </div>
  82. <div class="PageDoc"><div class="header">
  83. <div class="headertitle">
  84. <div class="title">Installing Qwt </div> </div>
  85. </div><!--header-->
  86. <div class="contents">
  87. <div class="toc"><h3>Table of Contents</h3>
  88. <ul><li class="level1"><a href="#DOWNLOAD">Download</a></li>
  89. <li class="level1"><a href="#INSTALL">Installing Qwt</a><ul><li class="level2"><a href="#CONFIGSUBSECTION">Configuration</a></li>
  90. <li class="level2"><a href="#BUILDSUBSECTION">Build and installation</a><ul><li class="level3"><a href="#qwtinstall-unix">Unix-like systems</a></li>
  91. <li class="level3"><a href="#qwtinstall-windows">Windows</a><ul><li class="level4"><a href="#qwtinstall-windows-mingw">MinGW</a></li>
  92. <li class="level4"><a href="#qwtinstall-windows-msvc">MSVC</a></li>
  93. </ul>
  94. </li>
  95. </ul>
  96. </li>
  97. </ul>
  98. </li>
  99. <li class="level1"><a href="#INTEGRATION">Qwt and the Qt tool chain</a><ul><li class="level2"><a href="#USEPLUGIN">Designer plugin</a></li>
  100. <li class="level2"><a href="#USEHELP">Online Help</a></li>
  101. </ul>
  102. </li>
  103. <li class="level1"><a href="#COMPILEANDLINKAPP">Building a Qwt application</a></li>
  104. <li class="level1"><a href="#RUNAPP">Running a Qwt application</a><ul><li class="level2"><a href="#RUNWINDOWS">Windows</a></li>
  105. <li class="level2"><a href="#RUNLINUX">GNU/Linux</a></li>
  106. </ul>
  107. </li>
  108. </ul>
  109. </div>
  110. <div class="textblock"><h1><a class="anchor" id="DOWNLOAD"></a>
  111. Download</h1>
  112. <p>Stable Qwt releases are available from the Qwt <a href="https://sourceforge.net/projects/qwt/files/qwt">project page</a>.</p>
  113. <p>Qwt-6.1.6 consists of 4 files:</p>
  114. <ul>
  115. <li>qwt-6.1.6.zip<br />
  116. Zip file with the Qwt sources and the html documentation for Windows</li>
  117. <li>qwt-6.1.6.tar.bz2<br />
  118. Compressed tar file with the Qwt sources and the html documentation for UNIX systems ( Linux, Mac, ... )</li>
  119. <li>qwt-6.1.6.pdf<br />
  120. Qwt documentation as PDF document.</li>
  121. <li>qwt-6.1.6.qch<br />
  122. Qwt documentation as Qt Compressed Help document, that can be loaded into the Qt Assistant or Creator. In the Qt Creator context sensitive help will be available like for Qt classes.</li>
  123. </ul>
  124. <p>Precompiled Qwt Designer plugins, that are compatible with some binary packages of the Qt Creator:</p>
  125. <ul>
  126. <li>qwtdesigner-6.1.6-*.zip</li>
  127. </ul>
  128. <h1><a class="anchor" id="INSTALL"></a>
  129. Installing Qwt</h1>
  130. <p>Beside headers, libraries and the html version of the class documentation a proper Qwt installation contains a Designer plugin and a Qwt features file for building applications using Qwt.</p>
  131. <p>All files will be copied to an installation directory, that is configurable by editing qwtconfig.pri. Its default settings is:</p>
  132. <ul>
  133. <li>Windows<br />
  134. C:\Qwt-6.1.6</li>
  135. <li>Unix like systems<br />
  136. /usr/local/qwt-6.1.6</li>
  137. </ul>
  138. <p>For the rest of the document this install path will be written as <em>${QWT_ROOT}</em> and needs to be replaced by the real path in all commands below.</p>
  139. <p>It is not unlikely, to have more than one installation of Qwt on the same system. F.e for using the Qwt Designer plugin in the Qt Creator a version of Qwt is necessary with the same Qt and compiler combination, that had been used for building the Qt Creator ( see "Help-&gt;About Qt Creator ..." ).</p>
  140. <p>Installing Qwt is done in 3 steps, that are quite common on UNIX systems.</p>
  141. <ol type="1">
  142. <li>Configuration<br />
  143. In the configuration step all parameters are set to control how to build and install Qwt</li>
  144. <li>Build<br />
  145. In the build step binaries are built from the source files.</li>
  146. <li>Installation<br />
  147. The installation copies and rearranges all files that are necessary to build Qwt applications to a target directory.</li>
  148. </ol>
  149. <p>The installation doesn't modify the system beside copying files to a directory in a proper way. After removing build and installation directories the system is in the same state as it was before.</p>
  150. <h2><a class="anchor" id="CONFIGSUBSECTION"></a>
  151. Configuration</h2>
  152. <p>Configuring Qwt has to be done by editing the Project files used for building:</p>
  153. <ul>
  154. <li>qwtbuild.pri<br />
  155. qwtbuild.pri contains settings for how to build Qwt. All settings of this file are only for building Qwt itself and doesn't have an impact on how an application using Qwt is built. Usually its default settings doesn't need to be modified.</li>
  156. <li>qwtconfig.pri<br />
  157. qwtconfig.pri defines what modules of Qwt will be built and where to install them. qwtconfig.pri gets installed together with the Qwt features file qwt.prf and all its settings are known to project files for building Qwt applications.</li>
  158. </ul>
  159. <p>In qwtconfig.pri the meaning of each option is explained in detail - it's worth reading it before running into problems later.</p>
  160. <h2><a class="anchor" id="BUILDSUBSECTION"></a>
  161. Build and installation</h2>
  162. <p>The Qt Creator is a graphical frontend for calling qmake/make and - technically - it could be used for building and installing Qwt. But as this way requires a lot more understanding of details the following step by step instructions are for the easier way using the command line.</p>
  163. <h3><a class="anchor" id="qwtinstall-unix"></a>
  164. Unix-like systems</h3>
  165. <p>The first step before creating the Makefile is to check that the correct version of qmake is used. F.e. on older Linux distribution you often find a Qt3 qmake and in the path.</p>
  166. <p>The default setting of qmake is to generate a makefile that builds Qwt for the same environment where the version of qmake has been built for. So creating a makefile usually means something like:</p>
  167. <div class="fragment"><div class="line">cd qwt-6.1.6</div>
  168. <div class="line">/usr/local/Qt-5.0.1/bin/qmake qwt.pro</div>
  169. </div><!-- fragment --><p>The generated Makefile includes all paths related to the chosen Qt version and the next step is:</p>
  170. <div class="fragment"><div class="line">make</div>
  171. </div><!-- fragment --><p> ( On multicore systems you can speed up building the Qwt libraries with running several jobs simultaneously: f.e. "make -j4" on a dual core. )</p>
  172. <p>Finally you have to install everything below the directories you have specified in qwtconfig.pri. Usually this is one of the system directories ( /usr/local, /opt, ... ) where you don't have write permission and then the installation needs to be done as root:</p>
  173. <div class="fragment"><div class="line">sudo make install</div>
  174. </div><!-- fragment --><p> ( On systems where sudo is not supported you can do the same with: su -c "make install" )</p>
  175. <h3><a class="anchor" id="qwtinstall-windows"></a>
  176. Windows</h3>
  177. <p>Qt packages offer a command line interface, that can be found in the Qt application menu: f.e "All Programs -&gt; Qt -&gt; Command Prompt". It is not mandatory to use it, but probably the easiest way as it offers an environment, where everything is initialized for a version of Qt ( f.e qmake is in the PATH ).</p>
  178. <p>Creating a makefile usually means something like:</p>
  179. <div class="fragment"><div class="line">cd qwt-6.1.6</div>
  180. <div class="line">qmake qwt.pro</div>
  181. </div><!-- fragment --><p>The generated makefile includes all paths related to the chosen Qt version.</p>
  182. <h4><a class="anchor" id="qwtinstall-windows-mingw"></a>
  183. MinGW</h4>
  184. <p>For MinGW builds the name of the make tool is "mingw32-make"</p>
  185. <div class="fragment"><div class="line">mingw32-make</div>
  186. </div><!-- fragment --><p> ( On multicore systems you can speed up building the Qwt libraries with running several jobs simultaneously: "mingw32-make -j" )</p>
  187. <p>Finally you have to install everything below the directories you have specified in qwtconfig.pri.</p>
  188. <div class="fragment"><div class="line">mingw32-make install</div>
  189. </div><!-- fragment --><h4><a class="anchor" id="qwtinstall-windows-msvc"></a>
  190. MSVC</h4>
  191. <p>For MSVC builds the name of the make tool is "nmake". Alternatively it is possible to use "jom" ( <a href="https://wiki.qt.io/Jom">https://wiki.qt.io/Jom</a> ), that is usually included in a Qt Creator package.</p>
  192. <div class="fragment"><div class="line">nmake</div>
  193. </div><!-- fragment --><p>Finally you have to install everything below the directories you have specified in qwtconfig.pri.</p>
  194. <div class="fragment"><div class="line">nmake install</div>
  195. </div><!-- fragment --><h1><a class="anchor" id="INTEGRATION"></a>
  196. Qwt and the Qt tool chain</h1>
  197. <h2><a class="anchor" id="USEPLUGIN"></a>
  198. Designer plugin</h2>
  199. <p>The Designer plugin and the corresponding Qwt library ( if the plugin has not been built self containing ) have to be compatible with Qt version of the application loading it ( usually the Qt Creator ) - what is often a different version of the Qt libraries you want to build your application with. F.e on Windows the Qt Creator is usually built with a MSVC compiler - even if included in a MinGW package !</p>
  200. <p>To help Qt Designer/Creator with locating the Qwt Designer plugin you have to set the environment variable QT_PLUGIN_PATH, modify qt.conf - or install the plugin to one of the application default paths.</p>
  201. <p>The Qt documentation explains all options in detail:</p>
  202. <ul>
  203. <li><a href="https://doc.qt.io/qt-5/deployment-plugins.html">https://doc.qt.io/qt-5/deployment-plugins.html</a></li>
  204. <li><a href="https://doc.qt.io/qtcreator/adding-plugins.html">https://doc.qt.io/qtcreator/adding-plugins.html</a></li>
  205. </ul>
  206. <p>F.e. on a Linux system you could add the following lines to .bashrc:</p>
  207. <div class="fragment"><div class="line">QT_PLUGIN_PATH=<span class="stringliteral">&quot;${QWT_ROOT}/plugins:$QT_PLUGIN_PATH&quot;</span></div>
  208. <div class="line">export QT_PLUGIN_PATH</div>
  209. </div><!-- fragment --><p>When the plugin has not been built including the Qwt library ( see QwtDesignerSelfContained in qwtconfig.pri ) the Qt Designer/Creator also needs to locate the Qwt libraries. On Unix systems the path to the installed library is compiled into the plugin ( see rpath, ldd ), but on Windows the Qt Creator needs to be configured ( ( <a class="el" href="qwtinstall.html#RUNAPP">Running a Qwt application</a> ) in the same way as for any application using Qwt.</p>
  210. <p>In case of problems the diagnostics of Qt Creator and Designer are very limited ( usually none ), but setting the environment variable QT_DEBUG_PLUGINS might help. In the Qt Creator it is possible to check which plugins were loaded successfully and for certain problems it also lists those that were recognized but failed ( <em>Tools &gt; Form Editor &gt; About Qt Designer Plugins</em> ).</p>
  211. <h2><a class="anchor" id="USEHELP"></a>
  212. Online Help</h2>
  213. <p>The Qwt class documentation can be loaded into the Qt Creator:</p>
  214. <ul>
  215. <li>open the settings dialog from the <em>Tools-&gt;Options</em> menu</li>
  216. <li>raise the tab "Help-&gt;Documentation".</li>
  217. <li>press the <em>Add</em> button and select qwt-6.1.6.qch.</li>
  218. </ul>
  219. <p>Now the context sensitive help ( <em>F1</em> ) works for Qwt classes.</p>
  220. <p>For browsing the documentation in the Qt Assistant:</p>
  221. <ul>
  222. <li>open the settings dialog from the <em>Edit-&gt;Preferences</em> menu</li>
  223. <li>raise the tab <em>Documentation</em>.</li>
  224. <li>press the <em>Add</em> button and select qwt-6.1.6.qch.</li>
  225. </ul>
  226. <h1><a class="anchor" id="COMPILEANDLINKAPP"></a>
  227. Building a Qwt application</h1>
  228. <p>All flags and settings that are necessary to compile and link an application using Qwt can be found in the file ${QWT_ROOT}/features/qwt.prf.</p>
  229. <p>When using qmake it can included from the application project file in 2 different ways:</p>
  230. <ul>
  231. <li><p class="startli">Adding Qwt as qmake feature<br />
  232. <br />
  233. When using the qmake feature mechanism you can bind a special version of qmake to a special installation of Qwt without having to add this dependency to the application project. How to add Qwt as feature is documented in the <a href="http://doc.qt.io/qt-5/qmake-advanced-usage.html#adding-new-configuration-features">qmake docs</a>.</p>
  234. <p class="startli">After adding Qwt as a feature f.e on Linux as a persistent property .... </p><div class="fragment"><div class="line">qmake -set QMAKEFEATURES ${QWT_ROOT}/features</div>
  235. </div><!-- fragment --><p> .. the following line can be added to the application project file: </p><div class="fragment"><div class="line">CONFIG += qwt</div>
  236. </div><!-- fragment --></li>
  237. <li>Including qwt.prf in the application project file<br />
  238. <br />
  239. Instead of using qwt.prf as qmake feature it can be included from the application project file:<br />
  240. <br />
  241. <div class="fragment"><div class="line">include ( ${QWT_ROOT}/features/qwt.prf )</div>
  242. </div><!-- fragment --> <br />
  243. The advantage of using a direct include is, that all settings of qwt.prf are known to the application project file ( qmake features are included after the application project file has been parsed ) and it can be implemented depending on - f.e. settings made in qwtconfig.pri.</li>
  244. </ul>
  245. <p>On Unix platforms it is possible to link a runtime path into the executable, so that the location of the Qwt libraries can be found without having to configure a runtime environment:</p><ul>
  246. <li><a href="/https://doc.qt.io/qt-5/qmake-variable-reference.html#qmake-lflags-rpath">QMAKE_LFLAGS_RPATH</a></li>
  247. <li><a href="/https://doc.qt.io/qt-5/qmake-variable-reference.html#qmake-rpath">QMAKE_RPATH</a></li>
  248. <li><a href="/https://doc.qt.io/qt-5/qmake-variable-reference.html#qmake-rpathdir">QMAKE_RPATHDIR</a></li>
  249. </ul>
  250. <h1><a class="anchor" id="RUNAPP"></a>
  251. Running a Qwt application</h1>
  252. <p>When using Qwt as shared library ( DLL ) the <a href="http://en.wikipedia.org/wiki/Dynamic_linker">dynamic linker</a> has to find it according to the rules of the operating system.</p>
  253. <h2><a class="anchor" id="RUNWINDOWS"></a>
  254. Windows</h2>
  255. <p>The only reasonable way to configure the runtime environment - without having to copy the Qwt libraries around - is to modify the PATH variable. F.e. this could be done by adding the following line to some batch file:</p>
  256. <div class="fragment"><div class="line">set PATH=%PATH%;${QWT_ROOT}\lib</div>
  257. </div><!-- fragment --><h2><a class="anchor" id="RUNLINUX"></a>
  258. GNU/Linux</h2>
  259. <p>Read the documentation about:</p>
  260. <ul>
  261. <li><em>ldconfig</em></li>
  262. <li><em>/etc/ld.so.conf</em></li>
  263. <li><em>LD_LIBRARY_PATH</em></li>
  264. </ul>
  265. <p>Using the <em>ldd</em> command a configuration can be tested. </p>
  266. </div></div><!-- contents -->
  267. </div><!-- PageDoc -->
  268. </div><!-- doc-content -->
  269. <!-- start footer part -->
  270. <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  271. <ul>
  272. <li class="footer">Generated by <a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.8.20 </li>
  273. </ul>
  274. </div>
  275. </body>
  276. </html>