Difference between revisions of "Slicer3:Developers:Projects:QtSlicer/Tutorials/QtDesigner"

From Slicer Wiki
Jump to: navigation, search
(Move from Slicer3 to Slicer4)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
[[Slicer3:Developers:Projects:QtSlicer|QtSlicer]]/[[Slicer3:Developers:Projects:QtSlicer/Tutorials|Tutorials]]←
+
This page has moved to [[Slicer4:Developers:Projects:QtSlicer/Tutorials/QtDesigner|QtDesigner for Slicer4]]
=Using custom widgets in Qt Designer=
 
==Straight to the point==
 
*Windows
 
**Compile Slicer in Release mode
 
**Double clic on <i>Designer-Release.py</i> located in <i>Slicer3-build</i>
 
*Others
 
<pre>
 
cd Slicer3-build;
 
python Designer.py
 
</pre>
 
 
 
==Qt Designer requirements==
 
In order to have the CTK and MRML widgets in Qt Designer, Qt Designer offers 2 options. The first (not detailed here) is to copy (or symlink) the CTK and MRML plugin libraries into <i>%QT_DIR%/plugins/designer</i>, the second is to set the environment variable <code>QT_PLUGIN_PATH</code> to the directory <i>Slicer3-build/bin</i> containing the subdirectory <i>designer</i> with the plugin libraries.<br>
 
'''Note:''' Qt requires that the directory containing the designer plugins is named "designer".<br>
 
Moreover, Qt Designer can only load plugins that have been compiled in the same build mode than Qt Designer. For example, if Qt is built in Debug mode, the plugins must also be built in Debug mode to be loaded by Qt Designer.<br>
 
'''Note:''' If Qt is configured to build in both debug and release modes, Qt Designer is built in release mode only. If that case, it is necessary to ensure that plugins are also built in release mode.
 
 
 
==Running Qt Designer with the correct environment variables==
 
*Compile Slicer in the same build mode than Qt. If Qt is in Debug mode, compile Slicer in Debug mode, if it's in Release or Debug&Release mode, compile Slicer in Release mode.
 
*run Qt Designer by executing the python script <i>Designer.py</i> located in <i>Slicer3-build</i>.
 
<pre>
 
cd Slicer3-build;
 
python Designer.py
 
</pre>
 
'''Note:''' For MS Visual Studio users, there is a <i>Designer</i> python script for each build mode. Execute the script according to the build mode.
 
'''Note:''' <i>Designer.py</i> can take a <i>.ui</i> file as an argument, it will load it into Qt designer.
 
{|
 
|[[Image:Screenshot-Qt Designer.png|thumb|300px|Qt Desginer loaded with qCTKWidgets and qMRMLWidgets]]
 
|}
 
*Another option is to manually set QT_PLUGIN_PATH into your environment. If you decide to go that direction, make sure that the PATH environment variable contains the path of all the libraries the qt designer plugins depends on (add <i>Slicer3-build/bin</i>).
 

Latest revision as of 07:10, 16 January 2011

Home < Slicer3:Developers:Projects:QtSlicer < Tutorials < QtDesigner

This page has moved to QtDesigner for Slicer4