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

From Slicer Wiki
Jump to: navigation, search
(Replaced content with 'QtSlicer/Tutorials← = Building Slicer with Qt = '''Note: See [[Slicer4:Build_…')
 
(25 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
[[Slicer3:Developers:Projects:QtSlicer|QtSlicer]]/[[Slicer3:Developers:Projects:QtSlicer/Tutorials|Tutorials]]←
 
[[Slicer3:Developers:Projects:QtSlicer|QtSlicer]]/[[Slicer3:Developers:Projects:QtSlicer/Tutorials|Tutorials]]←
 
= Building Slicer with Qt =
 
= Building Slicer with Qt =
 
+
'''Note: See [[Slicer4:Build_Instructions|the Slicer4 build instructions]] for the latest information on building 3D Slicer with a Qt user interfaceThis page is no longer used (to access previous information consult this page's history tab).'''
* [http://qt.nokia.com/downloads Download and install Qt].  As of winter 2009, get the [http://qt.nokia.com/doc/4.6/qt4-6-intro.html 4.6 version].
 
** Windows - need to get [http://qt.nokia.com/downloads source code]. On the LGPL tab, select the source code download page for windows and visual studio 2008, and note that there is a link below where you can download the [http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.6.0.zip source code in a zip archive].
 
*** launch the msvc2008 command prompt (MSVC08 Tools->Visual Studio 2008 CommandPrompt)
 
*** build with <code>configure.exe -platform win32-msvc2008</code> Note: if you are compiling Slicer in Debug mode, please add the -debug argument to the command line above to generate a compatible build; Release is the default.(according to [http://qt.nokia.com/doc/4.6/supported-platforms.html] Qt does not support msvc2008 on windows xp.  However, running configure.exe with no -platform argument seems to work.) It's also useful to give configure.exe the -prefix command with the path to Slicer3-lib/Qt-build.
 
*** run <code>vcvars32.bat</code> first
 
*** and then <code>nmake</code>.
 
*** building with webkit support requires that <i>src/3rdparty/webkit/WebCore/tmp/moc/{debug,release}_shared/mocinclude.tmp</i> be removed. else you will get linker errors like <code>QNetworkReplyHandler.obj : error LNK2001: unresolved external symbol "public: virtual struct QMetaObject const * __thiscall WebCore::FormDataIODevice::metaObject(void)const (?metaObject@FormDataIODevice@WebCore@@UBEPBUQMetaObject@@XZ)</code>
 
*** If you encounter the following error <code>api\qscriptextensionplugin.h(43): Error: Undefined interface,</code>, delete the files <i>\src\script\tmp\moc\debug_shared\mocinclude.tmp</i> and <i>\src\script\tmp\moc\release_shared\mocinclude.tmp</i> and restart nmake. For more info, please see [http://bugreports.qt.nokia.com/browse/QTBUG-6470 QTBug 6470]].
 
*** Note: Using the Qt Designer on Windows requires that the Slicer widget plugins are compiled in the same mode than Qt. If Qt is compiled in Release mode (default), Slicer must be compiled in Release. If Qt is compiled in Debug mode only, Slicer must be compiled in Debug. (however if Qt is in Release and Debug, Slicer must be in Release).
 
** Linux/Mac - install full QtCreator package (use "-arch x86_64" for a 64 bit build on snowleopard)
 
<pre>
 
cd Slicer3-lib
 
mkdir Qt
 
mkdir Qt-build
 
cd Qt
 
wget http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.6.0.tar.gz
 
tar xvfz qt-everywhere-opensource-src-4.6.0.tar.gz
 
cd qt-everywhere-opensource-src-4.6.0
 
echo yes | ./configure -prefix ../../Qt-build -debug-and-release -opensource -no-qt3support
 
make -j 16
 
make install
 
</pre>
 
* Build VTK with Qt enabled
 
<pre>
 
cd ../../VTK-build
 
../CMake-build/bin/ccmake .
 
Press 't' to enter advanced mode.
 
VTK_USE_GUISUPPORT to ON
 
Press 'c' to configure.
 
VTK_USE_QVTK to ON
 
Press 'c' to configure.
 
DESIRED_QT_VERSION to 4
 
Press 'c' to configure.
 
QT_QMAKE_EXECUTABLE to {path to}/Slicer3-lib/Qt-build/bin/qmake
 
Press 'c' to configure.
 
Press 'g' to generate
 
make -j16
 
</pre>
 
* Build Slicer with Qt enabled.
 
<pre>
 
cd ../../Slicer3-build
 
../Slicer3-lib/CMake-build/bin/ccmake .
 
Slicer3_USE_QT ON
 
Press 'c' to configure
 
QT_QMAKE_EXECUTABLE to {path to}/Slicer3-lib/Qt-build/bin/qmake
 
Press 'c' to configure and then press 'g' to generate.
 
make -j16
 
</pre>
 
 
 
= Useful links for Qt =
 
* [http://qt.nokia.com/doc/4.6/index.html Documentation]
 
* [http://qt.nokia.com/doc/4.6/how-to-learn-qt.html First steps]
 
* [http://qt.nokia.com/doc/4.6/tutorials.html Tutorials]
 
* [http://qt.nokia.com/doc/4.6/examples.html Examples]
 

Latest revision as of 17:41, 11 June 2010

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

QtSlicer/Tutorials

Building Slicer with Qt

Note: See the Slicer4 build instructions for the latest information on building 3D Slicer with a Qt user interface. This page is no longer used (to access previous information consult this page's history tab).