Difference between revisions of "Documentation/4.0/Developers/Tutorials/QtDesigner"

From Slicer Wiki
Jump to: navigation, search
(Move from Slicer3 to Slicer4)
 
m (Move from Slicer3 to Slicer4)
Line 1: Line 1:
[[Slicer3:Developers:Projects:QtSlicer|QtSlicer]]/[[Slicer3:Developers:Projects:QtSlicer/Tutorials|Tutorials]]←
+
[[Slicer4:QtPort|QtSlicer]]/[[Slicer4:QtPort/Tutorials|Tutorials]]←
 
=Using custom widgets in Qt Designer=
 
=Using custom widgets in Qt Designer=
 
==Straight to the point==
 
==Straight to the point==

Revision as of 07:10, 16 January 2011

Home < Documentation < 4.0 < Developers < Tutorials < QtDesigner

QtSlicer/Tutorials

Using custom widgets in Qt Designer

Straight to the point

  • Windows
    • Compile Slicer in Release mode
    • Double clic on Designer-Release.py located in Slicer3-build
  • Others
cd Slicer-build;
Slicer4 --launch designer

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 %QT_DIR%/plugins/designer, the second is to set the environment variable QT_PLUGIN_PATH to the directory Slicer3-build/bin containing the subdirectory designer with the plugin libraries.
Note: Qt requires that the directory containing the designer plugins is named "designer".
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.
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 via Slicer launcher located in Slicer-build.
cd Slicer-build;
Slicer4 --designer

Note: For MS Visual Studio users, there is a Designer python script for each build mode. Execute the script according to the build mode. Note: Designer.py can take a .ui file as an argument, it will load it into Qt designer.

Qt Desginer loaded with CTKWidgets and qMRMLWidgets