<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.slicer.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Phcerdan</id>
	<title>Slicer Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://www.slicer.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Phcerdan"/>
	<link rel="alternate" type="text/html" href="https://www.slicer.org/wiki/Special:Contributions/Phcerdan"/>
	<updated>2026-04-03T21:28:14Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.33.0</generator>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/ITK4-to-ITK5&amp;diff=60936</id>
		<title>Documentation/Nightly/Developers/Tutorials/MigrationGuide/ITK4-to-ITK5</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/ITK4-to-ITK5&amp;diff=60936"/>
		<updated>2019-03-22T16:52:53Z</updated>

		<summary type="html">&lt;p&gt;Phcerdan: /* Transition from ITK4 to ITK5 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Transition from ITK4 to ITK5==&lt;br /&gt;
This section lists categories of code changes necessary to build Slicer with ITK 5. Each category has a short description, an example error message, a suggested upgrade path, and references to relevant commits.&lt;br /&gt;
&lt;br /&gt;
Referencing this list might be helpful if Slicer extensions requiring updates to be compatible with ITK 5.&lt;br /&gt;
&lt;br /&gt;
Make also sure to read through the [https://github.com/InsightSoftwareConsortium/ITK/blob/master/Documentation/ITK5MigrationGuide.md ITK 5 migration guide].&lt;br /&gt;
&lt;br /&gt;
[https://github.com/InsightSoftwareConsortium/ITK/tree/master/Utilities/ITKv5Preparation Utilities/ITKv5Preparation] directory contains bash scripts which have been used to update ITK to version 5. These scripts can assist with updating external code bases to ITK 5 content and style.&lt;br /&gt;
&lt;br /&gt;
===Upgrading to ITKv5 or keep using ITKv4 GenerateThreadedData===&lt;br /&gt;
If the ThreadedGenerateData does not use threadId, change the name of the function to DynamicThreadedGenerateData&lt;br /&gt;
Replace:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  void ThreadedGenerateData( const OutputRegionType&amp;amp; threadRegion, ThreadIdType threadId )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
with: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  void DynamicThreadedGenerateData( const OutputRegionType&amp;amp; threadRegion )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to keep using the ITKv4 thread system (with ThreadedGenerateData), add to the constructor of your ITK class:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  this-&amp;gt;DynamicMultiThreadingOff();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===itkMultiThreader refactor===&lt;br /&gt;
&lt;br /&gt;
Replace lines like:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  #include &amp;lt;itkMultiThreader.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  itk::MultiThreader::Pointer ProcessingThreader;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  #include &amp;lt;itkPlatformMultiThreader.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  itk::PlatformMultiThreader::Pointer ProcessingThreader;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SimpleFastMutexLock, FastMutexLock and MutexLock are deprecated===&lt;br /&gt;
&lt;br /&gt;
Instead use &amp;lt;tt&amp;gt;std::mutex&amp;lt;/tt&amp;gt; available in C++11&lt;br /&gt;
&lt;br /&gt;
Replace:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  #include &amp;quot;itkSimpleFastMutexLock.h&amp;quot;&lt;br /&gt;
  #include &amp;quot;itkFastMutexLock.h&amp;quot;&lt;br /&gt;
  #include &amp;quot;itkMutexLock.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  SimpleFastMutexLock&lt;br /&gt;
  FastMutexLock&lt;br /&gt;
  MutexLock&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  #include &amp;lt;mutex&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  std::mutex&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Phcerdan</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/ITK4-to-ITK5&amp;diff=60935</id>
		<title>Documentation/Nightly/Developers/Tutorials/MigrationGuide/ITK4-to-ITK5</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/ITK4-to-ITK5&amp;diff=60935"/>
		<updated>2019-03-22T16:23:39Z</updated>

		<summary type="html">&lt;p&gt;Phcerdan: /* Transition from ITK4 to ITK5 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Transition from ITK4 to ITK5==&lt;br /&gt;
This section lists categories of code changes necessary to build Slicer with ITK 5. Each category has a short description, an example error message, a suggested upgrade path, and references to relevant commits.&lt;br /&gt;
&lt;br /&gt;
Referencing this list might be helpful if Slicer extensions requiring updates to be compatible with ITK 5.&lt;br /&gt;
&lt;br /&gt;
Make also sure to read through the [https://github.com/InsightSoftwareConsortium/ITK/blob/master/Documentation/ITK5MigrationGuide.md ITK 5 migration guide].&lt;br /&gt;
&lt;br /&gt;
===Upgrading to ITKv5 or keep using ITKv4 GenerateThreadedData===&lt;br /&gt;
If the ThreadedGenerateData does not use threadId, change the name of the function to DynamicThreadedGenerateData&lt;br /&gt;
Replace:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  void ThreadedGenerateData( const OutputRegionType&amp;amp; threadRegion, ThreadIdType threadId )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
with: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  void DynamicThreadedGenerateData( const OutputRegionType&amp;amp; threadRegion )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to keep using the ITKv4 thread system (with ThreadedGenerateData), add to the constructor of your ITK class:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  this-&amp;gt;DynamicMultiThreadingOff();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===itkMultiThreader refactor===&lt;br /&gt;
&lt;br /&gt;
Replace lines like:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  #include &amp;lt;itkMultiThreader.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  itk::MultiThreader::Pointer ProcessingThreader;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  #include &amp;lt;itkPlatformMultiThreader.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  itk::PlatformMultiThreader::Pointer ProcessingThreader;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SimpleFastMutexLock, FastMutexLock and MutexLock are deprecated===&lt;br /&gt;
&lt;br /&gt;
Instead use &amp;lt;tt&amp;gt;std::mutex&amp;lt;/tt&amp;gt; available in C++11&lt;br /&gt;
&lt;br /&gt;
Replace:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  #include &amp;quot;itkSimpleFastMutexLock.h&amp;quot;&lt;br /&gt;
  #include &amp;quot;itkFastMutexLock.h&amp;quot;&lt;br /&gt;
  #include &amp;quot;itkMutexLock.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  SimpleFastMutexLock&lt;br /&gt;
  FastMutexLock&lt;br /&gt;
  MutexLock&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  #include &amp;lt;mutex&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  std::mutex&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Phcerdan</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Labs&amp;diff=60926</id>
		<title>Documentation/Labs</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Labs&amp;diff=60926"/>
		<updated>2019-03-16T22:03:54Z</updated>

		<summary type="html">&lt;p&gt;Phcerdan: /* Compilers &amp;amp; IDE */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the place where we will keep track of our experiments and projects.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= On-going =&lt;br /&gt;
&lt;br /&gt;
== Roadmap ==&lt;br /&gt;
* [[{{FULLPAGENAME}}/Slicer5-roadmap|Slicer 5]]&lt;br /&gt;
&lt;br /&gt;
== Internals ==&lt;br /&gt;
* [[{{FULLPAGENAME}}/NrrdReading_Writing_Optimizations|NrrdReading_Writing_Optimizations]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/OpenGLFilters|OpenGLFilters]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/DeprecatedModules|DeprecatedModules extension]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/FHSCompliantDirectoryStructure|FHS compliant directory structure]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/FiberTractMeasurementAndVisualization|Fiber Tract measurement and visualization]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/VTKWidgets|VTK Widgets improvements]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/CLIInfrastructureCleanupAndRefactoring|CLI infrastructure cleanup and refactoring]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/UpgradingCompilerInfrastructure|Upgrading Compiler Infrastructure]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/ViewInfrastructureImprovements| View Infrastructure Improvements]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/CDash Improvements|CDash Improvements]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/SlicerBridge|SlicerBridge]]&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
* [[{{FULLPAGENAME}}/Display2dText|Display 2D text in viewers]]&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* [[{{FULLPAGENAME}}/CI-and-NightlyPackagesGeneration|Continuous Integration and Nightly packages build infrastructure]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/ParameterSerializer|Parameter Serializer support for CLIs]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/Augmented Reality and Virtual Reality support|Augmented Reality and Virtual Reality support]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/Infrastucture Status|Infrastucture Status]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/Improving Slicer Packages Download Experience|Improving Slicer Packages Download experience]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/Sequences|Sequences]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/Improving Markups|Improving Markups]]&lt;br /&gt;
&lt;br /&gt;
== Libraries ==&lt;br /&gt;
* [[{{FULLPAGENAME}}/VTK-Orientation|Design: Addition of orientation to VTK data structures]]&lt;br /&gt;
&lt;br /&gt;
== Python ==&lt;br /&gt;
* [[{{FULLPAGENAME}}/CallingPythonMethodsFromCpp|Calling Python methods from Cpp]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/IPython|IPython]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/PythonCondaBuild|Python conda build]]&lt;br /&gt;
&lt;br /&gt;
== Compilers &amp;amp; IDE ==&lt;br /&gt;
* Modernize to c++11&lt;br /&gt;
&lt;br /&gt;
'''The use of auto''' &lt;br /&gt;
&lt;br /&gt;
  run-clang-tidy.py -checks=-*,modernize-use-auto  -header-filter=.* -fix &lt;br /&gt;
&lt;br /&gt;
The automatic fix use auto in cases where static_cast is used:&lt;br /&gt;
&lt;br /&gt;
  - int a = static_cast&amp;lt;int&amp;gt;(something);&lt;br /&gt;
  + auto a = static_cast&amp;lt;int&amp;gt;(something);&lt;br /&gt;
&lt;br /&gt;
No much gain on this particular case, however, when using iterators and other verbose types, it really helps readability.&lt;br /&gt;
&lt;br /&gt;
The change should be discussed with the main developers to reach a consensus. VTK and ITK are using auto in a lot of cases.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Move not implemented constructors and assignment operators to the public interface''' &lt;br /&gt;
&lt;br /&gt;
Now that we use = delete, we don't need the constructors and assignment operator to be in the private interface.&lt;br /&gt;
Moving them to the public interface is better. Including better integrations with IDE's.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Other modernizers'''&lt;br /&gt;
  clang-tidy --list-checks -checks='*' | grep &amp;quot;modernize&amp;quot;&lt;br /&gt;
    modernize-avoid-bind&lt;br /&gt;
    modernize-deprecated-headers&lt;br /&gt;
    modernize-loop-convert&lt;br /&gt;
    modernize-make-shared&lt;br /&gt;
    modernize-make-unique&lt;br /&gt;
    modernize-pass-by-value&lt;br /&gt;
    modernize-raw-string-literal&lt;br /&gt;
    modernize-redundant-void-arg&lt;br /&gt;
    modernize-replace-auto-ptr&lt;br /&gt;
    modernize-replace-random-shuffle&lt;br /&gt;
    modernize-return-braced-init-list&lt;br /&gt;
    modernize-shrink-to-fit&lt;br /&gt;
    modernize-unary-static-assert&lt;br /&gt;
    modernize-use-auto # ToDiscuss&lt;br /&gt;
    modernize-use-bool-literals&lt;br /&gt;
    modernize-use-default-member-init&lt;br /&gt;
    modernize-use-emplace # easy!&lt;br /&gt;
    modernize-use-equals-default # DONE&lt;br /&gt;
    modernize-use-equals-delete # DONE&lt;br /&gt;
    modernize-use-noexcept &lt;br /&gt;
    modernize-use-nullptr # DONE&lt;br /&gt;
    modernize-use-override # DONE&lt;br /&gt;
    modernize-use-transparent-functors&lt;br /&gt;
    modernize-use-uncaught-exceptions&lt;br /&gt;
    modernize-use-using # Better style, to discuss.&lt;br /&gt;
&lt;br /&gt;
Check https://github.com/InsightSoftwareConsortium/ITK/tree/master/Utilities/ITKv5Preparation for a list of commands used in the &lt;br /&gt;
ITKv5 transition.&lt;br /&gt;
&lt;br /&gt;
== Virtual Machines ==&lt;br /&gt;
* [[{{FULLPAGENAME}}/GPU Virtualization|GPU Virtualization]]&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
* [[{{FULLPAGENAME}}/DocumentationImprovments|Documentation Improvements (Wiki, website, ...)]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/ModulesAndEvents|Intermediate documentation for developers]]&lt;br /&gt;
&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
* [[{{FULLPAGENAME}}/IPythonSlicerTutorials|IPython Slicer Tutorials]]&lt;br /&gt;
&lt;br /&gt;
== Source code management ==&lt;br /&gt;
* [[{{FULLPAGENAME}}/TransitionToGit|Transition to Git]]&lt;br /&gt;
&lt;br /&gt;
== Extension ==&lt;br /&gt;
&lt;br /&gt;
* [[{{FULLPAGENAME}}/ExtensionsFrameworkRoadmap|Extensions Framework Roadmap]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/CustomSlicerGenerator|Custom Slicer Generator]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/ExtensionsMetadata|Improving Extensions Metadata]]&lt;br /&gt;
&lt;br /&gt;
== Functionalities ==&lt;br /&gt;
* [[{{FULLPAGENAME}}/FlyThroughNavigation|Fly-through Navigation]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/AutomaticUpdateAndInstallationFramework|Automatic Update and Installation Framework]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/ApplicationUsageAnalytics|Application usage analytics]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/Plotting2DLineSegments|Plotting 2D Line Segments]]&lt;br /&gt;
&lt;br /&gt;
== Packaging ==&lt;br /&gt;
* [[{{FULLPAGENAME}}/HomebrewCask|Homebrew Cask]&lt;br /&gt;
&lt;br /&gt;
= Completed =&lt;br /&gt;
&lt;br /&gt;
* [[Slicer4:Developers|Developer Projects]]&lt;br /&gt;
&lt;br /&gt;
== Extension ==&lt;br /&gt;
* [[{{FULLPAGENAME}}/EasyExtensionContribution|Easy Extension Contribution]] - See [[Documentation/Nightly/Developers/ExtensionWizard|ExtensionWizard]]&lt;br /&gt;
&lt;br /&gt;
== Internals ==&lt;br /&gt;
* [[{{FULLPAGENAME}}/StartupTimeImprovement|Slicer startup time improvement]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/CMake-ified Python|CMake-ified Python]] - See [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=21911 r21911], [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=21912 r21912], [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=21913 r21913]&lt;br /&gt;
* [[{{FULLPAGENAME}}/NonlinearTransforms|Full support for non-linear transforms]]&lt;br /&gt;
&lt;br /&gt;
== Libraries ==&lt;br /&gt;
* [[{{FULLPAGENAME}}/Qt5-and-VTK8|Migration to Qt5 and VTK8]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/OpenCV|Integration with OpenCV]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/ITKv4|ITKv4]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/Qt484|Qt484]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/VTK6|VTK6]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/VTK7|VTK7]]&lt;br /&gt;
&lt;br /&gt;
== Python ==&lt;br /&gt;
* [[{{FULLPAGENAME}}/Pip|Pip]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/DevelopmentWithGit|Development with Git]] - See [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=21863 r21863], [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=21867 r21867], [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=21869 r21869], [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=21879 r21879], [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=21891 r21891]&lt;br /&gt;
* [[{{FULLPAGENAME}}/PythonObserverCallbacks|Python observer callbacks]]&lt;br /&gt;
&lt;br /&gt;
== Compilers &amp;amp; IDE ==&lt;br /&gt;
* [[{{FULLPAGENAME}}/Ninja|Ninja]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/VS2012|VS2012]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/NUMPY171|Support for Numpy 1.7.1]]&lt;br /&gt;
&lt;br /&gt;
== Modules ==&lt;br /&gt;
* [[{{FULLPAGENAME}}/SimpleFilters|Simple Filters]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/Editor|Editor]]&lt;br /&gt;
&lt;br /&gt;
== Tutorials testing ==&lt;br /&gt;
* [[{{FULLPAGENAME}}/TutorialTesting/4.3-Release|4.3 Release]]&lt;br /&gt;
&lt;br /&gt;
== Debug ==&lt;br /&gt;
* [[{{FULLPAGENAME}}/BRAINS_and_ITKv4_issue|BRAINS and ITKv4 issue]]&lt;br /&gt;
&lt;br /&gt;
== Internals ==&lt;br /&gt;
* [[{{FULLPAGENAME}}/Segmentations|Segmentations]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/MultiDimensional Data Management|MultiDimensional Data Management]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/DICOMExport|DICOM Export]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/SliceViewAnnotations|Slice View Annotations]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/SubjectHierarchy|Subject hierarchy module and plugins]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/I18N|Internationalization]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/Units|Units]]&lt;br /&gt;
* [https://github.com/TubeTK/SlicerExecutionModel/wiki/SlicerExecutionModel-Parameter-Serialization SlicerExecutionModel Parameter Serialization]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Abandoned =&lt;br /&gt;
&lt;br /&gt;
* [[{{FULLPAGENAME}}/SlicerConfigAndUseSlicerTweaks|SlicerConfig and UseSlicer Tweaks]]&lt;/div&gt;</summary>
		<author><name>Phcerdan</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Labs&amp;diff=60925</id>
		<title>Documentation/Labs</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Labs&amp;diff=60925"/>
		<updated>2019-03-16T20:44:18Z</updated>

		<summary type="html">&lt;p&gt;Phcerdan: /* Compilers &amp;amp; IDE */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the place where we will keep track of our experiments and projects.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= On-going =&lt;br /&gt;
&lt;br /&gt;
== Roadmap ==&lt;br /&gt;
* [[{{FULLPAGENAME}}/Slicer5-roadmap|Slicer 5]]&lt;br /&gt;
&lt;br /&gt;
== Internals ==&lt;br /&gt;
* [[{{FULLPAGENAME}}/NrrdReading_Writing_Optimizations|NrrdReading_Writing_Optimizations]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/OpenGLFilters|OpenGLFilters]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/DeprecatedModules|DeprecatedModules extension]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/FHSCompliantDirectoryStructure|FHS compliant directory structure]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/FiberTractMeasurementAndVisualization|Fiber Tract measurement and visualization]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/VTKWidgets|VTK Widgets improvements]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/CLIInfrastructureCleanupAndRefactoring|CLI infrastructure cleanup and refactoring]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/UpgradingCompilerInfrastructure|Upgrading Compiler Infrastructure]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/ViewInfrastructureImprovements| View Infrastructure Improvements]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/CDash Improvements|CDash Improvements]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/SlicerBridge|SlicerBridge]]&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
* [[{{FULLPAGENAME}}/Display2dText|Display 2D text in viewers]]&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* [[{{FULLPAGENAME}}/CI-and-NightlyPackagesGeneration|Continuous Integration and Nightly packages build infrastructure]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/ParameterSerializer|Parameter Serializer support for CLIs]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/Augmented Reality and Virtual Reality support|Augmented Reality and Virtual Reality support]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/Infrastucture Status|Infrastucture Status]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/Improving Slicer Packages Download Experience|Improving Slicer Packages Download experience]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/Sequences|Sequences]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/Improving Markups|Improving Markups]]&lt;br /&gt;
&lt;br /&gt;
== Libraries ==&lt;br /&gt;
* [[{{FULLPAGENAME}}/VTK-Orientation|Design: Addition of orientation to VTK data structures]]&lt;br /&gt;
&lt;br /&gt;
== Python ==&lt;br /&gt;
* [[{{FULLPAGENAME}}/CallingPythonMethodsFromCpp|Calling Python methods from Cpp]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/IPython|IPython]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/PythonCondaBuild|Python conda build]]&lt;br /&gt;
&lt;br /&gt;
== Compilers &amp;amp; IDE ==&lt;br /&gt;
* Modernize to c++11&lt;br /&gt;
&lt;br /&gt;
'''The use of auto''' &lt;br /&gt;
&lt;br /&gt;
  run-clang-tidy.py -checks=-*,modernize-use-auto  -header-filter=.* -fix &lt;br /&gt;
&lt;br /&gt;
The automatic fix use auto in cases where static_cast is used:&lt;br /&gt;
&lt;br /&gt;
  - int a = static_cast&amp;lt;int&amp;gt;(something);&lt;br /&gt;
  + auto a = static_cast&amp;lt;int&amp;gt;(something);&lt;br /&gt;
&lt;br /&gt;
No much gain on this particular case, however, when using iterators and other verbose types, it really helps readability.&lt;br /&gt;
&lt;br /&gt;
The change should be discussed with the main developers to reach a consensus. VTK and ITK are using auto in a lot of cases.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Move not implemented constructors and assignment operators to the public interface''' &lt;br /&gt;
&lt;br /&gt;
Now that we use = delete, we don't need the constructors and assignment operator to be in the private interface.&lt;br /&gt;
Moving them to the public interface is better. Including better integrations with IDE's.&lt;br /&gt;
&lt;br /&gt;
== Virtual Machines ==&lt;br /&gt;
* [[{{FULLPAGENAME}}/GPU Virtualization|GPU Virtualization]]&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
* [[{{FULLPAGENAME}}/DocumentationImprovments|Documentation Improvements (Wiki, website, ...)]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/ModulesAndEvents|Intermediate documentation for developers]]&lt;br /&gt;
&lt;br /&gt;
== Tutorials ==&lt;br /&gt;
* [[{{FULLPAGENAME}}/IPythonSlicerTutorials|IPython Slicer Tutorials]]&lt;br /&gt;
&lt;br /&gt;
== Source code management ==&lt;br /&gt;
* [[{{FULLPAGENAME}}/TransitionToGit|Transition to Git]]&lt;br /&gt;
&lt;br /&gt;
== Extension ==&lt;br /&gt;
&lt;br /&gt;
* [[{{FULLPAGENAME}}/ExtensionsFrameworkRoadmap|Extensions Framework Roadmap]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/CustomSlicerGenerator|Custom Slicer Generator]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/ExtensionsMetadata|Improving Extensions Metadata]]&lt;br /&gt;
&lt;br /&gt;
== Functionalities ==&lt;br /&gt;
* [[{{FULLPAGENAME}}/FlyThroughNavigation|Fly-through Navigation]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/AutomaticUpdateAndInstallationFramework|Automatic Update and Installation Framework]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/ApplicationUsageAnalytics|Application usage analytics]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/Plotting2DLineSegments|Plotting 2D Line Segments]]&lt;br /&gt;
&lt;br /&gt;
== Packaging ==&lt;br /&gt;
* [[{{FULLPAGENAME}}/HomebrewCask|Homebrew Cask]&lt;br /&gt;
&lt;br /&gt;
= Completed =&lt;br /&gt;
&lt;br /&gt;
* [[Slicer4:Developers|Developer Projects]]&lt;br /&gt;
&lt;br /&gt;
== Extension ==&lt;br /&gt;
* [[{{FULLPAGENAME}}/EasyExtensionContribution|Easy Extension Contribution]] - See [[Documentation/Nightly/Developers/ExtensionWizard|ExtensionWizard]]&lt;br /&gt;
&lt;br /&gt;
== Internals ==&lt;br /&gt;
* [[{{FULLPAGENAME}}/StartupTimeImprovement|Slicer startup time improvement]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/CMake-ified Python|CMake-ified Python]] - See [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=21911 r21911], [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=21912 r21912], [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=21913 r21913]&lt;br /&gt;
* [[{{FULLPAGENAME}}/NonlinearTransforms|Full support for non-linear transforms]]&lt;br /&gt;
&lt;br /&gt;
== Libraries ==&lt;br /&gt;
* [[{{FULLPAGENAME}}/Qt5-and-VTK8|Migration to Qt5 and VTK8]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/OpenCV|Integration with OpenCV]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/ITKv4|ITKv4]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/Qt484|Qt484]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/VTK6|VTK6]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/VTK7|VTK7]]&lt;br /&gt;
&lt;br /&gt;
== Python ==&lt;br /&gt;
* [[{{FULLPAGENAME}}/Pip|Pip]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/DevelopmentWithGit|Development with Git]] - See [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=21863 r21863], [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=21867 r21867], [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=21869 r21869], [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=21879 r21879], [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=21891 r21891]&lt;br /&gt;
* [[{{FULLPAGENAME}}/PythonObserverCallbacks|Python observer callbacks]]&lt;br /&gt;
&lt;br /&gt;
== Compilers &amp;amp; IDE ==&lt;br /&gt;
* [[{{FULLPAGENAME}}/Ninja|Ninja]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/VS2012|VS2012]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/NUMPY171|Support for Numpy 1.7.1]]&lt;br /&gt;
&lt;br /&gt;
== Modules ==&lt;br /&gt;
* [[{{FULLPAGENAME}}/SimpleFilters|Simple Filters]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/Editor|Editor]]&lt;br /&gt;
&lt;br /&gt;
== Tutorials testing ==&lt;br /&gt;
* [[{{FULLPAGENAME}}/TutorialTesting/4.3-Release|4.3 Release]]&lt;br /&gt;
&lt;br /&gt;
== Debug ==&lt;br /&gt;
* [[{{FULLPAGENAME}}/BRAINS_and_ITKv4_issue|BRAINS and ITKv4 issue]]&lt;br /&gt;
&lt;br /&gt;
== Internals ==&lt;br /&gt;
* [[{{FULLPAGENAME}}/Segmentations|Segmentations]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/MultiDimensional Data Management|MultiDimensional Data Management]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/DICOMExport|DICOM Export]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/SliceViewAnnotations|Slice View Annotations]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/SubjectHierarchy|Subject hierarchy module and plugins]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/I18N|Internationalization]]&lt;br /&gt;
* [[{{FULLPAGENAME}}/Units|Units]]&lt;br /&gt;
* [https://github.com/TubeTK/SlicerExecutionModel/wiki/SlicerExecutionModel-Parameter-Serialization SlicerExecutionModel Parameter Serialization]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Abandoned =&lt;br /&gt;
&lt;br /&gt;
* [[{{FULLPAGENAME}}/SlicerConfigAndUseSlicerTweaks|SlicerConfig and UseSlicer Tweaks]]&lt;/div&gt;</summary>
		<author><name>Phcerdan</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval&amp;diff=60924</id>
		<title>Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval&amp;diff=60924"/>
		<updated>2019-03-16T20:41:48Z</updated>

		<summary type="html">&lt;p&gt;Phcerdan: /* C++11: Update source code to use = default */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Obsolete Code Removal==&lt;br /&gt;
&lt;br /&gt;
This section documents suggested code changes after removing support for a particular features. Each category has a short description, code snippets, a suggested upgrade path, and references to relevant commits.&lt;br /&gt;
&lt;br /&gt;
===Qt&amp;gt;=5.0.0: Remove obsolete code supporting Qt4 plugin infrastructure (C++)===&lt;br /&gt;
&lt;br /&gt;
These changes apply to Qt loadable modules and designer plugins&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModuleWidgetsPlugin.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;quot;vtkSlicerConfigure.h&amp;quot; // For Slicer_HAVE_QT5&lt;br /&gt;
&lt;br /&gt;
// Qt includes&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
#include &amp;lt;QtUiPlugin/QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
#else&lt;br /&gt;
#include &amp;lt;QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
class Q_SLICER_MODULE_SUBJECTHIERARCHY_WIDGETS_PLUGINS_EXPORT qSlicerSubjectHierarchyModuleWidgetsPlugin&lt;br /&gt;
  : public QObject&lt;br /&gt;
  , public QDesignerCustomWidgetCollectionInterface&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetCollectionInterface&amp;quot;)&lt;br /&gt;
#endif&lt;br /&gt;
  Q_INTERFACES(QDesignerCustomWidgetCollectionInterface);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Qt includes&lt;br /&gt;
#include &amp;lt;QtUiPlugin/QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
class Q_SLICER_MODULE_SUBJECTHIERARCHY_WIDGETS_PLUGINS_EXPORT qSlicerSubjectHierarchyModuleWidgetsPlugin&lt;br /&gt;
  : public QObject&lt;br /&gt;
  , public QDesignerCustomWidgetCollectionInterface&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetCollectionInterface&amp;quot;)&lt;br /&gt;
  Q_INTERFACES(QDesignerCustomWidgetCollectionInterface);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModule.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Q_SLICER_QTMODULES_SUBJECTHIERARCHY_EXPORT qSlicerSubjectHierarchyModule :&lt;br /&gt;
  public qSlicerLoadableModule&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.slicer.modules.loadable.qSlicerLoadableModule/1.0&amp;quot;);&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Q_SLICER_QTMODULES_SUBJECTHIERARCHY_EXPORT qSlicerSubjectHierarchyModule :&lt;br /&gt;
  public qSlicerLoadableModule&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.slicer.modules.loadable.qSlicerLoadableModule/1.0&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModuleWidgetsAbstractPlugin.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  #include &amp;lt;QtGlobal&amp;gt;&lt;br /&gt;
  #if(QT_VERSION &amp;lt; QT_VERSION_CHECKS(5, 0, 0))&lt;br /&gt;
  #include &amp;lt;QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
  #else&lt;br /&gt;
  #include &amp;lt;QtUiPlugin/QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
  [...]&lt;br /&gt;
&lt;br /&gt;
  class Q_SLICER_MODULE_SEGMENTATIONS_WIDGETS_PLUGINS_EXPORT qSlicerSegmentationsModuleWidgetsAbstractPlugin&lt;br /&gt;
      : public QDesignerCustomWidgetInterface&lt;br /&gt;
  {&lt;br /&gt;
  #if (QT_VERSION &amp;gt;= QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
    Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetInterface&amp;quot;)&lt;br /&gt;
  #endif&lt;br /&gt;
    Q_INTERFACES(QDesignerCustomWidgetInterface);&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  #include &amp;lt;QtUiPlugin/QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  [...]&lt;br /&gt;
&lt;br /&gt;
  class Q_SLICER_MODULE_SEGMENTATIONS_WIDGETS_PLUGINS_EXPORT qSlicerSegmentationsModuleWidgetsAbstractPlugin&lt;br /&gt;
      : public QDesignerCustomWidgetInterface&lt;br /&gt;
  {&lt;br /&gt;
    Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetInterface&amp;quot;)&lt;br /&gt;
    Q_INTERFACES(QDesignerCustomWidgetInterface);&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModule.cxx and qSlicerNAMEModuleWidgetsAbstractPlugin.cxx====&lt;br /&gt;
&lt;br /&gt;
'''Remove:'''&lt;br /&gt;
&lt;br /&gt;
  #if (QT_VERSION &amp;lt; QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
  #include &amp;lt;QtPlugin&amp;gt;&lt;br /&gt;
  Q_EXPORT_PLUGIN2(customwidgetplugin, qSlicerSegmentationsModuleWidgetsPlugin);&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
===Qt&amp;gt;=5.0.0: Simpler use of QHeaderView::setSectionResizeMode===&lt;br /&gt;
&lt;br /&gt;
This migration guide entry is obsolete: [[Documentation/Nightly/Developers/Tutorials/MigrationGuide#Qt5:_Fix_error:_.E2.80.98class_QHeaderView.E2.80.99_has_no_member_named_.E2.80.98setResizeMode.E2.80.99]]&lt;br /&gt;
&lt;br /&gt;
'''Solution for Cpp'''&lt;br /&gt;
&lt;br /&gt;
Before:&lt;br /&gt;
&lt;br /&gt;
  #if (QT_VERSION &amp;lt; QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(QHeaderView::Stretch);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
  #else&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::Stretch);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::Stretch);&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Solution for Python'''&lt;br /&gt;
&lt;br /&gt;
Before:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def _setSectionResizeMode(header, *args, **kwargs):&lt;br /&gt;
    if version.parse(qt.Qt.qVersion()) &amp;lt; version.parse(&amp;quot;5.0.0&amp;quot;):&lt;br /&gt;
      header.setResizeMode(*args, **kwargs)&lt;br /&gt;
    else:&lt;br /&gt;
      header.setSectionResizeMode(*args, **kwargs)&lt;br /&gt;
&lt;br /&gt;
    [...]&lt;br /&gt;
   &lt;br /&gt;
  _setSectionResizeMode(self.horizontalHeader(), 0, qt.QHeaderView.Stretch)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After:&lt;br /&gt;
&lt;br /&gt;
  self.horizontalHeader().setSectionResizeMode(0, qt.QHeaderView.Stretch)&lt;br /&gt;
&lt;br /&gt;
===C++11: Update source code to use nullptr===&lt;br /&gt;
&lt;br /&gt;
C++11 introduced the keyword &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt; allowing to explicitly identify a pointer of type &amp;lt;tt&amp;gt;std::nullptr_t&amp;lt;/tt&amp;gt;. It avoids ambiguous function overloads. See also https://stackoverflow.com/questions/20509734/null-vs-nullptr-why-was-it-replaced&lt;br /&gt;
&lt;br /&gt;
Prior to supporting only C++11, &amp;lt;tt&amp;gt;0&amp;lt;/tt&amp;gt; and [http://www.cplusplus.com/reference/cstring/NULL/ NULL] integral type were used to check for pointer value, and macro like &amp;lt;tt&amp;gt;Q_NULLPTR&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;ITK_NULLPTR&amp;lt;/tt&amp;gt; macros were used to ensure usage of &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt; when C++11 support was enabled.&lt;br /&gt;
&lt;br /&gt;
Updating the code base to use &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt; is done applying these methods:&lt;br /&gt;
* clang-tidy for updating source code being explicitly compiled in the project.&lt;br /&gt;
* regular expression for replacing occurrences of &amp;lt;tt&amp;gt;NULL&amp;lt;/tt&amp;gt; in source code not being compiled (e.g conditionally compiled code, templated headers, comments)&lt;br /&gt;
* replacement of occurences of &amp;lt;tt&amp;gt;VTK_NULLPTR&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;ITK_NULLPTR&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;Q_NULLPTR&amp;lt;/tt&amp;gt; with &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Using clang-tidy'''&lt;br /&gt;
&lt;br /&gt;
This will iteratively check files for updates. It takes a while. The sources are only modified at the end of the process, so you could cancel anytime before with no consequences.&lt;br /&gt;
# Compile Slicer with the CMake option -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON to generate the file compile_commands.json at configuration time.&lt;br /&gt;
# Run clang-tidy on the generated compile_commands.json (in the build folder: Slicer-build)&lt;br /&gt;
  run-clang-tidy.py -header-filter='.*' -checks='-*,modernize-use-nullptr' -fix&lt;br /&gt;
[http://clang.llvm.org/extra/clang-tidy/ clang-tidy] is a tool from clang. In Archlinux: sudo pacman -S clang, in other distros might be clang-extra-tools or similar.&lt;br /&gt;
&lt;br /&gt;
clang-tidy will substitute NULL and 0 for nullptr when appropriate. It is an iterative process, so it may take time. Also, it replaces all the compiled code, including external dependencies.&lt;br /&gt;
It is recommended to do a fresh build with the modified code, for testing it without modifications in any external repo.&lt;br /&gt;
&lt;br /&gt;
'''Using regex for replacing NULL in comments and not-compiled code'''&lt;br /&gt;
&lt;br /&gt;
After clang-tidy has modified the compiled code with the help of compile_commands.json, there will still be ignored instances of NULL and 0 in some headers, and comments.&lt;br /&gt;
&lt;br /&gt;
Manually replace with the following regex to change those.&lt;br /&gt;
&lt;br /&gt;
1) Change NULL to nullptr except when there is a quote or an underscore in&lt;br /&gt;
front of it. And there is not a quote after.&lt;br /&gt;
&lt;br /&gt;
  ack --type-add=cpp:ext:hxx,hpp,txx,tpp,cxx,cpp,c,cc --cpp &amp;quot;NULL&amp;quot; -l --print0 | xargs -0 -n 1 sed -i 's/\([^\&amp;quot;\_]\)NULL\([^\&amp;quot;\_]\)/\1nullptr\2/g'&lt;br /&gt;
&lt;br /&gt;
2) The same than before but match end of line NULL&lt;br /&gt;
  ack --type-add=cpp:ext:hxx,hpp,txx,tpp,cxx,cpp,c,cc --cpp &amp;quot;NULL&amp;quot; -l --print0 | xargs -0 -n 1 sed -i 's/\([^\&amp;quot;\_]\)NULL$/\1nullptr/g'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Replace ITK_NULLPTR, VTK_NULLPTR, Q_NULLPTR'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- For an example of commit message, see [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=28022 r28022] --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It was adapted from the ITK script in [https://github.com/InsightSoftwareConsortium/ITK/blob/v5.0rc01/Utilities/ITKv5Preparation/ReplaceITK_NULLPTRMacroNames.sh ReplaceITK_NULLPTRMacroNames.sh]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;ITK_NULLPTR&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;git grep -l &amp;quot;ITK_NULLPTR&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/ITK_NULLPTR/nullptr/g&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;VTK_NULLPTR&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;git grep -l &amp;quot;VTK_NULLPTR&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/VTK_NULLPTR/nullptr/g&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;Q_NULLPTR&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;git grep -l &amp;quot;Q_NULLPTR&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/Q_NULLPTR/nullptr/g&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===C++11: Update source code to use override===&lt;br /&gt;
&lt;br /&gt;
From: https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-override.html&lt;br /&gt;
&lt;br /&gt;
Adds override (introduced in C++11) to overridden virtual functions and removes virtual from those functions as it is not required.&lt;br /&gt;
&lt;br /&gt;
virtual on non base class implementations was used to help indicate to the user that a function was virtual. C++ compilers did not use the presence of this to signify an overriden function.&lt;br /&gt;
&lt;br /&gt;
In C++ 11 override and final keywords were introduced to allow overridden functions to be marked appropriately. Their presence allows compilers to verify that an overridden function correctly overrides a base class implementation.&lt;br /&gt;
&lt;br /&gt;
This can be useful as compilers can generate a compile time error when:&lt;br /&gt;
&lt;br /&gt;
# The base class implementation function signature changes.&lt;br /&gt;
# The user has not created the override with the correct signature.&lt;br /&gt;
&lt;br /&gt;
First we replace ITK_OVERRIDE and VTK_OVERRIDE for override:&lt;br /&gt;
&lt;br /&gt;
'''Replace ITK_OVERRIDE and VTK_OVERRIDE'''&lt;br /&gt;
&lt;br /&gt;
For an example of commit message, see [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=28022 r28022]&lt;br /&gt;
&lt;br /&gt;
The regexp involving ITK was extracted from the [https://github.com/InsightSoftwareConsortium/ITK/blob/master/Utilities/ITKv5Preparation/ReplaceITK_OVERRIDEMacroNames.sh ReplaceITK_OVERRIDEMacroNames.sh] script in ITK.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;ITK_OVERRIDE&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;git grep -l &amp;quot;ITK_OVERRIDE&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/ITK_OVERRIDE/override/g&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;VTK_OVERRIDE&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;git grep -l &amp;quot;VTK_OVERRIDE&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/VTK_OVERRIDE/override/g&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Automatic update: Using clang-tidy'''&lt;br /&gt;
&lt;br /&gt;
'''Note''': Running ''clang-tidy -fix'' in parallel might cause problems, like appending multiple keywords to same function (override).  It can be fixed with a grep to remove duplicates.&lt;br /&gt;
&lt;br /&gt;
This will iteratively check files for updates. It takes a while. The sources are only modified at the end of the process, so you could cancel anytime before with no consequences.&lt;br /&gt;
&lt;br /&gt;
Compile Slicer with the CMake option -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON to generate the file compile_commands.json at configuration time.&lt;br /&gt;
Run clang-tidy on the generated compile_commands.json (in the build folder: Slicer-build)&lt;br /&gt;
&lt;br /&gt;
  run-clang-tidy.py -checks=-*,modernize-use-override  -header-filter=.* -fix&lt;br /&gt;
&lt;br /&gt;
'''Manual fix'''&lt;br /&gt;
&lt;br /&gt;
Multiple override are added to the same method. For example:&lt;br /&gt;
&lt;br /&gt;
  void PrintSelf(ostream&amp;amp; os, vtkIndent indent) override override override;&lt;br /&gt;
&lt;br /&gt;
We clean them with (15 here is just a high enough number):&lt;br /&gt;
&lt;br /&gt;
  for n in `seq 1 15`;&lt;br /&gt;
  do&lt;br /&gt;
      ack &amp;quot;override override&amp;quot; -l --print0 | xargs -0 -n 1 sed -i \&lt;br /&gt;
      's/override override/override/g'&lt;br /&gt;
  done&lt;br /&gt;
&lt;br /&gt;
When all of them are fixed, you should see in the terminal:&lt;br /&gt;
&lt;br /&gt;
  sed: no input files&lt;br /&gt;
&lt;br /&gt;
===C++11: Update source code to use = delete ===&lt;br /&gt;
&lt;br /&gt;
Instead of:&lt;br /&gt;
  vtkImageRectangularSource(const vtkImageRectangularSource&amp;amp;);  /// Not implemented.&lt;br /&gt;
  void operator=(const vtkImageRectangularSource&amp;amp;);  /// Not implemented.&lt;br /&gt;
&lt;br /&gt;
Replace for:&lt;br /&gt;
  vtkImageRectangularSource(const vtkImageRectangularSource&amp;amp;) = delete;&lt;br /&gt;
  void operator=(const vtkImageRectangularSource&amp;amp;) = delete;&lt;br /&gt;
&lt;br /&gt;
Same approach than before, use the compile_commands.json and clang-tidy in Slicer-build.&lt;br /&gt;
&lt;br /&gt;
  run-clang-tidy.py -checks=-*,modernize-use-equals-delete -header-filter=.* -fix&lt;br /&gt;
&lt;br /&gt;
Because we run it in parallel, multiple occurrences of = delete might have been added. Fix them with:&lt;br /&gt;
&lt;br /&gt;
 for n in `seq 1 15`;&lt;br /&gt;
 do&lt;br /&gt;
   ack &amp;quot;= delete = delete&amp;quot; -l --print0 | xargs -0 -n 1 sed -i \&lt;br /&gt;
   's/= delete = delete/= delete/g'&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
And also delete comment /// Not implemented, as now it is clear with = delete.&lt;br /&gt;
&lt;br /&gt;
  ack &amp;quot;delete&amp;quot; -l --print0 | xargs -0 -n 1 sed -E -i 's@delete;\s*\/*\s*[nN]ot [iI]mplemented\.?@delete;@g'&lt;br /&gt;
  ack &amp;quot;delete&amp;quot; -l --print0 | xargs -0 -n 1 sed -E -i 's@delete;\s*\/*\s*purposely [nN]ot [iI]mplemented\.?@delete;@g'&lt;br /&gt;
  ack &amp;quot;delete&amp;quot; -l --print0 | xargs -0 -n 1 sed -E -i 's@delete ITK\_DELETED\_FUNCTION;@delete;@g'&lt;br /&gt;
&lt;br /&gt;
Next step in this area would be to move these declarations to the public interface (currently they are private).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===C++11: Update source code to use = default ===&lt;br /&gt;
&lt;br /&gt;
Instead of:&lt;br /&gt;
  virtual ~DataRequest(){}&lt;br /&gt;
&lt;br /&gt;
Replace for:&lt;br /&gt;
  virtual ~DataRequest()= default;&lt;br /&gt;
&lt;br /&gt;
Same approach than before, use the compile_commands.json and clang-tidy in Slicer-build.&lt;br /&gt;
&lt;br /&gt;
  run-clang-tidy.py -checks=-*,modernize-use-equals-default -header-filter=.* -fix&lt;br /&gt;
&lt;br /&gt;
Because we run it in parallel, multiple colons ;; might have been added. Fix them with:&lt;br /&gt;
&lt;br /&gt;
 for n in `seq 1 15`;&lt;br /&gt;
 do&lt;br /&gt;
   ack &amp;quot;default&amp;quot; -l --print0 | xargs -0 -n 1 sed -i 's/= default;;/= default;/g' &lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
Add an empty space before = default if there is none:&lt;br /&gt;
  ack &amp;quot;default&amp;quot; -l --print0 | xargs -0 -n 1 sed -E -i 's/([^\s])= default;/\1 = default;/g'&lt;/div&gt;</summary>
		<author><name>Phcerdan</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval&amp;diff=60923</id>
		<title>Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval&amp;diff=60923"/>
		<updated>2019-03-16T20:38:36Z</updated>

		<summary type="html">&lt;p&gt;Phcerdan: /* Obsolete Code Removal */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Obsolete Code Removal==&lt;br /&gt;
&lt;br /&gt;
This section documents suggested code changes after removing support for a particular features. Each category has a short description, code snippets, a suggested upgrade path, and references to relevant commits.&lt;br /&gt;
&lt;br /&gt;
===Qt&amp;gt;=5.0.0: Remove obsolete code supporting Qt4 plugin infrastructure (C++)===&lt;br /&gt;
&lt;br /&gt;
These changes apply to Qt loadable modules and designer plugins&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModuleWidgetsPlugin.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;quot;vtkSlicerConfigure.h&amp;quot; // For Slicer_HAVE_QT5&lt;br /&gt;
&lt;br /&gt;
// Qt includes&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
#include &amp;lt;QtUiPlugin/QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
#else&lt;br /&gt;
#include &amp;lt;QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
class Q_SLICER_MODULE_SUBJECTHIERARCHY_WIDGETS_PLUGINS_EXPORT qSlicerSubjectHierarchyModuleWidgetsPlugin&lt;br /&gt;
  : public QObject&lt;br /&gt;
  , public QDesignerCustomWidgetCollectionInterface&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetCollectionInterface&amp;quot;)&lt;br /&gt;
#endif&lt;br /&gt;
  Q_INTERFACES(QDesignerCustomWidgetCollectionInterface);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Qt includes&lt;br /&gt;
#include &amp;lt;QtUiPlugin/QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
class Q_SLICER_MODULE_SUBJECTHIERARCHY_WIDGETS_PLUGINS_EXPORT qSlicerSubjectHierarchyModuleWidgetsPlugin&lt;br /&gt;
  : public QObject&lt;br /&gt;
  , public QDesignerCustomWidgetCollectionInterface&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetCollectionInterface&amp;quot;)&lt;br /&gt;
  Q_INTERFACES(QDesignerCustomWidgetCollectionInterface);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModule.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Q_SLICER_QTMODULES_SUBJECTHIERARCHY_EXPORT qSlicerSubjectHierarchyModule :&lt;br /&gt;
  public qSlicerLoadableModule&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.slicer.modules.loadable.qSlicerLoadableModule/1.0&amp;quot;);&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Q_SLICER_QTMODULES_SUBJECTHIERARCHY_EXPORT qSlicerSubjectHierarchyModule :&lt;br /&gt;
  public qSlicerLoadableModule&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.slicer.modules.loadable.qSlicerLoadableModule/1.0&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModuleWidgetsAbstractPlugin.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  #include &amp;lt;QtGlobal&amp;gt;&lt;br /&gt;
  #if(QT_VERSION &amp;lt; QT_VERSION_CHECKS(5, 0, 0))&lt;br /&gt;
  #include &amp;lt;QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
  #else&lt;br /&gt;
  #include &amp;lt;QtUiPlugin/QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
  [...]&lt;br /&gt;
&lt;br /&gt;
  class Q_SLICER_MODULE_SEGMENTATIONS_WIDGETS_PLUGINS_EXPORT qSlicerSegmentationsModuleWidgetsAbstractPlugin&lt;br /&gt;
      : public QDesignerCustomWidgetInterface&lt;br /&gt;
  {&lt;br /&gt;
  #if (QT_VERSION &amp;gt;= QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
    Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetInterface&amp;quot;)&lt;br /&gt;
  #endif&lt;br /&gt;
    Q_INTERFACES(QDesignerCustomWidgetInterface);&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  #include &amp;lt;QtUiPlugin/QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  [...]&lt;br /&gt;
&lt;br /&gt;
  class Q_SLICER_MODULE_SEGMENTATIONS_WIDGETS_PLUGINS_EXPORT qSlicerSegmentationsModuleWidgetsAbstractPlugin&lt;br /&gt;
      : public QDesignerCustomWidgetInterface&lt;br /&gt;
  {&lt;br /&gt;
    Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetInterface&amp;quot;)&lt;br /&gt;
    Q_INTERFACES(QDesignerCustomWidgetInterface);&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModule.cxx and qSlicerNAMEModuleWidgetsAbstractPlugin.cxx====&lt;br /&gt;
&lt;br /&gt;
'''Remove:'''&lt;br /&gt;
&lt;br /&gt;
  #if (QT_VERSION &amp;lt; QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
  #include &amp;lt;QtPlugin&amp;gt;&lt;br /&gt;
  Q_EXPORT_PLUGIN2(customwidgetplugin, qSlicerSegmentationsModuleWidgetsPlugin);&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
===Qt&amp;gt;=5.0.0: Simpler use of QHeaderView::setSectionResizeMode===&lt;br /&gt;
&lt;br /&gt;
This migration guide entry is obsolete: [[Documentation/Nightly/Developers/Tutorials/MigrationGuide#Qt5:_Fix_error:_.E2.80.98class_QHeaderView.E2.80.99_has_no_member_named_.E2.80.98setResizeMode.E2.80.99]]&lt;br /&gt;
&lt;br /&gt;
'''Solution for Cpp'''&lt;br /&gt;
&lt;br /&gt;
Before:&lt;br /&gt;
&lt;br /&gt;
  #if (QT_VERSION &amp;lt; QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(QHeaderView::Stretch);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
  #else&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::Stretch);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::Stretch);&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Solution for Python'''&lt;br /&gt;
&lt;br /&gt;
Before:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def _setSectionResizeMode(header, *args, **kwargs):&lt;br /&gt;
    if version.parse(qt.Qt.qVersion()) &amp;lt; version.parse(&amp;quot;5.0.0&amp;quot;):&lt;br /&gt;
      header.setResizeMode(*args, **kwargs)&lt;br /&gt;
    else:&lt;br /&gt;
      header.setSectionResizeMode(*args, **kwargs)&lt;br /&gt;
&lt;br /&gt;
    [...]&lt;br /&gt;
   &lt;br /&gt;
  _setSectionResizeMode(self.horizontalHeader(), 0, qt.QHeaderView.Stretch)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After:&lt;br /&gt;
&lt;br /&gt;
  self.horizontalHeader().setSectionResizeMode(0, qt.QHeaderView.Stretch)&lt;br /&gt;
&lt;br /&gt;
===C++11: Update source code to use nullptr===&lt;br /&gt;
&lt;br /&gt;
C++11 introduced the keyword &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt; allowing to explicitly identify a pointer of type &amp;lt;tt&amp;gt;std::nullptr_t&amp;lt;/tt&amp;gt;. It avoids ambiguous function overloads. See also https://stackoverflow.com/questions/20509734/null-vs-nullptr-why-was-it-replaced&lt;br /&gt;
&lt;br /&gt;
Prior to supporting only C++11, &amp;lt;tt&amp;gt;0&amp;lt;/tt&amp;gt; and [http://www.cplusplus.com/reference/cstring/NULL/ NULL] integral type were used to check for pointer value, and macro like &amp;lt;tt&amp;gt;Q_NULLPTR&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;ITK_NULLPTR&amp;lt;/tt&amp;gt; macros were used to ensure usage of &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt; when C++11 support was enabled.&lt;br /&gt;
&lt;br /&gt;
Updating the code base to use &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt; is done applying these methods:&lt;br /&gt;
* clang-tidy for updating source code being explicitly compiled in the project.&lt;br /&gt;
* regular expression for replacing occurrences of &amp;lt;tt&amp;gt;NULL&amp;lt;/tt&amp;gt; in source code not being compiled (e.g conditionally compiled code, templated headers, comments)&lt;br /&gt;
* replacement of occurences of &amp;lt;tt&amp;gt;VTK_NULLPTR&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;ITK_NULLPTR&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;Q_NULLPTR&amp;lt;/tt&amp;gt; with &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Using clang-tidy'''&lt;br /&gt;
&lt;br /&gt;
This will iteratively check files for updates. It takes a while. The sources are only modified at the end of the process, so you could cancel anytime before with no consequences.&lt;br /&gt;
# Compile Slicer with the CMake option -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON to generate the file compile_commands.json at configuration time.&lt;br /&gt;
# Run clang-tidy on the generated compile_commands.json (in the build folder: Slicer-build)&lt;br /&gt;
  run-clang-tidy.py -header-filter='.*' -checks='-*,modernize-use-nullptr' -fix&lt;br /&gt;
[http://clang.llvm.org/extra/clang-tidy/ clang-tidy] is a tool from clang. In Archlinux: sudo pacman -S clang, in other distros might be clang-extra-tools or similar.&lt;br /&gt;
&lt;br /&gt;
clang-tidy will substitute NULL and 0 for nullptr when appropriate. It is an iterative process, so it may take time. Also, it replaces all the compiled code, including external dependencies.&lt;br /&gt;
It is recommended to do a fresh build with the modified code, for testing it without modifications in any external repo.&lt;br /&gt;
&lt;br /&gt;
'''Using regex for replacing NULL in comments and not-compiled code'''&lt;br /&gt;
&lt;br /&gt;
After clang-tidy has modified the compiled code with the help of compile_commands.json, there will still be ignored instances of NULL and 0 in some headers, and comments.&lt;br /&gt;
&lt;br /&gt;
Manually replace with the following regex to change those.&lt;br /&gt;
&lt;br /&gt;
1) Change NULL to nullptr except when there is a quote or an underscore in&lt;br /&gt;
front of it. And there is not a quote after.&lt;br /&gt;
&lt;br /&gt;
  ack --type-add=cpp:ext:hxx,hpp,txx,tpp,cxx,cpp,c,cc --cpp &amp;quot;NULL&amp;quot; -l --print0 | xargs -0 -n 1 sed -i 's/\([^\&amp;quot;\_]\)NULL\([^\&amp;quot;\_]\)/\1nullptr\2/g'&lt;br /&gt;
&lt;br /&gt;
2) The same than before but match end of line NULL&lt;br /&gt;
  ack --type-add=cpp:ext:hxx,hpp,txx,tpp,cxx,cpp,c,cc --cpp &amp;quot;NULL&amp;quot; -l --print0 | xargs -0 -n 1 sed -i 's/\([^\&amp;quot;\_]\)NULL$/\1nullptr/g'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Replace ITK_NULLPTR, VTK_NULLPTR, Q_NULLPTR'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- For an example of commit message, see [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=28022 r28022] --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It was adapted from the ITK script in [https://github.com/InsightSoftwareConsortium/ITK/blob/v5.0rc01/Utilities/ITKv5Preparation/ReplaceITK_NULLPTRMacroNames.sh ReplaceITK_NULLPTRMacroNames.sh]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;ITK_NULLPTR&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;git grep -l &amp;quot;ITK_NULLPTR&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/ITK_NULLPTR/nullptr/g&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;VTK_NULLPTR&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;git grep -l &amp;quot;VTK_NULLPTR&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/VTK_NULLPTR/nullptr/g&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;Q_NULLPTR&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;git grep -l &amp;quot;Q_NULLPTR&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/Q_NULLPTR/nullptr/g&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===C++11: Update source code to use override===&lt;br /&gt;
&lt;br /&gt;
From: https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-override.html&lt;br /&gt;
&lt;br /&gt;
Adds override (introduced in C++11) to overridden virtual functions and removes virtual from those functions as it is not required.&lt;br /&gt;
&lt;br /&gt;
virtual on non base class implementations was used to help indicate to the user that a function was virtual. C++ compilers did not use the presence of this to signify an overriden function.&lt;br /&gt;
&lt;br /&gt;
In C++ 11 override and final keywords were introduced to allow overridden functions to be marked appropriately. Their presence allows compilers to verify that an overridden function correctly overrides a base class implementation.&lt;br /&gt;
&lt;br /&gt;
This can be useful as compilers can generate a compile time error when:&lt;br /&gt;
&lt;br /&gt;
# The base class implementation function signature changes.&lt;br /&gt;
# The user has not created the override with the correct signature.&lt;br /&gt;
&lt;br /&gt;
First we replace ITK_OVERRIDE and VTK_OVERRIDE for override:&lt;br /&gt;
&lt;br /&gt;
'''Replace ITK_OVERRIDE and VTK_OVERRIDE'''&lt;br /&gt;
&lt;br /&gt;
For an example of commit message, see [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=28022 r28022]&lt;br /&gt;
&lt;br /&gt;
The regexp involving ITK was extracted from the [https://github.com/InsightSoftwareConsortium/ITK/blob/master/Utilities/ITKv5Preparation/ReplaceITK_OVERRIDEMacroNames.sh ReplaceITK_OVERRIDEMacroNames.sh] script in ITK.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;ITK_OVERRIDE&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;git grep -l &amp;quot;ITK_OVERRIDE&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/ITK_OVERRIDE/override/g&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;VTK_OVERRIDE&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;git grep -l &amp;quot;VTK_OVERRIDE&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/VTK_OVERRIDE/override/g&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Automatic update: Using clang-tidy'''&lt;br /&gt;
&lt;br /&gt;
'''Note''': Running ''clang-tidy -fix'' in parallel might cause problems, like appending multiple keywords to same function (override).  It can be fixed with a grep to remove duplicates.&lt;br /&gt;
&lt;br /&gt;
This will iteratively check files for updates. It takes a while. The sources are only modified at the end of the process, so you could cancel anytime before with no consequences.&lt;br /&gt;
&lt;br /&gt;
Compile Slicer with the CMake option -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON to generate the file compile_commands.json at configuration time.&lt;br /&gt;
Run clang-tidy on the generated compile_commands.json (in the build folder: Slicer-build)&lt;br /&gt;
&lt;br /&gt;
  run-clang-tidy.py -checks=-*,modernize-use-override  -header-filter=.* -fix&lt;br /&gt;
&lt;br /&gt;
'''Manual fix'''&lt;br /&gt;
&lt;br /&gt;
Multiple override are added to the same method. For example:&lt;br /&gt;
&lt;br /&gt;
  void PrintSelf(ostream&amp;amp; os, vtkIndent indent) override override override;&lt;br /&gt;
&lt;br /&gt;
We clean them with (15 here is just a high enough number):&lt;br /&gt;
&lt;br /&gt;
  for n in `seq 1 15`;&lt;br /&gt;
  do&lt;br /&gt;
      ack &amp;quot;override override&amp;quot; -l --print0 | xargs -0 -n 1 sed -i \&lt;br /&gt;
      's/override override/override/g'&lt;br /&gt;
  done&lt;br /&gt;
&lt;br /&gt;
When all of them are fixed, you should see in the terminal:&lt;br /&gt;
&lt;br /&gt;
  sed: no input files&lt;br /&gt;
&lt;br /&gt;
===C++11: Update source code to use = delete ===&lt;br /&gt;
&lt;br /&gt;
Instead of:&lt;br /&gt;
  vtkImageRectangularSource(const vtkImageRectangularSource&amp;amp;);  /// Not implemented.&lt;br /&gt;
  void operator=(const vtkImageRectangularSource&amp;amp;);  /// Not implemented.&lt;br /&gt;
&lt;br /&gt;
Replace for:&lt;br /&gt;
  vtkImageRectangularSource(const vtkImageRectangularSource&amp;amp;) = delete;&lt;br /&gt;
  void operator=(const vtkImageRectangularSource&amp;amp;) = delete;&lt;br /&gt;
&lt;br /&gt;
Same approach than before, use the compile_commands.json and clang-tidy in Slicer-build.&lt;br /&gt;
&lt;br /&gt;
  run-clang-tidy.py -checks=-*,modernize-use-equals-delete -header-filter=.* -fix&lt;br /&gt;
&lt;br /&gt;
Because we run it in parallel, multiple occurrences of = delete might have been added. Fix them with:&lt;br /&gt;
&lt;br /&gt;
 for n in `seq 1 15`;&lt;br /&gt;
 do&lt;br /&gt;
   ack &amp;quot;= delete = delete&amp;quot; -l --print0 | xargs -0 -n 1 sed -i \&lt;br /&gt;
   's/= delete = delete/= delete/g'&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
And also delete comment /// Not implemented, as now it is clear with = delete.&lt;br /&gt;
&lt;br /&gt;
  ack &amp;quot;delete&amp;quot; -l --print0 | xargs -0 -n 1 sed -E -i 's@delete;\s*\/*\s*[nN]ot [iI]mplemented\.?@delete;@g'&lt;br /&gt;
  ack &amp;quot;delete&amp;quot; -l --print0 | xargs -0 -n 1 sed -E -i 's@delete;\s*\/*\s*purposely [nN]ot [iI]mplemented\.?@delete;@g'&lt;br /&gt;
  ack &amp;quot;delete&amp;quot; -l --print0 | xargs -0 -n 1 sed -E -i 's@delete ITK\_DELETED\_FUNCTION;@delete;@g'&lt;br /&gt;
&lt;br /&gt;
Next step in this area would be to move these declarations to the public interface (currently they are private).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===C++11: Update source code to use = default ===&lt;br /&gt;
&lt;br /&gt;
Instead of:&lt;br /&gt;
  virtual ~DataRequest(){}&lt;br /&gt;
&lt;br /&gt;
Replace for:&lt;br /&gt;
  virtual ~DataRequest()= default;&lt;br /&gt;
&lt;br /&gt;
Same approach than before, use the compile_commands.json and clang-tidy in Slicer-build.&lt;br /&gt;
&lt;br /&gt;
  run-clang-tidy.py -checks=-*,modernize-use-equals-default -header-filter=.* -fix&lt;br /&gt;
&lt;br /&gt;
Because we run it in parallel, multiple occurrences of = delete might have been added. Fix them with:&lt;br /&gt;
&lt;br /&gt;
 for n in `seq 1 15`;&lt;br /&gt;
 do&lt;br /&gt;
   ack &amp;quot;default&amp;quot; -l --print0 | xargs -0 -n 1 sed -i 's/= default;;/= default;/g' &lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
Add an empty space before = default if there is none:&lt;br /&gt;
  ack &amp;quot;default&amp;quot; -l --print0 | xargs -0 -n 1 sed -E -i 's/([^\s])= default;/\1 = default;/g'&lt;/div&gt;</summary>
		<author><name>Phcerdan</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval&amp;diff=60922</id>
		<title>Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval&amp;diff=60922"/>
		<updated>2019-03-16T19:23:19Z</updated>

		<summary type="html">&lt;p&gt;Phcerdan: /* C++11: Update source code to use = delete */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Obsolete Code Removal==&lt;br /&gt;
&lt;br /&gt;
This section documents suggested code changes after removing support for a particular features. Each category has a short description, code snippets, a suggested upgrade path, and references to relevant commits.&lt;br /&gt;
&lt;br /&gt;
===Qt&amp;gt;=5.0.0: Remove obsolete code supporting Qt4 plugin infrastructure (C++)===&lt;br /&gt;
&lt;br /&gt;
These changes apply to Qt loadable modules and designer plugins&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModuleWidgetsPlugin.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;quot;vtkSlicerConfigure.h&amp;quot; // For Slicer_HAVE_QT5&lt;br /&gt;
&lt;br /&gt;
// Qt includes&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
#include &amp;lt;QtUiPlugin/QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
#else&lt;br /&gt;
#include &amp;lt;QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
class Q_SLICER_MODULE_SUBJECTHIERARCHY_WIDGETS_PLUGINS_EXPORT qSlicerSubjectHierarchyModuleWidgetsPlugin&lt;br /&gt;
  : public QObject&lt;br /&gt;
  , public QDesignerCustomWidgetCollectionInterface&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetCollectionInterface&amp;quot;)&lt;br /&gt;
#endif&lt;br /&gt;
  Q_INTERFACES(QDesignerCustomWidgetCollectionInterface);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Qt includes&lt;br /&gt;
#include &amp;lt;QtUiPlugin/QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
class Q_SLICER_MODULE_SUBJECTHIERARCHY_WIDGETS_PLUGINS_EXPORT qSlicerSubjectHierarchyModuleWidgetsPlugin&lt;br /&gt;
  : public QObject&lt;br /&gt;
  , public QDesignerCustomWidgetCollectionInterface&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetCollectionInterface&amp;quot;)&lt;br /&gt;
  Q_INTERFACES(QDesignerCustomWidgetCollectionInterface);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModule.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Q_SLICER_QTMODULES_SUBJECTHIERARCHY_EXPORT qSlicerSubjectHierarchyModule :&lt;br /&gt;
  public qSlicerLoadableModule&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.slicer.modules.loadable.qSlicerLoadableModule/1.0&amp;quot;);&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Q_SLICER_QTMODULES_SUBJECTHIERARCHY_EXPORT qSlicerSubjectHierarchyModule :&lt;br /&gt;
  public qSlicerLoadableModule&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.slicer.modules.loadable.qSlicerLoadableModule/1.0&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModuleWidgetsAbstractPlugin.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  #include &amp;lt;QtGlobal&amp;gt;&lt;br /&gt;
  #if(QT_VERSION &amp;lt; QT_VERSION_CHECKS(5, 0, 0))&lt;br /&gt;
  #include &amp;lt;QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
  #else&lt;br /&gt;
  #include &amp;lt;QtUiPlugin/QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
  [...]&lt;br /&gt;
&lt;br /&gt;
  class Q_SLICER_MODULE_SEGMENTATIONS_WIDGETS_PLUGINS_EXPORT qSlicerSegmentationsModuleWidgetsAbstractPlugin&lt;br /&gt;
      : public QDesignerCustomWidgetInterface&lt;br /&gt;
  {&lt;br /&gt;
  #if (QT_VERSION &amp;gt;= QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
    Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetInterface&amp;quot;)&lt;br /&gt;
  #endif&lt;br /&gt;
    Q_INTERFACES(QDesignerCustomWidgetInterface);&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  #include &amp;lt;QtUiPlugin/QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  [...]&lt;br /&gt;
&lt;br /&gt;
  class Q_SLICER_MODULE_SEGMENTATIONS_WIDGETS_PLUGINS_EXPORT qSlicerSegmentationsModuleWidgetsAbstractPlugin&lt;br /&gt;
      : public QDesignerCustomWidgetInterface&lt;br /&gt;
  {&lt;br /&gt;
    Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetInterface&amp;quot;)&lt;br /&gt;
    Q_INTERFACES(QDesignerCustomWidgetInterface);&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModule.cxx and qSlicerNAMEModuleWidgetsAbstractPlugin.cxx====&lt;br /&gt;
&lt;br /&gt;
'''Remove:'''&lt;br /&gt;
&lt;br /&gt;
  #if (QT_VERSION &amp;lt; QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
  #include &amp;lt;QtPlugin&amp;gt;&lt;br /&gt;
  Q_EXPORT_PLUGIN2(customwidgetplugin, qSlicerSegmentationsModuleWidgetsPlugin);&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
===Qt&amp;gt;=5.0.0: Simpler use of QHeaderView::setSectionResizeMode===&lt;br /&gt;
&lt;br /&gt;
This migration guide entry is obsolete: [[Documentation/Nightly/Developers/Tutorials/MigrationGuide#Qt5:_Fix_error:_.E2.80.98class_QHeaderView.E2.80.99_has_no_member_named_.E2.80.98setResizeMode.E2.80.99]]&lt;br /&gt;
&lt;br /&gt;
'''Solution for Cpp'''&lt;br /&gt;
&lt;br /&gt;
Before:&lt;br /&gt;
&lt;br /&gt;
  #if (QT_VERSION &amp;lt; QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(QHeaderView::Stretch);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
  #else&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::Stretch);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::Stretch);&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Solution for Python'''&lt;br /&gt;
&lt;br /&gt;
Before:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def _setSectionResizeMode(header, *args, **kwargs):&lt;br /&gt;
    if version.parse(qt.Qt.qVersion()) &amp;lt; version.parse(&amp;quot;5.0.0&amp;quot;):&lt;br /&gt;
      header.setResizeMode(*args, **kwargs)&lt;br /&gt;
    else:&lt;br /&gt;
      header.setSectionResizeMode(*args, **kwargs)&lt;br /&gt;
&lt;br /&gt;
    [...]&lt;br /&gt;
   &lt;br /&gt;
  _setSectionResizeMode(self.horizontalHeader(), 0, qt.QHeaderView.Stretch)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After:&lt;br /&gt;
&lt;br /&gt;
  self.horizontalHeader().setSectionResizeMode(0, qt.QHeaderView.Stretch)&lt;br /&gt;
&lt;br /&gt;
===C++11: Update source code to use nullptr===&lt;br /&gt;
&lt;br /&gt;
C++11 introduced the keyword &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt; allowing to explicitly identify a pointer of type &amp;lt;tt&amp;gt;std::nullptr_t&amp;lt;/tt&amp;gt;. It avoids ambiguous function overloads. See also https://stackoverflow.com/questions/20509734/null-vs-nullptr-why-was-it-replaced&lt;br /&gt;
&lt;br /&gt;
Prior to supporting only C++11, &amp;lt;tt&amp;gt;0&amp;lt;/tt&amp;gt; and [http://www.cplusplus.com/reference/cstring/NULL/ NULL] integral type were used to check for pointer value, and macro like &amp;lt;tt&amp;gt;Q_NULLPTR&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;ITK_NULLPTR&amp;lt;/tt&amp;gt; macros were used to ensure usage of &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt; when C++11 support was enabled.&lt;br /&gt;
&lt;br /&gt;
Updating the code base to use &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt; is done applying these methods:&lt;br /&gt;
* clang-tidy for updating source code being explicitly compiled in the project.&lt;br /&gt;
* regular expression for replacing occurrences of &amp;lt;tt&amp;gt;NULL&amp;lt;/tt&amp;gt; in source code not being compiled (e.g conditionally compiled code, templated headers, comments)&lt;br /&gt;
* replacement of occurences of &amp;lt;tt&amp;gt;VTK_NULLPTR&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;ITK_NULLPTR&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;Q_NULLPTR&amp;lt;/tt&amp;gt; with &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Using clang-tidy'''&lt;br /&gt;
&lt;br /&gt;
This will iteratively check files for updates. It takes a while. The sources are only modified at the end of the process, so you could cancel anytime before with no consequences.&lt;br /&gt;
# Compile Slicer with the CMake option -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON to generate the file compile_commands.json at configuration time.&lt;br /&gt;
# Run clang-tidy on the generated compile_commands.json (in the build folder: Slicer-build)&lt;br /&gt;
  run-clang-tidy.py -header-filter='.*' -checks='-*,modernize-use-nullptr' -fix&lt;br /&gt;
[http://clang.llvm.org/extra/clang-tidy/ clang-tidy] is a tool from clang. In Archlinux: sudo pacman -S clang, in other distros might be clang-extra-tools or similar.&lt;br /&gt;
&lt;br /&gt;
clang-tidy will substitute NULL and 0 for nullptr when appropriate. It is an iterative process, so it may take time. Also, it replaces all the compiled code, including external dependencies.&lt;br /&gt;
It is recommended to do a fresh build with the modified code, for testing it without modifications in any external repo.&lt;br /&gt;
&lt;br /&gt;
'''Using regex for replacing NULL in comments and not-compiled code'''&lt;br /&gt;
&lt;br /&gt;
After clang-tidy has modified the compiled code with the help of compile_commands.json, there will still be ignored instances of NULL and 0 in some headers, and comments.&lt;br /&gt;
&lt;br /&gt;
Manually replace with the following regex to change those.&lt;br /&gt;
&lt;br /&gt;
1) Change NULL to nullptr except when there is a quote or an underscore in&lt;br /&gt;
front of it. And there is not a quote after.&lt;br /&gt;
&lt;br /&gt;
  ack --type-add=cpp:ext:hxx,hpp,txx,tpp,cxx,cpp,c,cc --cpp &amp;quot;NULL&amp;quot; -l --print0 | xargs -0 -n 1 sed -i 's/\([^\&amp;quot;\_]\)NULL\([^\&amp;quot;\_]\)/\1nullptr\2/g'&lt;br /&gt;
&lt;br /&gt;
2) The same than before but match end of line NULL&lt;br /&gt;
  ack --type-add=cpp:ext:hxx,hpp,txx,tpp,cxx,cpp,c,cc --cpp &amp;quot;NULL&amp;quot; -l --print0 | xargs -0 -n 1 sed -i 's/\([^\&amp;quot;\_]\)NULL$/\1nullptr/g'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Replace ITK_NULLPTR, VTK_NULLPTR, Q_NULLPTR'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- For an example of commit message, see [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=28022 r28022] --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It was adapted from the ITK script in [https://github.com/InsightSoftwareConsortium/ITK/blob/v5.0rc01/Utilities/ITKv5Preparation/ReplaceITK_NULLPTRMacroNames.sh ReplaceITK_NULLPTRMacroNames.sh]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;ITK_NULLPTR&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;git grep -l &amp;quot;ITK_NULLPTR&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/ITK_NULLPTR/nullptr/g&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;VTK_NULLPTR&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;git grep -l &amp;quot;VTK_NULLPTR&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/VTK_NULLPTR/nullptr/g&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;Q_NULLPTR&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;git grep -l &amp;quot;Q_NULLPTR&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/Q_NULLPTR/nullptr/g&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===C++11: Update source code to use override===&lt;br /&gt;
&lt;br /&gt;
From: https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-override.html&lt;br /&gt;
&lt;br /&gt;
Adds override (introduced in C++11) to overridden virtual functions and removes virtual from those functions as it is not required.&lt;br /&gt;
&lt;br /&gt;
virtual on non base class implementations was used to help indicate to the user that a function was virtual. C++ compilers did not use the presence of this to signify an overriden function.&lt;br /&gt;
&lt;br /&gt;
In C++ 11 override and final keywords were introduced to allow overridden functions to be marked appropriately. Their presence allows compilers to verify that an overridden function correctly overrides a base class implementation.&lt;br /&gt;
&lt;br /&gt;
This can be useful as compilers can generate a compile time error when:&lt;br /&gt;
&lt;br /&gt;
# The base class implementation function signature changes.&lt;br /&gt;
# The user has not created the override with the correct signature.&lt;br /&gt;
&lt;br /&gt;
First we replace ITK_OVERRIDE and VTK_OVERRIDE for override:&lt;br /&gt;
&lt;br /&gt;
'''Replace ITK_OVERRIDE and VTK_OVERRIDE'''&lt;br /&gt;
&lt;br /&gt;
For an example of commit message, see [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=28022 r28022]&lt;br /&gt;
&lt;br /&gt;
The regexp involving ITK was extracted from the [https://github.com/InsightSoftwareConsortium/ITK/blob/master/Utilities/ITKv5Preparation/ReplaceITK_OVERRIDEMacroNames.sh ReplaceITK_OVERRIDEMacroNames.sh] script in ITK.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;ITK_OVERRIDE&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;git grep -l &amp;quot;ITK_OVERRIDE&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/ITK_OVERRIDE/override/g&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;VTK_OVERRIDE&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;git grep -l &amp;quot;VTK_OVERRIDE&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/VTK_OVERRIDE/override/g&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Automatic update: Using clang-tidy'''&lt;br /&gt;
&lt;br /&gt;
'''Note''': Running ''clang-tidy -fix'' in parallel might cause problems, like appending multiple keywords to same function (override).  It can be fixed with a grep to remove duplicates.&lt;br /&gt;
&lt;br /&gt;
This will iteratively check files for updates. It takes a while. The sources are only modified at the end of the process, so you could cancel anytime before with no consequences.&lt;br /&gt;
&lt;br /&gt;
Compile Slicer with the CMake option -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON to generate the file compile_commands.json at configuration time.&lt;br /&gt;
Run clang-tidy on the generated compile_commands.json (in the build folder: Slicer-build)&lt;br /&gt;
&lt;br /&gt;
  run-clang-tidy.py -checks=-*,modernize-use-override  -header-filter=.* -fix&lt;br /&gt;
&lt;br /&gt;
'''Manual fix'''&lt;br /&gt;
&lt;br /&gt;
Multiple override are added to the same method. For example:&lt;br /&gt;
&lt;br /&gt;
  void PrintSelf(ostream&amp;amp; os, vtkIndent indent) override override override;&lt;br /&gt;
&lt;br /&gt;
We clean them with (15 here is just a high enough number):&lt;br /&gt;
&lt;br /&gt;
  for n in `seq 1 15`;&lt;br /&gt;
  do&lt;br /&gt;
      ack &amp;quot;override override&amp;quot; -l --print0 | xargs -0 -n 1 sed -i \&lt;br /&gt;
      's/override override/override/g'&lt;br /&gt;
  done&lt;br /&gt;
&lt;br /&gt;
When all of them are fixed, you should see in the terminal:&lt;br /&gt;
&lt;br /&gt;
  sed: no input files&lt;br /&gt;
&lt;br /&gt;
===C++11: Update source code to use = delete ===&lt;br /&gt;
&lt;br /&gt;
Instead of:&lt;br /&gt;
  vtkImageRectangularSource(const vtkImageRectangularSource&amp;amp;);  /// Not implemented.&lt;br /&gt;
  void operator=(const vtkImageRectangularSource&amp;amp;);  /// Not implemented.&lt;br /&gt;
&lt;br /&gt;
Replace for:&lt;br /&gt;
  vtkImageRectangularSource(const vtkImageRectangularSource&amp;amp;) = delete;&lt;br /&gt;
  void operator=(const vtkImageRectangularSource&amp;amp;) = delete;&lt;br /&gt;
&lt;br /&gt;
Same approach than before, use the compile_commands.json and clang-tidy in Slicer-build.&lt;br /&gt;
&lt;br /&gt;
  run-clang-tidy.py -checks=-*,modernize-use-equals-delete -header-filter=.* -fix&lt;br /&gt;
&lt;br /&gt;
Because we run it in parallel, multiple occurrences of = delete might have been added. Fix them with:&lt;br /&gt;
&lt;br /&gt;
 for n in `seq 1 15`;&lt;br /&gt;
 do&lt;br /&gt;
   ack &amp;quot;= delete = delete&amp;quot; -l --print0 | xargs -0 -n 1 sed -i \&lt;br /&gt;
   's/= delete = delete/= delete/g'&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
And also delete comment /// Not implemented, as now it is clear with = delete.&lt;br /&gt;
&lt;br /&gt;
  ack &amp;quot;delete&amp;quot; -l --print0 | xargs -0 -n 1 sed -E -i 's@delete;\s*\/*\s*[nN]ot [iI]mplemented\.?@delete;@g'&lt;br /&gt;
  ack &amp;quot;delete&amp;quot; -l --print0 | xargs -0 -n 1 sed -E -i 's@delete;\s*\/*\s*purposely [nN]ot [iI]mplemented\.?@delete;@g'&lt;br /&gt;
  ack &amp;quot;delete&amp;quot; -l --print0 | xargs -0 -n 1 sed -E -i 's@delete ITK\_DELETED\_FUNCTION;@delete;@g'&lt;br /&gt;
&lt;br /&gt;
Next step in this area would be to move these declarations to the public interface (currently they are private).&lt;/div&gt;</summary>
		<author><name>Phcerdan</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval&amp;diff=60921</id>
		<title>Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval&amp;diff=60921"/>
		<updated>2019-03-16T19:21:17Z</updated>

		<summary type="html">&lt;p&gt;Phcerdan: /* C++11: Update source code to use = delete */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Obsolete Code Removal==&lt;br /&gt;
&lt;br /&gt;
This section documents suggested code changes after removing support for a particular features. Each category has a short description, code snippets, a suggested upgrade path, and references to relevant commits.&lt;br /&gt;
&lt;br /&gt;
===Qt&amp;gt;=5.0.0: Remove obsolete code supporting Qt4 plugin infrastructure (C++)===&lt;br /&gt;
&lt;br /&gt;
These changes apply to Qt loadable modules and designer plugins&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModuleWidgetsPlugin.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;quot;vtkSlicerConfigure.h&amp;quot; // For Slicer_HAVE_QT5&lt;br /&gt;
&lt;br /&gt;
// Qt includes&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
#include &amp;lt;QtUiPlugin/QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
#else&lt;br /&gt;
#include &amp;lt;QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
class Q_SLICER_MODULE_SUBJECTHIERARCHY_WIDGETS_PLUGINS_EXPORT qSlicerSubjectHierarchyModuleWidgetsPlugin&lt;br /&gt;
  : public QObject&lt;br /&gt;
  , public QDesignerCustomWidgetCollectionInterface&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetCollectionInterface&amp;quot;)&lt;br /&gt;
#endif&lt;br /&gt;
  Q_INTERFACES(QDesignerCustomWidgetCollectionInterface);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Qt includes&lt;br /&gt;
#include &amp;lt;QtUiPlugin/QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
class Q_SLICER_MODULE_SUBJECTHIERARCHY_WIDGETS_PLUGINS_EXPORT qSlicerSubjectHierarchyModuleWidgetsPlugin&lt;br /&gt;
  : public QObject&lt;br /&gt;
  , public QDesignerCustomWidgetCollectionInterface&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetCollectionInterface&amp;quot;)&lt;br /&gt;
  Q_INTERFACES(QDesignerCustomWidgetCollectionInterface);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModule.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Q_SLICER_QTMODULES_SUBJECTHIERARCHY_EXPORT qSlicerSubjectHierarchyModule :&lt;br /&gt;
  public qSlicerLoadableModule&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.slicer.modules.loadable.qSlicerLoadableModule/1.0&amp;quot;);&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Q_SLICER_QTMODULES_SUBJECTHIERARCHY_EXPORT qSlicerSubjectHierarchyModule :&lt;br /&gt;
  public qSlicerLoadableModule&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.slicer.modules.loadable.qSlicerLoadableModule/1.0&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModuleWidgetsAbstractPlugin.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  #include &amp;lt;QtGlobal&amp;gt;&lt;br /&gt;
  #if(QT_VERSION &amp;lt; QT_VERSION_CHECKS(5, 0, 0))&lt;br /&gt;
  #include &amp;lt;QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
  #else&lt;br /&gt;
  #include &amp;lt;QtUiPlugin/QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
  [...]&lt;br /&gt;
&lt;br /&gt;
  class Q_SLICER_MODULE_SEGMENTATIONS_WIDGETS_PLUGINS_EXPORT qSlicerSegmentationsModuleWidgetsAbstractPlugin&lt;br /&gt;
      : public QDesignerCustomWidgetInterface&lt;br /&gt;
  {&lt;br /&gt;
  #if (QT_VERSION &amp;gt;= QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
    Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetInterface&amp;quot;)&lt;br /&gt;
  #endif&lt;br /&gt;
    Q_INTERFACES(QDesignerCustomWidgetInterface);&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  #include &amp;lt;QtUiPlugin/QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  [...]&lt;br /&gt;
&lt;br /&gt;
  class Q_SLICER_MODULE_SEGMENTATIONS_WIDGETS_PLUGINS_EXPORT qSlicerSegmentationsModuleWidgetsAbstractPlugin&lt;br /&gt;
      : public QDesignerCustomWidgetInterface&lt;br /&gt;
  {&lt;br /&gt;
    Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetInterface&amp;quot;)&lt;br /&gt;
    Q_INTERFACES(QDesignerCustomWidgetInterface);&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModule.cxx and qSlicerNAMEModuleWidgetsAbstractPlugin.cxx====&lt;br /&gt;
&lt;br /&gt;
'''Remove:'''&lt;br /&gt;
&lt;br /&gt;
  #if (QT_VERSION &amp;lt; QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
  #include &amp;lt;QtPlugin&amp;gt;&lt;br /&gt;
  Q_EXPORT_PLUGIN2(customwidgetplugin, qSlicerSegmentationsModuleWidgetsPlugin);&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
===Qt&amp;gt;=5.0.0: Simpler use of QHeaderView::setSectionResizeMode===&lt;br /&gt;
&lt;br /&gt;
This migration guide entry is obsolete: [[Documentation/Nightly/Developers/Tutorials/MigrationGuide#Qt5:_Fix_error:_.E2.80.98class_QHeaderView.E2.80.99_has_no_member_named_.E2.80.98setResizeMode.E2.80.99]]&lt;br /&gt;
&lt;br /&gt;
'''Solution for Cpp'''&lt;br /&gt;
&lt;br /&gt;
Before:&lt;br /&gt;
&lt;br /&gt;
  #if (QT_VERSION &amp;lt; QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(QHeaderView::Stretch);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
  #else&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::Stretch);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::Stretch);&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Solution for Python'''&lt;br /&gt;
&lt;br /&gt;
Before:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def _setSectionResizeMode(header, *args, **kwargs):&lt;br /&gt;
    if version.parse(qt.Qt.qVersion()) &amp;lt; version.parse(&amp;quot;5.0.0&amp;quot;):&lt;br /&gt;
      header.setResizeMode(*args, **kwargs)&lt;br /&gt;
    else:&lt;br /&gt;
      header.setSectionResizeMode(*args, **kwargs)&lt;br /&gt;
&lt;br /&gt;
    [...]&lt;br /&gt;
   &lt;br /&gt;
  _setSectionResizeMode(self.horizontalHeader(), 0, qt.QHeaderView.Stretch)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After:&lt;br /&gt;
&lt;br /&gt;
  self.horizontalHeader().setSectionResizeMode(0, qt.QHeaderView.Stretch)&lt;br /&gt;
&lt;br /&gt;
===C++11: Update source code to use nullptr===&lt;br /&gt;
&lt;br /&gt;
C++11 introduced the keyword &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt; allowing to explicitly identify a pointer of type &amp;lt;tt&amp;gt;std::nullptr_t&amp;lt;/tt&amp;gt;. It avoids ambiguous function overloads. See also https://stackoverflow.com/questions/20509734/null-vs-nullptr-why-was-it-replaced&lt;br /&gt;
&lt;br /&gt;
Prior to supporting only C++11, &amp;lt;tt&amp;gt;0&amp;lt;/tt&amp;gt; and [http://www.cplusplus.com/reference/cstring/NULL/ NULL] integral type were used to check for pointer value, and macro like &amp;lt;tt&amp;gt;Q_NULLPTR&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;ITK_NULLPTR&amp;lt;/tt&amp;gt; macros were used to ensure usage of &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt; when C++11 support was enabled.&lt;br /&gt;
&lt;br /&gt;
Updating the code base to use &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt; is done applying these methods:&lt;br /&gt;
* clang-tidy for updating source code being explicitly compiled in the project.&lt;br /&gt;
* regular expression for replacing occurrences of &amp;lt;tt&amp;gt;NULL&amp;lt;/tt&amp;gt; in source code not being compiled (e.g conditionally compiled code, templated headers, comments)&lt;br /&gt;
* replacement of occurences of &amp;lt;tt&amp;gt;VTK_NULLPTR&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;ITK_NULLPTR&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;Q_NULLPTR&amp;lt;/tt&amp;gt; with &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Using clang-tidy'''&lt;br /&gt;
&lt;br /&gt;
This will iteratively check files for updates. It takes a while. The sources are only modified at the end of the process, so you could cancel anytime before with no consequences.&lt;br /&gt;
# Compile Slicer with the CMake option -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON to generate the file compile_commands.json at configuration time.&lt;br /&gt;
# Run clang-tidy on the generated compile_commands.json (in the build folder: Slicer-build)&lt;br /&gt;
  run-clang-tidy.py -header-filter='.*' -checks='-*,modernize-use-nullptr' -fix&lt;br /&gt;
[http://clang.llvm.org/extra/clang-tidy/ clang-tidy] is a tool from clang. In Archlinux: sudo pacman -S clang, in other distros might be clang-extra-tools or similar.&lt;br /&gt;
&lt;br /&gt;
clang-tidy will substitute NULL and 0 for nullptr when appropriate. It is an iterative process, so it may take time. Also, it replaces all the compiled code, including external dependencies.&lt;br /&gt;
It is recommended to do a fresh build with the modified code, for testing it without modifications in any external repo.&lt;br /&gt;
&lt;br /&gt;
'''Using regex for replacing NULL in comments and not-compiled code'''&lt;br /&gt;
&lt;br /&gt;
After clang-tidy has modified the compiled code with the help of compile_commands.json, there will still be ignored instances of NULL and 0 in some headers, and comments.&lt;br /&gt;
&lt;br /&gt;
Manually replace with the following regex to change those.&lt;br /&gt;
&lt;br /&gt;
1) Change NULL to nullptr except when there is a quote or an underscore in&lt;br /&gt;
front of it. And there is not a quote after.&lt;br /&gt;
&lt;br /&gt;
  ack --type-add=cpp:ext:hxx,hpp,txx,tpp,cxx,cpp,c,cc --cpp &amp;quot;NULL&amp;quot; -l --print0 | xargs -0 -n 1 sed -i 's/\([^\&amp;quot;\_]\)NULL\([^\&amp;quot;\_]\)/\1nullptr\2/g'&lt;br /&gt;
&lt;br /&gt;
2) The same than before but match end of line NULL&lt;br /&gt;
  ack --type-add=cpp:ext:hxx,hpp,txx,tpp,cxx,cpp,c,cc --cpp &amp;quot;NULL&amp;quot; -l --print0 | xargs -0 -n 1 sed -i 's/\([^\&amp;quot;\_]\)NULL$/\1nullptr/g'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Replace ITK_NULLPTR, VTK_NULLPTR, Q_NULLPTR'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- For an example of commit message, see [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=28022 r28022] --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It was adapted from the ITK script in [https://github.com/InsightSoftwareConsortium/ITK/blob/v5.0rc01/Utilities/ITKv5Preparation/ReplaceITK_NULLPTRMacroNames.sh ReplaceITK_NULLPTRMacroNames.sh]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;ITK_NULLPTR&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;git grep -l &amp;quot;ITK_NULLPTR&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/ITK_NULLPTR/nullptr/g&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;VTK_NULLPTR&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;git grep -l &amp;quot;VTK_NULLPTR&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/VTK_NULLPTR/nullptr/g&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;Q_NULLPTR&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;git grep -l &amp;quot;Q_NULLPTR&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/Q_NULLPTR/nullptr/g&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===C++11: Update source code to use override===&lt;br /&gt;
&lt;br /&gt;
From: https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-override.html&lt;br /&gt;
&lt;br /&gt;
Adds override (introduced in C++11) to overridden virtual functions and removes virtual from those functions as it is not required.&lt;br /&gt;
&lt;br /&gt;
virtual on non base class implementations was used to help indicate to the user that a function was virtual. C++ compilers did not use the presence of this to signify an overriden function.&lt;br /&gt;
&lt;br /&gt;
In C++ 11 override and final keywords were introduced to allow overridden functions to be marked appropriately. Their presence allows compilers to verify that an overridden function correctly overrides a base class implementation.&lt;br /&gt;
&lt;br /&gt;
This can be useful as compilers can generate a compile time error when:&lt;br /&gt;
&lt;br /&gt;
# The base class implementation function signature changes.&lt;br /&gt;
# The user has not created the override with the correct signature.&lt;br /&gt;
&lt;br /&gt;
First we replace ITK_OVERRIDE and VTK_OVERRIDE for override:&lt;br /&gt;
&lt;br /&gt;
'''Replace ITK_OVERRIDE and VTK_OVERRIDE'''&lt;br /&gt;
&lt;br /&gt;
For an example of commit message, see [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=28022 r28022]&lt;br /&gt;
&lt;br /&gt;
The regexp involving ITK was extracted from the [https://github.com/InsightSoftwareConsortium/ITK/blob/master/Utilities/ITKv5Preparation/ReplaceITK_OVERRIDEMacroNames.sh ReplaceITK_OVERRIDEMacroNames.sh] script in ITK.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;ITK_OVERRIDE&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;git grep -l &amp;quot;ITK_OVERRIDE&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/ITK_OVERRIDE/override/g&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;VTK_OVERRIDE&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;git grep -l &amp;quot;VTK_OVERRIDE&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/VTK_OVERRIDE/override/g&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Automatic update: Using clang-tidy'''&lt;br /&gt;
&lt;br /&gt;
'''Note''': Running ''clang-tidy -fix'' in parallel might cause problems, like appending multiple keywords to same function (override).  It can be fixed with a grep to remove duplicates.&lt;br /&gt;
&lt;br /&gt;
This will iteratively check files for updates. It takes a while. The sources are only modified at the end of the process, so you could cancel anytime before with no consequences.&lt;br /&gt;
&lt;br /&gt;
Compile Slicer with the CMake option -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON to generate the file compile_commands.json at configuration time.&lt;br /&gt;
Run clang-tidy on the generated compile_commands.json (in the build folder: Slicer-build)&lt;br /&gt;
&lt;br /&gt;
  run-clang-tidy.py -checks=-*,modernize-use-override  -header-filter=.* -fix&lt;br /&gt;
&lt;br /&gt;
'''Manual fix'''&lt;br /&gt;
&lt;br /&gt;
Multiple override are added to the same method. For example:&lt;br /&gt;
&lt;br /&gt;
  void PrintSelf(ostream&amp;amp; os, vtkIndent indent) override override override;&lt;br /&gt;
&lt;br /&gt;
We clean them with (15 here is just a high enough number):&lt;br /&gt;
&lt;br /&gt;
  for n in `seq 1 15`;&lt;br /&gt;
  do&lt;br /&gt;
      ack &amp;quot;override override&amp;quot; -l --print0 | xargs -0 -n 1 sed -i \&lt;br /&gt;
      's/override override/override/g'&lt;br /&gt;
  done&lt;br /&gt;
&lt;br /&gt;
When all of them are fixed, you should see in the terminal:&lt;br /&gt;
&lt;br /&gt;
  sed: no input files&lt;br /&gt;
&lt;br /&gt;
===C++11: Update source code to use = delete ===&lt;br /&gt;
&lt;br /&gt;
Instead of:&lt;br /&gt;
  vtkImageRectangularSource(const vtkImageRectangularSource&amp;amp;);  /// Not implemented.&lt;br /&gt;
  void operator=(const vtkImageRectangularSource&amp;amp;);  /// Not implemented.&lt;br /&gt;
&lt;br /&gt;
Replace for:&lt;br /&gt;
  vtkImageRectangularSource(const vtkImageRectangularSource&amp;amp;) = delete;&lt;br /&gt;
  void operator=(const vtkImageRectangularSource&amp;amp;) = delete;&lt;br /&gt;
&lt;br /&gt;
Same approach than before, use the compile_commands.json and clang-tidy in Slicer-build.&lt;br /&gt;
&lt;br /&gt;
  run-clang-tidy.py -checks=-*,modernize-use-equals-delete -header-filter=.* -fix&lt;br /&gt;
&lt;br /&gt;
Because we run it in parallel, multiple occurrences of = delete might have been added. Fix them with:&lt;br /&gt;
&lt;br /&gt;
 for n in `seq 1 15`;&lt;br /&gt;
 do&lt;br /&gt;
   ack &amp;quot;= delete = delete&amp;quot; -l --print0 | xargs -0 -n 1 sed -i \&lt;br /&gt;
   's/= delete = delete/= delete/g'&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
And also delete comment /// Not implemented, as now it is clear with = delete.&lt;br /&gt;
&lt;br /&gt;
  ack &amp;quot;delete&amp;quot; -l --print0 | xargs -0 -n 1 sed -E -i 's@delete;\s*\/*\s*[nN]ot [iI]mplemented\.?@delete;@g'&lt;br /&gt;
  ack &amp;quot;delete&amp;quot; -l --print0 | xargs -0 -n 1 sed -E -i 's@delete;\s*\/*\s*purposely [nN]ot [iI]mplemented\.?@delete;@g'&lt;br /&gt;
  ack &amp;quot;delete&amp;quot; -l --print0 | xargs -0 -n 1 sed -E -i 's@delete ITK\_DELETED\_FUNCTION;@delete;@g'&lt;/div&gt;</summary>
		<author><name>Phcerdan</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval&amp;diff=60920</id>
		<title>Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval&amp;diff=60920"/>
		<updated>2019-03-16T19:20:06Z</updated>

		<summary type="html">&lt;p&gt;Phcerdan: /* C++11: Update source code to use = delete */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Obsolete Code Removal==&lt;br /&gt;
&lt;br /&gt;
This section documents suggested code changes after removing support for a particular features. Each category has a short description, code snippets, a suggested upgrade path, and references to relevant commits.&lt;br /&gt;
&lt;br /&gt;
===Qt&amp;gt;=5.0.0: Remove obsolete code supporting Qt4 plugin infrastructure (C++)===&lt;br /&gt;
&lt;br /&gt;
These changes apply to Qt loadable modules and designer plugins&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModuleWidgetsPlugin.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;quot;vtkSlicerConfigure.h&amp;quot; // For Slicer_HAVE_QT5&lt;br /&gt;
&lt;br /&gt;
// Qt includes&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
#include &amp;lt;QtUiPlugin/QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
#else&lt;br /&gt;
#include &amp;lt;QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
class Q_SLICER_MODULE_SUBJECTHIERARCHY_WIDGETS_PLUGINS_EXPORT qSlicerSubjectHierarchyModuleWidgetsPlugin&lt;br /&gt;
  : public QObject&lt;br /&gt;
  , public QDesignerCustomWidgetCollectionInterface&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetCollectionInterface&amp;quot;)&lt;br /&gt;
#endif&lt;br /&gt;
  Q_INTERFACES(QDesignerCustomWidgetCollectionInterface);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Qt includes&lt;br /&gt;
#include &amp;lt;QtUiPlugin/QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
class Q_SLICER_MODULE_SUBJECTHIERARCHY_WIDGETS_PLUGINS_EXPORT qSlicerSubjectHierarchyModuleWidgetsPlugin&lt;br /&gt;
  : public QObject&lt;br /&gt;
  , public QDesignerCustomWidgetCollectionInterface&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetCollectionInterface&amp;quot;)&lt;br /&gt;
  Q_INTERFACES(QDesignerCustomWidgetCollectionInterface);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModule.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Q_SLICER_QTMODULES_SUBJECTHIERARCHY_EXPORT qSlicerSubjectHierarchyModule :&lt;br /&gt;
  public qSlicerLoadableModule&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.slicer.modules.loadable.qSlicerLoadableModule/1.0&amp;quot;);&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Q_SLICER_QTMODULES_SUBJECTHIERARCHY_EXPORT qSlicerSubjectHierarchyModule :&lt;br /&gt;
  public qSlicerLoadableModule&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.slicer.modules.loadable.qSlicerLoadableModule/1.0&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModuleWidgetsAbstractPlugin.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  #include &amp;lt;QtGlobal&amp;gt;&lt;br /&gt;
  #if(QT_VERSION &amp;lt; QT_VERSION_CHECKS(5, 0, 0))&lt;br /&gt;
  #include &amp;lt;QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
  #else&lt;br /&gt;
  #include &amp;lt;QtUiPlugin/QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
  [...]&lt;br /&gt;
&lt;br /&gt;
  class Q_SLICER_MODULE_SEGMENTATIONS_WIDGETS_PLUGINS_EXPORT qSlicerSegmentationsModuleWidgetsAbstractPlugin&lt;br /&gt;
      : public QDesignerCustomWidgetInterface&lt;br /&gt;
  {&lt;br /&gt;
  #if (QT_VERSION &amp;gt;= QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
    Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetInterface&amp;quot;)&lt;br /&gt;
  #endif&lt;br /&gt;
    Q_INTERFACES(QDesignerCustomWidgetInterface);&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  #include &amp;lt;QtUiPlugin/QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  [...]&lt;br /&gt;
&lt;br /&gt;
  class Q_SLICER_MODULE_SEGMENTATIONS_WIDGETS_PLUGINS_EXPORT qSlicerSegmentationsModuleWidgetsAbstractPlugin&lt;br /&gt;
      : public QDesignerCustomWidgetInterface&lt;br /&gt;
  {&lt;br /&gt;
    Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetInterface&amp;quot;)&lt;br /&gt;
    Q_INTERFACES(QDesignerCustomWidgetInterface);&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModule.cxx and qSlicerNAMEModuleWidgetsAbstractPlugin.cxx====&lt;br /&gt;
&lt;br /&gt;
'''Remove:'''&lt;br /&gt;
&lt;br /&gt;
  #if (QT_VERSION &amp;lt; QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
  #include &amp;lt;QtPlugin&amp;gt;&lt;br /&gt;
  Q_EXPORT_PLUGIN2(customwidgetplugin, qSlicerSegmentationsModuleWidgetsPlugin);&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
===Qt&amp;gt;=5.0.0: Simpler use of QHeaderView::setSectionResizeMode===&lt;br /&gt;
&lt;br /&gt;
This migration guide entry is obsolete: [[Documentation/Nightly/Developers/Tutorials/MigrationGuide#Qt5:_Fix_error:_.E2.80.98class_QHeaderView.E2.80.99_has_no_member_named_.E2.80.98setResizeMode.E2.80.99]]&lt;br /&gt;
&lt;br /&gt;
'''Solution for Cpp'''&lt;br /&gt;
&lt;br /&gt;
Before:&lt;br /&gt;
&lt;br /&gt;
  #if (QT_VERSION &amp;lt; QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(QHeaderView::Stretch);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
  #else&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::Stretch);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::Stretch);&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Solution for Python'''&lt;br /&gt;
&lt;br /&gt;
Before:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def _setSectionResizeMode(header, *args, **kwargs):&lt;br /&gt;
    if version.parse(qt.Qt.qVersion()) &amp;lt; version.parse(&amp;quot;5.0.0&amp;quot;):&lt;br /&gt;
      header.setResizeMode(*args, **kwargs)&lt;br /&gt;
    else:&lt;br /&gt;
      header.setSectionResizeMode(*args, **kwargs)&lt;br /&gt;
&lt;br /&gt;
    [...]&lt;br /&gt;
   &lt;br /&gt;
  _setSectionResizeMode(self.horizontalHeader(), 0, qt.QHeaderView.Stretch)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After:&lt;br /&gt;
&lt;br /&gt;
  self.horizontalHeader().setSectionResizeMode(0, qt.QHeaderView.Stretch)&lt;br /&gt;
&lt;br /&gt;
===C++11: Update source code to use nullptr===&lt;br /&gt;
&lt;br /&gt;
C++11 introduced the keyword &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt; allowing to explicitly identify a pointer of type &amp;lt;tt&amp;gt;std::nullptr_t&amp;lt;/tt&amp;gt;. It avoids ambiguous function overloads. See also https://stackoverflow.com/questions/20509734/null-vs-nullptr-why-was-it-replaced&lt;br /&gt;
&lt;br /&gt;
Prior to supporting only C++11, &amp;lt;tt&amp;gt;0&amp;lt;/tt&amp;gt; and [http://www.cplusplus.com/reference/cstring/NULL/ NULL] integral type were used to check for pointer value, and macro like &amp;lt;tt&amp;gt;Q_NULLPTR&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;ITK_NULLPTR&amp;lt;/tt&amp;gt; macros were used to ensure usage of &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt; when C++11 support was enabled.&lt;br /&gt;
&lt;br /&gt;
Updating the code base to use &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt; is done applying these methods:&lt;br /&gt;
* clang-tidy for updating source code being explicitly compiled in the project.&lt;br /&gt;
* regular expression for replacing occurrences of &amp;lt;tt&amp;gt;NULL&amp;lt;/tt&amp;gt; in source code not being compiled (e.g conditionally compiled code, templated headers, comments)&lt;br /&gt;
* replacement of occurences of &amp;lt;tt&amp;gt;VTK_NULLPTR&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;ITK_NULLPTR&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;Q_NULLPTR&amp;lt;/tt&amp;gt; with &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Using clang-tidy'''&lt;br /&gt;
&lt;br /&gt;
This will iteratively check files for updates. It takes a while. The sources are only modified at the end of the process, so you could cancel anytime before with no consequences.&lt;br /&gt;
# Compile Slicer with the CMake option -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON to generate the file compile_commands.json at configuration time.&lt;br /&gt;
# Run clang-tidy on the generated compile_commands.json (in the build folder: Slicer-build)&lt;br /&gt;
  run-clang-tidy.py -header-filter='.*' -checks='-*,modernize-use-nullptr' -fix&lt;br /&gt;
[http://clang.llvm.org/extra/clang-tidy/ clang-tidy] is a tool from clang. In Archlinux: sudo pacman -S clang, in other distros might be clang-extra-tools or similar.&lt;br /&gt;
&lt;br /&gt;
clang-tidy will substitute NULL and 0 for nullptr when appropriate. It is an iterative process, so it may take time. Also, it replaces all the compiled code, including external dependencies.&lt;br /&gt;
It is recommended to do a fresh build with the modified code, for testing it without modifications in any external repo.&lt;br /&gt;
&lt;br /&gt;
'''Using regex for replacing NULL in comments and not-compiled code'''&lt;br /&gt;
&lt;br /&gt;
After clang-tidy has modified the compiled code with the help of compile_commands.json, there will still be ignored instances of NULL and 0 in some headers, and comments.&lt;br /&gt;
&lt;br /&gt;
Manually replace with the following regex to change those.&lt;br /&gt;
&lt;br /&gt;
1) Change NULL to nullptr except when there is a quote or an underscore in&lt;br /&gt;
front of it. And there is not a quote after.&lt;br /&gt;
&lt;br /&gt;
  ack --type-add=cpp:ext:hxx,hpp,txx,tpp,cxx,cpp,c,cc --cpp &amp;quot;NULL&amp;quot; -l --print0 | xargs -0 -n 1 sed -i 's/\([^\&amp;quot;\_]\)NULL\([^\&amp;quot;\_]\)/\1nullptr\2/g'&lt;br /&gt;
&lt;br /&gt;
2) The same than before but match end of line NULL&lt;br /&gt;
  ack --type-add=cpp:ext:hxx,hpp,txx,tpp,cxx,cpp,c,cc --cpp &amp;quot;NULL&amp;quot; -l --print0 | xargs -0 -n 1 sed -i 's/\([^\&amp;quot;\_]\)NULL$/\1nullptr/g'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Replace ITK_NULLPTR, VTK_NULLPTR, Q_NULLPTR'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- For an example of commit message, see [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=28022 r28022] --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It was adapted from the ITK script in [https://github.com/InsightSoftwareConsortium/ITK/blob/v5.0rc01/Utilities/ITKv5Preparation/ReplaceITK_NULLPTRMacroNames.sh ReplaceITK_NULLPTRMacroNames.sh]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;ITK_NULLPTR&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;git grep -l &amp;quot;ITK_NULLPTR&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/ITK_NULLPTR/nullptr/g&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;VTK_NULLPTR&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;git grep -l &amp;quot;VTK_NULLPTR&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/VTK_NULLPTR/nullptr/g&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;Q_NULLPTR&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;git grep -l &amp;quot;Q_NULLPTR&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/Q_NULLPTR/nullptr/g&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===C++11: Update source code to use override===&lt;br /&gt;
&lt;br /&gt;
From: https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-override.html&lt;br /&gt;
&lt;br /&gt;
Adds override (introduced in C++11) to overridden virtual functions and removes virtual from those functions as it is not required.&lt;br /&gt;
&lt;br /&gt;
virtual on non base class implementations was used to help indicate to the user that a function was virtual. C++ compilers did not use the presence of this to signify an overriden function.&lt;br /&gt;
&lt;br /&gt;
In C++ 11 override and final keywords were introduced to allow overridden functions to be marked appropriately. Their presence allows compilers to verify that an overridden function correctly overrides a base class implementation.&lt;br /&gt;
&lt;br /&gt;
This can be useful as compilers can generate a compile time error when:&lt;br /&gt;
&lt;br /&gt;
# The base class implementation function signature changes.&lt;br /&gt;
# The user has not created the override with the correct signature.&lt;br /&gt;
&lt;br /&gt;
First we replace ITK_OVERRIDE and VTK_OVERRIDE for override:&lt;br /&gt;
&lt;br /&gt;
'''Replace ITK_OVERRIDE and VTK_OVERRIDE'''&lt;br /&gt;
&lt;br /&gt;
For an example of commit message, see [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=28022 r28022]&lt;br /&gt;
&lt;br /&gt;
The regexp involving ITK was extracted from the [https://github.com/InsightSoftwareConsortium/ITK/blob/master/Utilities/ITKv5Preparation/ReplaceITK_OVERRIDEMacroNames.sh ReplaceITK_OVERRIDEMacroNames.sh] script in ITK.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;ITK_OVERRIDE&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;git grep -l &amp;quot;ITK_OVERRIDE&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/ITK_OVERRIDE/override/g&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;VTK_OVERRIDE&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;git grep -l &amp;quot;VTK_OVERRIDE&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/VTK_OVERRIDE/override/g&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Automatic update: Using clang-tidy'''&lt;br /&gt;
&lt;br /&gt;
'''Note''': Running ''clang-tidy -fix'' in parallel might cause problems, like appending multiple keywords to same function (override).  It can be fixed with a grep to remove duplicates.&lt;br /&gt;
&lt;br /&gt;
This will iteratively check files for updates. It takes a while. The sources are only modified at the end of the process, so you could cancel anytime before with no consequences.&lt;br /&gt;
&lt;br /&gt;
Compile Slicer with the CMake option -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON to generate the file compile_commands.json at configuration time.&lt;br /&gt;
Run clang-tidy on the generated compile_commands.json (in the build folder: Slicer-build)&lt;br /&gt;
&lt;br /&gt;
  run-clang-tidy.py -checks=-*,modernize-use-override  -header-filter=.* -fix&lt;br /&gt;
&lt;br /&gt;
'''Manual fix'''&lt;br /&gt;
&lt;br /&gt;
Multiple override are added to the same method. For example:&lt;br /&gt;
&lt;br /&gt;
  void PrintSelf(ostream&amp;amp; os, vtkIndent indent) override override override;&lt;br /&gt;
&lt;br /&gt;
We clean them with (15 here is just a high enough number):&lt;br /&gt;
&lt;br /&gt;
  for n in `seq 1 15`;&lt;br /&gt;
  do&lt;br /&gt;
      ack &amp;quot;override override&amp;quot; -l --print0 | xargs -0 -n 1 sed -i \&lt;br /&gt;
      's/override override/override/g'&lt;br /&gt;
  done&lt;br /&gt;
&lt;br /&gt;
When all of them are fixed, you should see in the terminal:&lt;br /&gt;
&lt;br /&gt;
  sed: no input files&lt;br /&gt;
&lt;br /&gt;
===C++11: Update source code to use = delete ===&lt;br /&gt;
&lt;br /&gt;
Instead of:&lt;br /&gt;
  vtkImageRectangularSource(const vtkImageRectangularSource&amp;amp;);  /// Not implemented.&lt;br /&gt;
  void operator=(const vtkImageRectangularSource&amp;amp;);  /// Not implemented.&lt;br /&gt;
&lt;br /&gt;
Replace for:&lt;br /&gt;
  vtkImageRectangularSource(const vtkImageRectangularSource&amp;amp;) = delete;&lt;br /&gt;
  void operator=(const vtkImageRectangularSource&amp;amp;) = delete;&lt;br /&gt;
&lt;br /&gt;
Same approach than before, use the compile_commands.json and clang-tidy in Slicer-build.&lt;br /&gt;
&lt;br /&gt;
  run-clang-tidy.py -checks=-*,modernize-use-equals-delete -header-filter=.* -fix&lt;br /&gt;
&lt;br /&gt;
Because we run it in parallel, multiple occurrences of = delete might have been added. Fix them with:&lt;br /&gt;
&lt;br /&gt;
 for n in `seq 1 15`;&lt;br /&gt;
 do&lt;br /&gt;
   ack &amp;quot;= delete = delete&amp;quot; -l --print0 | xargs -0 -n 1 sed -i \&lt;br /&gt;
   's/= delete = delete/= delete/g'&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
And also delete comment /// Not implemented, as now it is clear with = delete.&lt;br /&gt;
&lt;br /&gt;
  ack &amp;quot;delete&amp;quot; -l --print0 | xargs -0 -n 1 sed -E -i 's@delete;[[:space:]]*\/*\s*[nN]ot [iI]mplemented\.?@delete;@g'&lt;br /&gt;
  ack &amp;quot;delete&amp;quot; -l --print0 | xargs -0 -n 1 sed -E -i 's@delete;[[:space:]]*\/*\s*purposely [nN]ot [iI]mplemented\.?@delete;@g'&lt;br /&gt;
  ack &amp;quot;delete&amp;quot; -l --print0 | xargs -0 -n 1 sed -E -i 's@delete ITK\_DELETED\_FUNCTION;@delete;@g'&lt;/div&gt;</summary>
		<author><name>Phcerdan</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval&amp;diff=60919</id>
		<title>Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval&amp;diff=60919"/>
		<updated>2019-03-16T19:16:28Z</updated>

		<summary type="html">&lt;p&gt;Phcerdan: /* C++11: Update source code to use = delete */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Obsolete Code Removal==&lt;br /&gt;
&lt;br /&gt;
This section documents suggested code changes after removing support for a particular features. Each category has a short description, code snippets, a suggested upgrade path, and references to relevant commits.&lt;br /&gt;
&lt;br /&gt;
===Qt&amp;gt;=5.0.0: Remove obsolete code supporting Qt4 plugin infrastructure (C++)===&lt;br /&gt;
&lt;br /&gt;
These changes apply to Qt loadable modules and designer plugins&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModuleWidgetsPlugin.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;quot;vtkSlicerConfigure.h&amp;quot; // For Slicer_HAVE_QT5&lt;br /&gt;
&lt;br /&gt;
// Qt includes&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
#include &amp;lt;QtUiPlugin/QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
#else&lt;br /&gt;
#include &amp;lt;QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
class Q_SLICER_MODULE_SUBJECTHIERARCHY_WIDGETS_PLUGINS_EXPORT qSlicerSubjectHierarchyModuleWidgetsPlugin&lt;br /&gt;
  : public QObject&lt;br /&gt;
  , public QDesignerCustomWidgetCollectionInterface&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetCollectionInterface&amp;quot;)&lt;br /&gt;
#endif&lt;br /&gt;
  Q_INTERFACES(QDesignerCustomWidgetCollectionInterface);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Qt includes&lt;br /&gt;
#include &amp;lt;QtUiPlugin/QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
class Q_SLICER_MODULE_SUBJECTHIERARCHY_WIDGETS_PLUGINS_EXPORT qSlicerSubjectHierarchyModuleWidgetsPlugin&lt;br /&gt;
  : public QObject&lt;br /&gt;
  , public QDesignerCustomWidgetCollectionInterface&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetCollectionInterface&amp;quot;)&lt;br /&gt;
  Q_INTERFACES(QDesignerCustomWidgetCollectionInterface);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModule.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Q_SLICER_QTMODULES_SUBJECTHIERARCHY_EXPORT qSlicerSubjectHierarchyModule :&lt;br /&gt;
  public qSlicerLoadableModule&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.slicer.modules.loadable.qSlicerLoadableModule/1.0&amp;quot;);&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Q_SLICER_QTMODULES_SUBJECTHIERARCHY_EXPORT qSlicerSubjectHierarchyModule :&lt;br /&gt;
  public qSlicerLoadableModule&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.slicer.modules.loadable.qSlicerLoadableModule/1.0&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModuleWidgetsAbstractPlugin.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  #include &amp;lt;QtGlobal&amp;gt;&lt;br /&gt;
  #if(QT_VERSION &amp;lt; QT_VERSION_CHECKS(5, 0, 0))&lt;br /&gt;
  #include &amp;lt;QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
  #else&lt;br /&gt;
  #include &amp;lt;QtUiPlugin/QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
  [...]&lt;br /&gt;
&lt;br /&gt;
  class Q_SLICER_MODULE_SEGMENTATIONS_WIDGETS_PLUGINS_EXPORT qSlicerSegmentationsModuleWidgetsAbstractPlugin&lt;br /&gt;
      : public QDesignerCustomWidgetInterface&lt;br /&gt;
  {&lt;br /&gt;
  #if (QT_VERSION &amp;gt;= QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
    Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetInterface&amp;quot;)&lt;br /&gt;
  #endif&lt;br /&gt;
    Q_INTERFACES(QDesignerCustomWidgetInterface);&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  #include &amp;lt;QtUiPlugin/QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  [...]&lt;br /&gt;
&lt;br /&gt;
  class Q_SLICER_MODULE_SEGMENTATIONS_WIDGETS_PLUGINS_EXPORT qSlicerSegmentationsModuleWidgetsAbstractPlugin&lt;br /&gt;
      : public QDesignerCustomWidgetInterface&lt;br /&gt;
  {&lt;br /&gt;
    Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetInterface&amp;quot;)&lt;br /&gt;
    Q_INTERFACES(QDesignerCustomWidgetInterface);&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModule.cxx and qSlicerNAMEModuleWidgetsAbstractPlugin.cxx====&lt;br /&gt;
&lt;br /&gt;
'''Remove:'''&lt;br /&gt;
&lt;br /&gt;
  #if (QT_VERSION &amp;lt; QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
  #include &amp;lt;QtPlugin&amp;gt;&lt;br /&gt;
  Q_EXPORT_PLUGIN2(customwidgetplugin, qSlicerSegmentationsModuleWidgetsPlugin);&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
===Qt&amp;gt;=5.0.0: Simpler use of QHeaderView::setSectionResizeMode===&lt;br /&gt;
&lt;br /&gt;
This migration guide entry is obsolete: [[Documentation/Nightly/Developers/Tutorials/MigrationGuide#Qt5:_Fix_error:_.E2.80.98class_QHeaderView.E2.80.99_has_no_member_named_.E2.80.98setResizeMode.E2.80.99]]&lt;br /&gt;
&lt;br /&gt;
'''Solution for Cpp'''&lt;br /&gt;
&lt;br /&gt;
Before:&lt;br /&gt;
&lt;br /&gt;
  #if (QT_VERSION &amp;lt; QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(QHeaderView::Stretch);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
  #else&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::Stretch);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::Stretch);&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Solution for Python'''&lt;br /&gt;
&lt;br /&gt;
Before:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def _setSectionResizeMode(header, *args, **kwargs):&lt;br /&gt;
    if version.parse(qt.Qt.qVersion()) &amp;lt; version.parse(&amp;quot;5.0.0&amp;quot;):&lt;br /&gt;
      header.setResizeMode(*args, **kwargs)&lt;br /&gt;
    else:&lt;br /&gt;
      header.setSectionResizeMode(*args, **kwargs)&lt;br /&gt;
&lt;br /&gt;
    [...]&lt;br /&gt;
   &lt;br /&gt;
  _setSectionResizeMode(self.horizontalHeader(), 0, qt.QHeaderView.Stretch)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After:&lt;br /&gt;
&lt;br /&gt;
  self.horizontalHeader().setSectionResizeMode(0, qt.QHeaderView.Stretch)&lt;br /&gt;
&lt;br /&gt;
===C++11: Update source code to use nullptr===&lt;br /&gt;
&lt;br /&gt;
C++11 introduced the keyword &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt; allowing to explicitly identify a pointer of type &amp;lt;tt&amp;gt;std::nullptr_t&amp;lt;/tt&amp;gt;. It avoids ambiguous function overloads. See also https://stackoverflow.com/questions/20509734/null-vs-nullptr-why-was-it-replaced&lt;br /&gt;
&lt;br /&gt;
Prior to supporting only C++11, &amp;lt;tt&amp;gt;0&amp;lt;/tt&amp;gt; and [http://www.cplusplus.com/reference/cstring/NULL/ NULL] integral type were used to check for pointer value, and macro like &amp;lt;tt&amp;gt;Q_NULLPTR&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;ITK_NULLPTR&amp;lt;/tt&amp;gt; macros were used to ensure usage of &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt; when C++11 support was enabled.&lt;br /&gt;
&lt;br /&gt;
Updating the code base to use &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt; is done applying these methods:&lt;br /&gt;
* clang-tidy for updating source code being explicitly compiled in the project.&lt;br /&gt;
* regular expression for replacing occurrences of &amp;lt;tt&amp;gt;NULL&amp;lt;/tt&amp;gt; in source code not being compiled (e.g conditionally compiled code, templated headers, comments)&lt;br /&gt;
* replacement of occurences of &amp;lt;tt&amp;gt;VTK_NULLPTR&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;ITK_NULLPTR&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;Q_NULLPTR&amp;lt;/tt&amp;gt; with &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Using clang-tidy'''&lt;br /&gt;
&lt;br /&gt;
This will iteratively check files for updates. It takes a while. The sources are only modified at the end of the process, so you could cancel anytime before with no consequences.&lt;br /&gt;
# Compile Slicer with the CMake option -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON to generate the file compile_commands.json at configuration time.&lt;br /&gt;
# Run clang-tidy on the generated compile_commands.json (in the build folder: Slicer-build)&lt;br /&gt;
  run-clang-tidy.py -header-filter='.*' -checks='-*,modernize-use-nullptr' -fix&lt;br /&gt;
[http://clang.llvm.org/extra/clang-tidy/ clang-tidy] is a tool from clang. In Archlinux: sudo pacman -S clang, in other distros might be clang-extra-tools or similar.&lt;br /&gt;
&lt;br /&gt;
clang-tidy will substitute NULL and 0 for nullptr when appropriate. It is an iterative process, so it may take time. Also, it replaces all the compiled code, including external dependencies.&lt;br /&gt;
It is recommended to do a fresh build with the modified code, for testing it without modifications in any external repo.&lt;br /&gt;
&lt;br /&gt;
'''Using regex for replacing NULL in comments and not-compiled code'''&lt;br /&gt;
&lt;br /&gt;
After clang-tidy has modified the compiled code with the help of compile_commands.json, there will still be ignored instances of NULL and 0 in some headers, and comments.&lt;br /&gt;
&lt;br /&gt;
Manually replace with the following regex to change those.&lt;br /&gt;
&lt;br /&gt;
1) Change NULL to nullptr except when there is a quote or an underscore in&lt;br /&gt;
front of it. And there is not a quote after.&lt;br /&gt;
&lt;br /&gt;
  ack --type-add=cpp:ext:hxx,hpp,txx,tpp,cxx,cpp,c,cc --cpp &amp;quot;NULL&amp;quot; -l --print0 | xargs -0 -n 1 sed -i 's/\([^\&amp;quot;\_]\)NULL\([^\&amp;quot;\_]\)/\1nullptr\2/g'&lt;br /&gt;
&lt;br /&gt;
2) The same than before but match end of line NULL&lt;br /&gt;
  ack --type-add=cpp:ext:hxx,hpp,txx,tpp,cxx,cpp,c,cc --cpp &amp;quot;NULL&amp;quot; -l --print0 | xargs -0 -n 1 sed -i 's/\([^\&amp;quot;\_]\)NULL$/\1nullptr/g'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Replace ITK_NULLPTR, VTK_NULLPTR, Q_NULLPTR'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- For an example of commit message, see [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=28022 r28022] --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It was adapted from the ITK script in [https://github.com/InsightSoftwareConsortium/ITK/blob/v5.0rc01/Utilities/ITKv5Preparation/ReplaceITK_NULLPTRMacroNames.sh ReplaceITK_NULLPTRMacroNames.sh]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;ITK_NULLPTR&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;git grep -l &amp;quot;ITK_NULLPTR&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/ITK_NULLPTR/nullptr/g&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;VTK_NULLPTR&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;git grep -l &amp;quot;VTK_NULLPTR&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/VTK_NULLPTR/nullptr/g&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;Q_NULLPTR&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;git grep -l &amp;quot;Q_NULLPTR&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/Q_NULLPTR/nullptr/g&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===C++11: Update source code to use override===&lt;br /&gt;
&lt;br /&gt;
From: https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-override.html&lt;br /&gt;
&lt;br /&gt;
Adds override (introduced in C++11) to overridden virtual functions and removes virtual from those functions as it is not required.&lt;br /&gt;
&lt;br /&gt;
virtual on non base class implementations was used to help indicate to the user that a function was virtual. C++ compilers did not use the presence of this to signify an overriden function.&lt;br /&gt;
&lt;br /&gt;
In C++ 11 override and final keywords were introduced to allow overridden functions to be marked appropriately. Their presence allows compilers to verify that an overridden function correctly overrides a base class implementation.&lt;br /&gt;
&lt;br /&gt;
This can be useful as compilers can generate a compile time error when:&lt;br /&gt;
&lt;br /&gt;
# The base class implementation function signature changes.&lt;br /&gt;
# The user has not created the override with the correct signature.&lt;br /&gt;
&lt;br /&gt;
First we replace ITK_OVERRIDE and VTK_OVERRIDE for override:&lt;br /&gt;
&lt;br /&gt;
'''Replace ITK_OVERRIDE and VTK_OVERRIDE'''&lt;br /&gt;
&lt;br /&gt;
For an example of commit message, see [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=28022 r28022]&lt;br /&gt;
&lt;br /&gt;
The regexp involving ITK was extracted from the [https://github.com/InsightSoftwareConsortium/ITK/blob/master/Utilities/ITKv5Preparation/ReplaceITK_OVERRIDEMacroNames.sh ReplaceITK_OVERRIDEMacroNames.sh] script in ITK.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;ITK_OVERRIDE&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;git grep -l &amp;quot;ITK_OVERRIDE&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/ITK_OVERRIDE/override/g&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;VTK_OVERRIDE&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;git grep -l &amp;quot;VTK_OVERRIDE&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/VTK_OVERRIDE/override/g&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Automatic update: Using clang-tidy'''&lt;br /&gt;
&lt;br /&gt;
'''Note''': Running ''clang-tidy -fix'' in parallel might cause problems, like appending multiple keywords to same function (override).  It can be fixed with a grep to remove duplicates.&lt;br /&gt;
&lt;br /&gt;
This will iteratively check files for updates. It takes a while. The sources are only modified at the end of the process, so you could cancel anytime before with no consequences.&lt;br /&gt;
&lt;br /&gt;
Compile Slicer with the CMake option -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON to generate the file compile_commands.json at configuration time.&lt;br /&gt;
Run clang-tidy on the generated compile_commands.json (in the build folder: Slicer-build)&lt;br /&gt;
&lt;br /&gt;
  run-clang-tidy.py -checks=-*,modernize-use-override  -header-filter=.* -fix&lt;br /&gt;
&lt;br /&gt;
'''Manual fix'''&lt;br /&gt;
&lt;br /&gt;
Multiple override are added to the same method. For example:&lt;br /&gt;
&lt;br /&gt;
  void PrintSelf(ostream&amp;amp; os, vtkIndent indent) override override override;&lt;br /&gt;
&lt;br /&gt;
We clean them with (15 here is just a high enough number):&lt;br /&gt;
&lt;br /&gt;
  for n in `seq 1 15`;&lt;br /&gt;
  do&lt;br /&gt;
      ack &amp;quot;override override&amp;quot; -l --print0 | xargs -0 -n 1 sed -i \&lt;br /&gt;
      's/override override/override/g'&lt;br /&gt;
  done&lt;br /&gt;
&lt;br /&gt;
When all of them are fixed, you should see in the terminal:&lt;br /&gt;
&lt;br /&gt;
  sed: no input files&lt;br /&gt;
&lt;br /&gt;
===C++11: Update source code to use = delete ===&lt;br /&gt;
&lt;br /&gt;
Instead of:&lt;br /&gt;
  vtkImageRectangularSource(const vtkImageRectangularSource&amp;amp;);  /// Not implemented.&lt;br /&gt;
  void operator=(const vtkImageRectangularSource&amp;amp;);  /// Not implemented.&lt;br /&gt;
&lt;br /&gt;
Replace for:&lt;br /&gt;
  vtkImageRectangularSource(const vtkImageRectangularSource&amp;amp;) = delete;&lt;br /&gt;
  void operator=(const vtkImageRectangularSource&amp;amp;) = delete;&lt;br /&gt;
&lt;br /&gt;
Same approach than before, use the compile_commands.json and clang-tidy in Slicer-build.&lt;br /&gt;
&lt;br /&gt;
  run-clang-tidy.py -checks=-*,modernize-use-equals-delete -header-filter=.* -fix&lt;br /&gt;
&lt;br /&gt;
Because we run it in parallel, multiple occurrences of = delete might have been added. Fix them with:&lt;br /&gt;
&lt;br /&gt;
 for n in `seq 1 15`;&lt;br /&gt;
 do&lt;br /&gt;
   ack &amp;quot;= delete = delete&amp;quot; -l --print0 | xargs -0 -n 1 sed -i \&lt;br /&gt;
   's/= delete = delete/= delete/g'&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
And also delete comment /// Not implemented, as now it is clear with = delete.&lt;br /&gt;
&lt;br /&gt;
ack &amp;quot;delete&amp;quot; -l --print0 | xargs -0 -n 1 sed -E -i 's@delete;[[:space:]]*\/*[[:space:]]*[nN]ot [iI]mplemented\.?@delete;@g' &lt;br /&gt;
ack &amp;quot;delete&amp;quot; -l --print0 | xargs -0 -n 1 sed -E -i 's@delete;[[:space:]]*\/*[[:space:]]*purposely [nN]ot [iI]mplemented\.?@delete;@g'&lt;br /&gt;
ack &amp;quot;delete&amp;quot; -l --print0 | xargs -0 -n 1 sed -E -i 's@delete ITK\_DELETED\_FUNCTION;@delete;@g'&lt;/div&gt;</summary>
		<author><name>Phcerdan</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval&amp;diff=60917</id>
		<title>Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval&amp;diff=60917"/>
		<updated>2019-03-16T18:29:11Z</updated>

		<summary type="html">&lt;p&gt;Phcerdan: /* Add c++11 update soruce to use = delete*/&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Obsolete Code Removal==&lt;br /&gt;
&lt;br /&gt;
This section documents suggested code changes after removing support for a particular features. Each category has a short description, code snippets, a suggested upgrade path, and references to relevant commits.&lt;br /&gt;
&lt;br /&gt;
===Qt&amp;gt;=5.0.0: Remove obsolete code supporting Qt4 plugin infrastructure (C++)===&lt;br /&gt;
&lt;br /&gt;
These changes apply to Qt loadable modules and designer plugins&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModuleWidgetsPlugin.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;quot;vtkSlicerConfigure.h&amp;quot; // For Slicer_HAVE_QT5&lt;br /&gt;
&lt;br /&gt;
// Qt includes&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
#include &amp;lt;QtUiPlugin/QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
#else&lt;br /&gt;
#include &amp;lt;QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
class Q_SLICER_MODULE_SUBJECTHIERARCHY_WIDGETS_PLUGINS_EXPORT qSlicerSubjectHierarchyModuleWidgetsPlugin&lt;br /&gt;
  : public QObject&lt;br /&gt;
  , public QDesignerCustomWidgetCollectionInterface&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetCollectionInterface&amp;quot;)&lt;br /&gt;
#endif&lt;br /&gt;
  Q_INTERFACES(QDesignerCustomWidgetCollectionInterface);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Qt includes&lt;br /&gt;
#include &amp;lt;QtUiPlugin/QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
class Q_SLICER_MODULE_SUBJECTHIERARCHY_WIDGETS_PLUGINS_EXPORT qSlicerSubjectHierarchyModuleWidgetsPlugin&lt;br /&gt;
  : public QObject&lt;br /&gt;
  , public QDesignerCustomWidgetCollectionInterface&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetCollectionInterface&amp;quot;)&lt;br /&gt;
  Q_INTERFACES(QDesignerCustomWidgetCollectionInterface);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModule.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Q_SLICER_QTMODULES_SUBJECTHIERARCHY_EXPORT qSlicerSubjectHierarchyModule :&lt;br /&gt;
  public qSlicerLoadableModule&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.slicer.modules.loadable.qSlicerLoadableModule/1.0&amp;quot;);&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Q_SLICER_QTMODULES_SUBJECTHIERARCHY_EXPORT qSlicerSubjectHierarchyModule :&lt;br /&gt;
  public qSlicerLoadableModule&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.slicer.modules.loadable.qSlicerLoadableModule/1.0&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModuleWidgetsAbstractPlugin.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  #include &amp;lt;QtGlobal&amp;gt;&lt;br /&gt;
  #if(QT_VERSION &amp;lt; QT_VERSION_CHECKS(5, 0, 0))&lt;br /&gt;
  #include &amp;lt;QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
  #else&lt;br /&gt;
  #include &amp;lt;QtUiPlugin/QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
  [...]&lt;br /&gt;
&lt;br /&gt;
  class Q_SLICER_MODULE_SEGMENTATIONS_WIDGETS_PLUGINS_EXPORT qSlicerSegmentationsModuleWidgetsAbstractPlugin&lt;br /&gt;
      : public QDesignerCustomWidgetInterface&lt;br /&gt;
  {&lt;br /&gt;
  #if (QT_VERSION &amp;gt;= QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
    Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetInterface&amp;quot;)&lt;br /&gt;
  #endif&lt;br /&gt;
    Q_INTERFACES(QDesignerCustomWidgetInterface);&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  #include &amp;lt;QtUiPlugin/QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  [...]&lt;br /&gt;
&lt;br /&gt;
  class Q_SLICER_MODULE_SEGMENTATIONS_WIDGETS_PLUGINS_EXPORT qSlicerSegmentationsModuleWidgetsAbstractPlugin&lt;br /&gt;
      : public QDesignerCustomWidgetInterface&lt;br /&gt;
  {&lt;br /&gt;
    Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetInterface&amp;quot;)&lt;br /&gt;
    Q_INTERFACES(QDesignerCustomWidgetInterface);&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModule.cxx and qSlicerNAMEModuleWidgetsAbstractPlugin.cxx====&lt;br /&gt;
&lt;br /&gt;
'''Remove:'''&lt;br /&gt;
&lt;br /&gt;
  #if (QT_VERSION &amp;lt; QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
  #include &amp;lt;QtPlugin&amp;gt;&lt;br /&gt;
  Q_EXPORT_PLUGIN2(customwidgetplugin, qSlicerSegmentationsModuleWidgetsPlugin);&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
===Qt&amp;gt;=5.0.0: Simpler use of QHeaderView::setSectionResizeMode===&lt;br /&gt;
&lt;br /&gt;
This migration guide entry is obsolete: [[Documentation/Nightly/Developers/Tutorials/MigrationGuide#Qt5:_Fix_error:_.E2.80.98class_QHeaderView.E2.80.99_has_no_member_named_.E2.80.98setResizeMode.E2.80.99]]&lt;br /&gt;
&lt;br /&gt;
'''Solution for Cpp'''&lt;br /&gt;
&lt;br /&gt;
Before:&lt;br /&gt;
&lt;br /&gt;
  #if (QT_VERSION &amp;lt; QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(QHeaderView::Stretch);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
  #else&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::Stretch);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::Stretch);&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Solution for Python'''&lt;br /&gt;
&lt;br /&gt;
Before:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def _setSectionResizeMode(header, *args, **kwargs):&lt;br /&gt;
    if version.parse(qt.Qt.qVersion()) &amp;lt; version.parse(&amp;quot;5.0.0&amp;quot;):&lt;br /&gt;
      header.setResizeMode(*args, **kwargs)&lt;br /&gt;
    else:&lt;br /&gt;
      header.setSectionResizeMode(*args, **kwargs)&lt;br /&gt;
&lt;br /&gt;
    [...]&lt;br /&gt;
   &lt;br /&gt;
  _setSectionResizeMode(self.horizontalHeader(), 0, qt.QHeaderView.Stretch)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After:&lt;br /&gt;
&lt;br /&gt;
  self.horizontalHeader().setSectionResizeMode(0, qt.QHeaderView.Stretch)&lt;br /&gt;
&lt;br /&gt;
===C++11: Update source code to use nullptr===&lt;br /&gt;
&lt;br /&gt;
C++11 introduced the keyword &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt; allowing to explicitly identify a pointer of type &amp;lt;tt&amp;gt;std::nullptr_t&amp;lt;/tt&amp;gt;. It avoids ambiguous function overloads. See also https://stackoverflow.com/questions/20509734/null-vs-nullptr-why-was-it-replaced&lt;br /&gt;
&lt;br /&gt;
Prior to supporting only C++11, &amp;lt;tt&amp;gt;0&amp;lt;/tt&amp;gt; and [http://www.cplusplus.com/reference/cstring/NULL/ NULL] integral type were used to check for pointer value, and macro like &amp;lt;tt&amp;gt;Q_NULLPTR&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;ITK_NULLPTR&amp;lt;/tt&amp;gt; macros were used to ensure usage of &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt; when C++11 support was enabled.&lt;br /&gt;
&lt;br /&gt;
Updating the code base to use &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt; is done applying these methods:&lt;br /&gt;
* clang-tidy for updating source code being explicitly compiled in the project.&lt;br /&gt;
* regular expression for replacing occurrences of &amp;lt;tt&amp;gt;NULL&amp;lt;/tt&amp;gt; in source code not being compiled (e.g conditionally compiled code, templated headers, comments)&lt;br /&gt;
* replacement of occurences of &amp;lt;tt&amp;gt;VTK_NULLPTR&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;ITK_NULLPTR&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;Q_NULLPTR&amp;lt;/tt&amp;gt; with &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Using clang-tidy'''&lt;br /&gt;
&lt;br /&gt;
This will iteratively check files for updates. It takes a while. The sources are only modified at the end of the process, so you could cancel anytime before with no consequences.&lt;br /&gt;
# Compile Slicer with the CMake option -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON to generate the file compile_commands.json at configuration time.&lt;br /&gt;
# Run clang-tidy on the generated compile_commands.json (in the build folder: Slicer-build)&lt;br /&gt;
  run-clang-tidy.py -header-filter='.*' -checks='-*,modernize-use-nullptr' -fix&lt;br /&gt;
[http://clang.llvm.org/extra/clang-tidy/ clang-tidy] is a tool from clang. In Archlinux: sudo pacman -S clang, in other distros might be clang-extra-tools or similar.&lt;br /&gt;
&lt;br /&gt;
clang-tidy will substitute NULL and 0 for nullptr when appropriate. It is an iterative process, so it may take time. Also, it replaces all the compiled code, including external dependencies.&lt;br /&gt;
It is recommended to do a fresh build with the modified code, for testing it without modifications in any external repo.&lt;br /&gt;
&lt;br /&gt;
'''Using regex for replacing NULL in comments and not-compiled code'''&lt;br /&gt;
&lt;br /&gt;
After clang-tidy has modified the compiled code with the help of compile_commands.json, there will still be ignored instances of NULL and 0 in some headers, and comments.&lt;br /&gt;
&lt;br /&gt;
Manually replace with the following regex to change those.&lt;br /&gt;
&lt;br /&gt;
1) Change NULL to nullptr except when there is a quote or an underscore in&lt;br /&gt;
front of it. And there is not a quote after.&lt;br /&gt;
&lt;br /&gt;
  ack --type-add=cpp:ext:hxx,hpp,txx,tpp,cxx,cpp,c,cc --cpp &amp;quot;NULL&amp;quot; -l --print0 | xargs -0 -n 1 sed -i 's/\([^\&amp;quot;\_]\)NULL\([^\&amp;quot;\_]\)/\1nullptr\2/g'&lt;br /&gt;
&lt;br /&gt;
2) The same than before but match end of line NULL&lt;br /&gt;
  ack --type-add=cpp:ext:hxx,hpp,txx,tpp,cxx,cpp,c,cc --cpp &amp;quot;NULL&amp;quot; -l --print0 | xargs -0 -n 1 sed -i 's/\([^\&amp;quot;\_]\)NULL$/\1nullptr/g'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Replace ITK_NULLPTR, VTK_NULLPTR, Q_NULLPTR'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- For an example of commit message, see [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=28022 r28022] --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It was adapted from the ITK script in [https://github.com/InsightSoftwareConsortium/ITK/blob/v5.0rc01/Utilities/ITKv5Preparation/ReplaceITK_NULLPTRMacroNames.sh ReplaceITK_NULLPTRMacroNames.sh]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;ITK_NULLPTR&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;git grep -l &amp;quot;ITK_NULLPTR&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/ITK_NULLPTR/nullptr/g&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;VTK_NULLPTR&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;git grep -l &amp;quot;VTK_NULLPTR&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/VTK_NULLPTR/nullptr/g&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;Q_NULLPTR&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;git grep -l &amp;quot;Q_NULLPTR&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/Q_NULLPTR/nullptr/g&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===C++11: Update source code to use override===&lt;br /&gt;
&lt;br /&gt;
From: https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-override.html&lt;br /&gt;
&lt;br /&gt;
Adds override (introduced in C++11) to overridden virtual functions and removes virtual from those functions as it is not required.&lt;br /&gt;
&lt;br /&gt;
virtual on non base class implementations was used to help indicate to the user that a function was virtual. C++ compilers did not use the presence of this to signify an overriden function.&lt;br /&gt;
&lt;br /&gt;
In C++ 11 override and final keywords were introduced to allow overridden functions to be marked appropriately. Their presence allows compilers to verify that an overridden function correctly overrides a base class implementation.&lt;br /&gt;
&lt;br /&gt;
This can be useful as compilers can generate a compile time error when:&lt;br /&gt;
&lt;br /&gt;
# The base class implementation function signature changes.&lt;br /&gt;
# The user has not created the override with the correct signature.&lt;br /&gt;
&lt;br /&gt;
First we replace ITK_OVERRIDE and VTK_OVERRIDE for override:&lt;br /&gt;
&lt;br /&gt;
'''Replace ITK_OVERRIDE and VTK_OVERRIDE'''&lt;br /&gt;
&lt;br /&gt;
For an example of commit message, see [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=28022 r28022]&lt;br /&gt;
&lt;br /&gt;
The regexp involving ITK was extracted from the [https://github.com/InsightSoftwareConsortium/ITK/blob/master/Utilities/ITKv5Preparation/ReplaceITK_OVERRIDEMacroNames.sh ReplaceITK_OVERRIDEMacroNames.sh] script in ITK.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;ITK_OVERRIDE&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;git grep -l &amp;quot;ITK_OVERRIDE&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/ITK_OVERRIDE/override/g&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;VTK_OVERRIDE&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;git grep -l &amp;quot;VTK_OVERRIDE&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/VTK_OVERRIDE/override/g&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Automatic update: Using clang-tidy'''&lt;br /&gt;
&lt;br /&gt;
'''Note''': Running ''clang-tidy -fix'' in parallel might cause problems, like appending multiple keywords to same function (override).  It can be fixed with a grep to remove duplicates.&lt;br /&gt;
&lt;br /&gt;
This will iteratively check files for updates. It takes a while. The sources are only modified at the end of the process, so you could cancel anytime before with no consequences.&lt;br /&gt;
&lt;br /&gt;
Compile Slicer with the CMake option -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON to generate the file compile_commands.json at configuration time.&lt;br /&gt;
Run clang-tidy on the generated compile_commands.json (in the build folder: Slicer-build)&lt;br /&gt;
&lt;br /&gt;
  run-clang-tidy.py -checks=-*,modernize-use-override  -header-filter=.* -fix&lt;br /&gt;
&lt;br /&gt;
'''Manual fix'''&lt;br /&gt;
&lt;br /&gt;
Multiple override are added to the same method. For example:&lt;br /&gt;
&lt;br /&gt;
  void PrintSelf(ostream&amp;amp; os, vtkIndent indent) override override override;&lt;br /&gt;
&lt;br /&gt;
We clean them with (15 here is just a high enough number):&lt;br /&gt;
&lt;br /&gt;
  for n in `seq 1 15`;&lt;br /&gt;
  do&lt;br /&gt;
      ack &amp;quot;override override&amp;quot; -l --print0 | xargs -0 -n 1 sed -i \&lt;br /&gt;
      's/override override/override/g'&lt;br /&gt;
  done&lt;br /&gt;
&lt;br /&gt;
When all of them are fixed, you should see in the terminal:&lt;br /&gt;
&lt;br /&gt;
  sed: no input files&lt;br /&gt;
&lt;br /&gt;
===C++11: Update source code to use = delete ===&lt;br /&gt;
&lt;br /&gt;
Instead of:&lt;br /&gt;
  vtkImageRectangularSource(const vtkImageRectangularSource&amp;amp;);  /// Not implemented.&lt;br /&gt;
  void operator=(const vtkImageRectangularSource&amp;amp;);  /// Not implemented.&lt;br /&gt;
&lt;br /&gt;
Replace for:&lt;br /&gt;
  vtkImageRectangularSource(const vtkImageRectangularSource&amp;amp;) = delete;&lt;br /&gt;
  void operator=(const vtkImageRectangularSource&amp;amp;) = delete;&lt;br /&gt;
&lt;br /&gt;
Same approach than before, use the compile_commands.json and clang-tidy in Slicer-build.&lt;br /&gt;
&lt;br /&gt;
  run-clang-tidy.py -checks=-*,modernize-use-equals-delete -header-filter=.* -fix&lt;/div&gt;</summary>
		<author><name>Phcerdan</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval&amp;diff=60915</id>
		<title>Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval&amp;diff=60915"/>
		<updated>2019-03-15T17:24:22Z</updated>

		<summary type="html">&lt;p&gt;Phcerdan: /* C++11: Update source code to use override */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Obsolete Code Removal==&lt;br /&gt;
&lt;br /&gt;
This section documents suggested code changes after removing support for a particular features. Each category has a short description, code snippets, a suggested upgrade path, and references to relevant commits.&lt;br /&gt;
&lt;br /&gt;
===Qt&amp;gt;=5.0.0: Remove obsolete code supporting Qt4 plugin infrastructure (C++)===&lt;br /&gt;
&lt;br /&gt;
These changes apply to Qt loadable modules and designer plugins&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModuleWidgetsPlugin.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;quot;vtkSlicerConfigure.h&amp;quot; // For Slicer_HAVE_QT5&lt;br /&gt;
&lt;br /&gt;
// Qt includes&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
#include &amp;lt;QtUiPlugin/QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
#else&lt;br /&gt;
#include &amp;lt;QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
class Q_SLICER_MODULE_SUBJECTHIERARCHY_WIDGETS_PLUGINS_EXPORT qSlicerSubjectHierarchyModuleWidgetsPlugin&lt;br /&gt;
  : public QObject&lt;br /&gt;
  , public QDesignerCustomWidgetCollectionInterface&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetCollectionInterface&amp;quot;)&lt;br /&gt;
#endif&lt;br /&gt;
  Q_INTERFACES(QDesignerCustomWidgetCollectionInterface);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Qt includes&lt;br /&gt;
#include &amp;lt;QtUiPlugin/QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
class Q_SLICER_MODULE_SUBJECTHIERARCHY_WIDGETS_PLUGINS_EXPORT qSlicerSubjectHierarchyModuleWidgetsPlugin&lt;br /&gt;
  : public QObject&lt;br /&gt;
  , public QDesignerCustomWidgetCollectionInterface&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetCollectionInterface&amp;quot;)&lt;br /&gt;
  Q_INTERFACES(QDesignerCustomWidgetCollectionInterface);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModule.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Q_SLICER_QTMODULES_SUBJECTHIERARCHY_EXPORT qSlicerSubjectHierarchyModule :&lt;br /&gt;
  public qSlicerLoadableModule&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.slicer.modules.loadable.qSlicerLoadableModule/1.0&amp;quot;);&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Q_SLICER_QTMODULES_SUBJECTHIERARCHY_EXPORT qSlicerSubjectHierarchyModule :&lt;br /&gt;
  public qSlicerLoadableModule&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.slicer.modules.loadable.qSlicerLoadableModule/1.0&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModuleWidgetsAbstractPlugin.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  #include &amp;lt;QtGlobal&amp;gt;&lt;br /&gt;
  #if(QT_VERSION &amp;lt; QT_VERSION_CHECKS(5, 0, 0))&lt;br /&gt;
  #include &amp;lt;QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
  #else&lt;br /&gt;
  #include &amp;lt;QtUiPlugin/QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
  [...]&lt;br /&gt;
&lt;br /&gt;
  class Q_SLICER_MODULE_SEGMENTATIONS_WIDGETS_PLUGINS_EXPORT qSlicerSegmentationsModuleWidgetsAbstractPlugin&lt;br /&gt;
      : public QDesignerCustomWidgetInterface&lt;br /&gt;
  {&lt;br /&gt;
  #if (QT_VERSION &amp;gt;= QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
    Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetInterface&amp;quot;)&lt;br /&gt;
  #endif&lt;br /&gt;
    Q_INTERFACES(QDesignerCustomWidgetInterface);&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  #include &amp;lt;QtUiPlugin/QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  [...]&lt;br /&gt;
&lt;br /&gt;
  class Q_SLICER_MODULE_SEGMENTATIONS_WIDGETS_PLUGINS_EXPORT qSlicerSegmentationsModuleWidgetsAbstractPlugin&lt;br /&gt;
      : public QDesignerCustomWidgetInterface&lt;br /&gt;
  {&lt;br /&gt;
    Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetInterface&amp;quot;)&lt;br /&gt;
    Q_INTERFACES(QDesignerCustomWidgetInterface);&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModule.cxx and qSlicerNAMEModuleWidgetsAbstractPlugin.cxx====&lt;br /&gt;
&lt;br /&gt;
'''Remove:'''&lt;br /&gt;
&lt;br /&gt;
  #if (QT_VERSION &amp;lt; QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
  #include &amp;lt;QtPlugin&amp;gt;&lt;br /&gt;
  Q_EXPORT_PLUGIN2(customwidgetplugin, qSlicerSegmentationsModuleWidgetsPlugin);&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
===Qt&amp;gt;=5.0.0: Simpler use of QHeaderView::setSectionResizeMode===&lt;br /&gt;
&lt;br /&gt;
This migration guide entry is obsolete: [[Documentation/Nightly/Developers/Tutorials/MigrationGuide#Qt5:_Fix_error:_.E2.80.98class_QHeaderView.E2.80.99_has_no_member_named_.E2.80.98setResizeMode.E2.80.99]]&lt;br /&gt;
&lt;br /&gt;
'''Solution for Cpp'''&lt;br /&gt;
&lt;br /&gt;
Before:&lt;br /&gt;
&lt;br /&gt;
  #if (QT_VERSION &amp;lt; QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(QHeaderView::Stretch);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
  #else&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::Stretch);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::Stretch);&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Solution for Python'''&lt;br /&gt;
&lt;br /&gt;
Before:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def _setSectionResizeMode(header, *args, **kwargs):&lt;br /&gt;
    if version.parse(qt.Qt.qVersion()) &amp;lt; version.parse(&amp;quot;5.0.0&amp;quot;):&lt;br /&gt;
      header.setResizeMode(*args, **kwargs)&lt;br /&gt;
    else:&lt;br /&gt;
      header.setSectionResizeMode(*args, **kwargs)&lt;br /&gt;
&lt;br /&gt;
    [...]&lt;br /&gt;
   &lt;br /&gt;
  _setSectionResizeMode(self.horizontalHeader(), 0, qt.QHeaderView.Stretch)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After:&lt;br /&gt;
&lt;br /&gt;
  self.horizontalHeader().setSectionResizeMode(0, qt.QHeaderView.Stretch)&lt;br /&gt;
&lt;br /&gt;
===C++11: Update source code to use nullptr===&lt;br /&gt;
&lt;br /&gt;
C++11 introduced the keyword &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt; allowing to explicitly identify a pointer of type &amp;lt;tt&amp;gt;std::nullptr_t&amp;lt;/tt&amp;gt;. It avoids ambiguous function overloads. See also https://stackoverflow.com/questions/20509734/null-vs-nullptr-why-was-it-replaced&lt;br /&gt;
&lt;br /&gt;
Prior to supporting only C++11, &amp;lt;tt&amp;gt;0&amp;lt;/tt&amp;gt; and [http://www.cplusplus.com/reference/cstring/NULL/ NULL] integral type were used to check for pointer value, and macro like &amp;lt;tt&amp;gt;Q_NULLPTR&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;ITK_NULLPTR&amp;lt;/tt&amp;gt; macros were used to ensure usage of &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt; when C++11 support was enabled.&lt;br /&gt;
&lt;br /&gt;
Updating the code base to use &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt; is done applying these methods:&lt;br /&gt;
* clang-tidy for updating source code being explicitly compiled in the project.&lt;br /&gt;
* regular expression for replacing occurrences of &amp;lt;tt&amp;gt;NULL&amp;lt;/tt&amp;gt; in source code not being compiled (e.g conditionally compiled code, templated headers, comments)&lt;br /&gt;
* replacement of occurences of &amp;lt;tt&amp;gt;VTK_NULLPTR&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;ITK_NULLPTR&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;Q_NULLPTR&amp;lt;/tt&amp;gt; with &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Using clang-tidy'''&lt;br /&gt;
&lt;br /&gt;
This will iteratively check files for updates. It takes a while. The sources are only modified at the end of the process, so you could cancel anytime before with no consequences.&lt;br /&gt;
# Compile Slicer with the CMake option -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON to generate the file compile_commands.json at configuration time.&lt;br /&gt;
# Run clang-tidy on the generated compile_commands.json (in the build folder: Slicer-build)&lt;br /&gt;
  run-clang-tidy.py -header-filter='.*' -checks='-*,modernize-use-nullptr' -fix&lt;br /&gt;
[http://clang.llvm.org/extra/clang-tidy/ clang-tidy] is a tool from clang. In Archlinux: sudo pacman -S clang, in other distros might be clang-extra-tools or similar.&lt;br /&gt;
&lt;br /&gt;
clang-tidy will substitute NULL and 0 for nullptr when appropriate. It is an iterative process, so it may take time. Also, it replaces all the compiled code, including external dependencies.&lt;br /&gt;
It is recommended to do a fresh build with the modified code, for testing it without modifications in any external repo.&lt;br /&gt;
&lt;br /&gt;
'''Using regex for replacing NULL in comments and not-compiled code'''&lt;br /&gt;
&lt;br /&gt;
After clang-tidy has modified the compiled code with the help of compile_commands.json, there will still be ignored instances of NULL and 0 in some headers, and comments.&lt;br /&gt;
&lt;br /&gt;
Manually replace with the following regex to change those.&lt;br /&gt;
&lt;br /&gt;
1) Change NULL to nullptr except when there is a quote or an underscore in&lt;br /&gt;
front of it. And there is not a quote after.&lt;br /&gt;
&lt;br /&gt;
  ack --cpp &amp;quot;NULL&amp;quot; -l --print0 | xargs -0 -n 1 sed -i 's/\([^\&amp;quot;\_]\)NULL\([^\&amp;quot;\_]\)/\1nullptr\2/g'&lt;br /&gt;
&lt;br /&gt;
2) The same than before but match end of line NULL&lt;br /&gt;
  ack --cpp &amp;quot;NULL&amp;quot; -l --print0 | xargs -0 -n 1 sed -i 's/\([^\&amp;quot;\_]\)NULL$/\1nullptr/g'&lt;br /&gt;
&lt;br /&gt;
'''Replace ITK_NULLPTR, VTK_NULLPTR, Q_NULLPTR'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- For an example of commit message, see [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=28022 r28022] --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It was adapted from the ITK script in [https://github.com/InsightSoftwareConsortium/ITK/blob/v5.0rc01/Utilities/ITKv5Preparation/ReplaceITK_NULLPTRMacroNames.sh ReplaceITK_NULLPTRMacroNames.sh]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;ITK_NULLPTR&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;git grep -l &amp;quot;ITK_NULLPTR&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/ITK_NULLPTR/nullptr/g&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;VTK_NULLPTR&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;git grep -l &amp;quot;VTK_NULLPTR&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/VTK_NULLPTR/nullptr/g&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;Q_NULLPTR&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;git grep -l &amp;quot;Q_NULLPTR&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/Q_NULLPTR/nullptr/g&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===C++11: Update source code to use override===&lt;br /&gt;
&lt;br /&gt;
From: https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-override.html&lt;br /&gt;
&lt;br /&gt;
Adds override (introduced in C++11) to overridden virtual functions and removes virtual from those functions as it is not required.&lt;br /&gt;
&lt;br /&gt;
virtual on non base class implementations was used to help indicate to the user that a function was virtual. C++ compilers did not use the presence of this to signify an overriden function.&lt;br /&gt;
&lt;br /&gt;
In C++ 11 override and final keywords were introduced to allow overridden functions to be marked appropriately. Their presence allows compilers to verify that an overridden function correctly overrides a base class implementation.&lt;br /&gt;
&lt;br /&gt;
This can be useful as compilers can generate a compile time error when:&lt;br /&gt;
&lt;br /&gt;
# The base class implementation function signature changes.&lt;br /&gt;
# The user has not created the override with the correct signature.&lt;br /&gt;
&lt;br /&gt;
First we replace ITK_OVERRIDE and VTK_OVERRIDE for override:&lt;br /&gt;
&lt;br /&gt;
'''Replace ITK_OVERRIDE and VTK_OVERRIDE'''&lt;br /&gt;
&lt;br /&gt;
For an example of commit message, see [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=28022 r28022]&lt;br /&gt;
&lt;br /&gt;
The regexp involving ITK was extracted from the [https://github.com/InsightSoftwareConsortium/ITK/blob/master/Utilities/ITKv5Preparation/ReplaceITK_OVERRIDEMacroNames.sh ReplaceITK_OVERRIDEMacroNames.sh] script in ITK.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;ITK_OVERRIDE&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;git grep -l &amp;quot;ITK_OVERRIDE&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/ITK_OVERRIDE/override/g&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;VTK_OVERRIDE&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;git grep -l &amp;quot;VTK_OVERRIDE&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/VTK_OVERRIDE/override/g&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Automatic update: Using clang-tidy'''&lt;br /&gt;
&lt;br /&gt;
'''Note''': Running ''clang-tidy -fix'' in parallel might cause problems, like appending multiple keywords to same function (override).  It can be fixed with a grep to remove duplicates.&lt;br /&gt;
&lt;br /&gt;
This will iteratively check files for updates. It takes a while. The sources are only modified at the end of the process, so you could cancel anytime before with no consequences.&lt;br /&gt;
&lt;br /&gt;
Compile Slicer with the CMake option -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON to generate the file compile_commands.json at configuration time.&lt;br /&gt;
Run clang-tidy on the generated compile_commands.json (in the build folder: Slicer-build)&lt;br /&gt;
&lt;br /&gt;
  run-clang-tidy.py -checks=-*,modernize-use-override  -header-filter=.* -fix&lt;br /&gt;
&lt;br /&gt;
'''Manual fix'''&lt;br /&gt;
&lt;br /&gt;
Multiple override are added to the same method. For example:&lt;br /&gt;
&lt;br /&gt;
  void PrintSelf(ostream&amp;amp; os, vtkIndent indent) override override override;&lt;br /&gt;
&lt;br /&gt;
We clean them with (15 here is just a high enough number):&lt;br /&gt;
&lt;br /&gt;
  for n in `seq 1 15`;&lt;br /&gt;
  do&lt;br /&gt;
      ack &amp;quot;override override&amp;quot; -l --print0 | xargs -0 -n 1 sed -i \&lt;br /&gt;
      's/override override/override/g'&lt;br /&gt;
  done&lt;br /&gt;
&lt;br /&gt;
When all of them are fixed, you should see in the terminal:&lt;br /&gt;
&lt;br /&gt;
  sed: no input files&lt;br /&gt;
&lt;br /&gt;
'''WIP:Adding missing overrides'''&lt;br /&gt;
&lt;br /&gt;
We use the clang compiler to generate warnings about missing overrides with the option -Winconsistent-missing-override.&lt;br /&gt;
&lt;br /&gt;
We then add the missing overrides with the script [https://github.com/Kitware/VTK/blob/master/Utilities/Maintenance/AddOverrides.py AddOverrides.py]&lt;br /&gt;
&lt;br /&gt;
  ninja clean&lt;br /&gt;
  ninja &amp;amp;&amp;gt; output.txt&lt;br /&gt;
  grep &amp;quot;overrides a member function but&amp;quot; output.txt | sort | uniq &amp;gt; overrides.txt&lt;br /&gt;
  python AddOverrides.py &amp;lt;overrides.txt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
However only one override was located, in the macro: qSlicerGetTittleMacro in qSlicerAbstractCoreModule.h&lt;br /&gt;
Note that the script `erroneously` adds the override to every instance of the macro.&lt;br /&gt;
The macro was updated.&lt;br /&gt;
   &lt;br /&gt;
  qSlicerGetTitleMacro(&amp;quot;Loadable Hello world&amp;quot;) override;&lt;/div&gt;</summary>
		<author><name>Phcerdan</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval&amp;diff=60914</id>
		<title>Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval&amp;diff=60914"/>
		<updated>2019-03-15T17:23:44Z</updated>

		<summary type="html">&lt;p&gt;Phcerdan: /* C++11: Update source code to use override */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Obsolete Code Removal==&lt;br /&gt;
&lt;br /&gt;
This section documents suggested code changes after removing support for a particular features. Each category has a short description, code snippets, a suggested upgrade path, and references to relevant commits.&lt;br /&gt;
&lt;br /&gt;
===Qt&amp;gt;=5.0.0: Remove obsolete code supporting Qt4 plugin infrastructure (C++)===&lt;br /&gt;
&lt;br /&gt;
These changes apply to Qt loadable modules and designer plugins&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModuleWidgetsPlugin.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;quot;vtkSlicerConfigure.h&amp;quot; // For Slicer_HAVE_QT5&lt;br /&gt;
&lt;br /&gt;
// Qt includes&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
#include &amp;lt;QtUiPlugin/QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
#else&lt;br /&gt;
#include &amp;lt;QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
class Q_SLICER_MODULE_SUBJECTHIERARCHY_WIDGETS_PLUGINS_EXPORT qSlicerSubjectHierarchyModuleWidgetsPlugin&lt;br /&gt;
  : public QObject&lt;br /&gt;
  , public QDesignerCustomWidgetCollectionInterface&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetCollectionInterface&amp;quot;)&lt;br /&gt;
#endif&lt;br /&gt;
  Q_INTERFACES(QDesignerCustomWidgetCollectionInterface);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Qt includes&lt;br /&gt;
#include &amp;lt;QtUiPlugin/QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
class Q_SLICER_MODULE_SUBJECTHIERARCHY_WIDGETS_PLUGINS_EXPORT qSlicerSubjectHierarchyModuleWidgetsPlugin&lt;br /&gt;
  : public QObject&lt;br /&gt;
  , public QDesignerCustomWidgetCollectionInterface&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetCollectionInterface&amp;quot;)&lt;br /&gt;
  Q_INTERFACES(QDesignerCustomWidgetCollectionInterface);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModule.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Q_SLICER_QTMODULES_SUBJECTHIERARCHY_EXPORT qSlicerSubjectHierarchyModule :&lt;br /&gt;
  public qSlicerLoadableModule&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.slicer.modules.loadable.qSlicerLoadableModule/1.0&amp;quot;);&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Q_SLICER_QTMODULES_SUBJECTHIERARCHY_EXPORT qSlicerSubjectHierarchyModule :&lt;br /&gt;
  public qSlicerLoadableModule&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.slicer.modules.loadable.qSlicerLoadableModule/1.0&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModuleWidgetsAbstractPlugin.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  #include &amp;lt;QtGlobal&amp;gt;&lt;br /&gt;
  #if(QT_VERSION &amp;lt; QT_VERSION_CHECKS(5, 0, 0))&lt;br /&gt;
  #include &amp;lt;QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
  #else&lt;br /&gt;
  #include &amp;lt;QtUiPlugin/QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
  [...]&lt;br /&gt;
&lt;br /&gt;
  class Q_SLICER_MODULE_SEGMENTATIONS_WIDGETS_PLUGINS_EXPORT qSlicerSegmentationsModuleWidgetsAbstractPlugin&lt;br /&gt;
      : public QDesignerCustomWidgetInterface&lt;br /&gt;
  {&lt;br /&gt;
  #if (QT_VERSION &amp;gt;= QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
    Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetInterface&amp;quot;)&lt;br /&gt;
  #endif&lt;br /&gt;
    Q_INTERFACES(QDesignerCustomWidgetInterface);&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  #include &amp;lt;QtUiPlugin/QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  [...]&lt;br /&gt;
&lt;br /&gt;
  class Q_SLICER_MODULE_SEGMENTATIONS_WIDGETS_PLUGINS_EXPORT qSlicerSegmentationsModuleWidgetsAbstractPlugin&lt;br /&gt;
      : public QDesignerCustomWidgetInterface&lt;br /&gt;
  {&lt;br /&gt;
    Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetInterface&amp;quot;)&lt;br /&gt;
    Q_INTERFACES(QDesignerCustomWidgetInterface);&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModule.cxx and qSlicerNAMEModuleWidgetsAbstractPlugin.cxx====&lt;br /&gt;
&lt;br /&gt;
'''Remove:'''&lt;br /&gt;
&lt;br /&gt;
  #if (QT_VERSION &amp;lt; QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
  #include &amp;lt;QtPlugin&amp;gt;&lt;br /&gt;
  Q_EXPORT_PLUGIN2(customwidgetplugin, qSlicerSegmentationsModuleWidgetsPlugin);&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
===Qt&amp;gt;=5.0.0: Simpler use of QHeaderView::setSectionResizeMode===&lt;br /&gt;
&lt;br /&gt;
This migration guide entry is obsolete: [[Documentation/Nightly/Developers/Tutorials/MigrationGuide#Qt5:_Fix_error:_.E2.80.98class_QHeaderView.E2.80.99_has_no_member_named_.E2.80.98setResizeMode.E2.80.99]]&lt;br /&gt;
&lt;br /&gt;
'''Solution for Cpp'''&lt;br /&gt;
&lt;br /&gt;
Before:&lt;br /&gt;
&lt;br /&gt;
  #if (QT_VERSION &amp;lt; QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(QHeaderView::Stretch);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
  #else&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::Stretch);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::Stretch);&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Solution for Python'''&lt;br /&gt;
&lt;br /&gt;
Before:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def _setSectionResizeMode(header, *args, **kwargs):&lt;br /&gt;
    if version.parse(qt.Qt.qVersion()) &amp;lt; version.parse(&amp;quot;5.0.0&amp;quot;):&lt;br /&gt;
      header.setResizeMode(*args, **kwargs)&lt;br /&gt;
    else:&lt;br /&gt;
      header.setSectionResizeMode(*args, **kwargs)&lt;br /&gt;
&lt;br /&gt;
    [...]&lt;br /&gt;
   &lt;br /&gt;
  _setSectionResizeMode(self.horizontalHeader(), 0, qt.QHeaderView.Stretch)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After:&lt;br /&gt;
&lt;br /&gt;
  self.horizontalHeader().setSectionResizeMode(0, qt.QHeaderView.Stretch)&lt;br /&gt;
&lt;br /&gt;
===C++11: Update source code to use nullptr===&lt;br /&gt;
&lt;br /&gt;
C++11 introduced the keyword &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt; allowing to explicitly identify a pointer of type &amp;lt;tt&amp;gt;std::nullptr_t&amp;lt;/tt&amp;gt;. It avoids ambiguous function overloads. See also https://stackoverflow.com/questions/20509734/null-vs-nullptr-why-was-it-replaced&lt;br /&gt;
&lt;br /&gt;
Prior to supporting only C++11, &amp;lt;tt&amp;gt;0&amp;lt;/tt&amp;gt; and [http://www.cplusplus.com/reference/cstring/NULL/ NULL] integral type were used to check for pointer value, and macro like &amp;lt;tt&amp;gt;Q_NULLPTR&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;ITK_NULLPTR&amp;lt;/tt&amp;gt; macros were used to ensure usage of &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt; when C++11 support was enabled.&lt;br /&gt;
&lt;br /&gt;
Updating the code base to use &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt; is done applying these methods:&lt;br /&gt;
* clang-tidy for updating source code being explicitly compiled in the project.&lt;br /&gt;
* regular expression for replacing occurrences of &amp;lt;tt&amp;gt;NULL&amp;lt;/tt&amp;gt; in source code not being compiled (e.g conditionally compiled code, templated headers, comments)&lt;br /&gt;
* replacement of occurences of &amp;lt;tt&amp;gt;VTK_NULLPTR&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;ITK_NULLPTR&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;Q_NULLPTR&amp;lt;/tt&amp;gt; with &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Using clang-tidy'''&lt;br /&gt;
&lt;br /&gt;
This will iteratively check files for updates. It takes a while. The sources are only modified at the end of the process, so you could cancel anytime before with no consequences.&lt;br /&gt;
# Compile Slicer with the CMake option -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON to generate the file compile_commands.json at configuration time.&lt;br /&gt;
# Run clang-tidy on the generated compile_commands.json (in the build folder: Slicer-build)&lt;br /&gt;
  run-clang-tidy.py -header-filter='.*' -checks='-*,modernize-use-nullptr' -fix&lt;br /&gt;
[http://clang.llvm.org/extra/clang-tidy/ clang-tidy] is a tool from clang. In Archlinux: sudo pacman -S clang, in other distros might be clang-extra-tools or similar.&lt;br /&gt;
&lt;br /&gt;
clang-tidy will substitute NULL and 0 for nullptr when appropriate. It is an iterative process, so it may take time. Also, it replaces all the compiled code, including external dependencies.&lt;br /&gt;
It is recommended to do a fresh build with the modified code, for testing it without modifications in any external repo.&lt;br /&gt;
&lt;br /&gt;
'''Using regex for replacing NULL in comments and not-compiled code'''&lt;br /&gt;
&lt;br /&gt;
After clang-tidy has modified the compiled code with the help of compile_commands.json, there will still be ignored instances of NULL and 0 in some headers, and comments.&lt;br /&gt;
&lt;br /&gt;
Manually replace with the following regex to change those.&lt;br /&gt;
&lt;br /&gt;
1) Change NULL to nullptr except when there is a quote or an underscore in&lt;br /&gt;
front of it. And there is not a quote after.&lt;br /&gt;
&lt;br /&gt;
  ack --cpp &amp;quot;NULL&amp;quot; -l --print0 | xargs -0 -n 1 sed -i 's/\([^\&amp;quot;\_]\)NULL\([^\&amp;quot;\_]\)/\1nullptr\2/g'&lt;br /&gt;
&lt;br /&gt;
2) The same than before but match end of line NULL&lt;br /&gt;
  ack --cpp &amp;quot;NULL&amp;quot; -l --print0 | xargs -0 -n 1 sed -i 's/\([^\&amp;quot;\_]\)NULL$/\1nullptr/g'&lt;br /&gt;
&lt;br /&gt;
'''Replace ITK_NULLPTR, VTK_NULLPTR, Q_NULLPTR'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- For an example of commit message, see [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=28022 r28022] --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It was adapted from the ITK script in [https://github.com/InsightSoftwareConsortium/ITK/blob/v5.0rc01/Utilities/ITKv5Preparation/ReplaceITK_NULLPTRMacroNames.sh ReplaceITK_NULLPTRMacroNames.sh]&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;ITK_NULLPTR&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;git grep -l &amp;quot;ITK_NULLPTR&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/ITK_NULLPTR/nullptr/g&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;VTK_NULLPTR&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;git grep -l &amp;quot;VTK_NULLPTR&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/VTK_NULLPTR/nullptr/g&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;Q_NULLPTR&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;git grep -l &amp;quot;Q_NULLPTR&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/Q_NULLPTR/nullptr/g&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===C++11: Update source code to use override===&lt;br /&gt;
&lt;br /&gt;
From: https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-override.html&lt;br /&gt;
&lt;br /&gt;
Adds override (introduced in C++11) to overridden virtual functions and removes virtual from those functions as it is not required.&lt;br /&gt;
&lt;br /&gt;
virtual on non base class implementations was used to help indicate to the user that a function was virtual. C++ compilers did not use the presence of this to signify an overriden function.&lt;br /&gt;
&lt;br /&gt;
In C++ 11 override and final keywords were introduced to allow overridden functions to be marked appropriately. Their presence allows compilers to verify that an overridden function correctly overrides a base class implementation.&lt;br /&gt;
&lt;br /&gt;
This can be useful as compilers can generate a compile time error when:&lt;br /&gt;
&lt;br /&gt;
# The base class implementation function signature changes.&lt;br /&gt;
# The user has not created the override with the correct signature.&lt;br /&gt;
&lt;br /&gt;
First we replace ITK_OVERRIDE and VTK_OVERRIDE for override:&lt;br /&gt;
&lt;br /&gt;
'''Replace ITK_OVERRIDE and VTK_OVERRIDE'''&lt;br /&gt;
&lt;br /&gt;
For an example of commit message, see [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=28022 r28022]&lt;br /&gt;
&lt;br /&gt;
The regexp involving ITK was extracted from the [https://github.com/InsightSoftwareConsortium/ITK/blob/master/Utilities/ITKv5Preparation/ReplaceITK_OVERRIDEMacroNames.sh ReplaceITK_OVERRIDEMacroNames.sh] script in ITK.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;ITK_OVERRIDE&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;git grep -l &amp;quot;ITK_OVERRIDE&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/ITK_OVERRIDE/override/g&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;VTK_OVERRIDE&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;git grep -l &amp;quot;VTK_OVERRIDE&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/VTK_OVERRIDE/override/g&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Automatic update: Using clang-tidy'''&lt;br /&gt;
'''Note''': Running ''clang-tidy -fix'' in parallel might cause problems, like appending multiple keywords to same function (override).  It can be fixed with a grep to remove duplicates.&lt;br /&gt;
&lt;br /&gt;
This will iteratively check files for updates. It takes a while. The sources are only modified at the end of the process, so you could cancel anytime before with no consequences.&lt;br /&gt;
&lt;br /&gt;
Compile Slicer with the CMake option -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON to generate the file compile_commands.json at configuration time.&lt;br /&gt;
Run clang-tidy on the generated compile_commands.json (in the build folder: Slicer-build)&lt;br /&gt;
&lt;br /&gt;
  run-clang-tidy.py -checks=-*,modernize-use-override  -header-filter=.* -fix&lt;br /&gt;
&lt;br /&gt;
'''Manual fix'''&lt;br /&gt;
&lt;br /&gt;
Multiple override are added to the same method. For example:&lt;br /&gt;
&lt;br /&gt;
  void PrintSelf(ostream&amp;amp; os, vtkIndent indent) override override override;&lt;br /&gt;
&lt;br /&gt;
We clean them with (15 here is just a high enough number):&lt;br /&gt;
&lt;br /&gt;
  for n in `seq 1 15`;&lt;br /&gt;
  do&lt;br /&gt;
      ack &amp;quot;override override&amp;quot; -l --print0 | xargs -0 -n 1 sed -i \&lt;br /&gt;
      's/override override/override/g'&lt;br /&gt;
  done&lt;br /&gt;
&lt;br /&gt;
When all of them are fixed, you should see in the terminal:&lt;br /&gt;
&lt;br /&gt;
  sed: no input files&lt;br /&gt;
&lt;br /&gt;
'''WIP:Adding missing overrides'''&lt;br /&gt;
&lt;br /&gt;
We use the clang compiler to generate warnings about missing overrides with the option -Winconsistent-missing-override.&lt;br /&gt;
&lt;br /&gt;
We then add the missing overrides with the script [https://github.com/Kitware/VTK/blob/master/Utilities/Maintenance/AddOverrides.py AddOverrides.py]&lt;br /&gt;
&lt;br /&gt;
  ninja clean&lt;br /&gt;
  ninja &amp;amp;&amp;gt; output.txt&lt;br /&gt;
  grep &amp;quot;overrides a member function but&amp;quot; output.txt | sort | uniq &amp;gt; overrides.txt&lt;br /&gt;
  python AddOverrides.py &amp;lt;overrides.txt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
However only one override was located, in the macro: qSlicerGetTittleMacro in qSlicerAbstractCoreModule.h&lt;br /&gt;
Note that the script `erroneously` adds the override to every instance of the macro.&lt;br /&gt;
The macro was updated.&lt;br /&gt;
   &lt;br /&gt;
  qSlicerGetTitleMacro(&amp;quot;Loadable Hello world&amp;quot;) override;&lt;/div&gt;</summary>
		<author><name>Phcerdan</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval&amp;diff=60898</id>
		<title>Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval&amp;diff=60898"/>
		<updated>2019-03-14T03:07:30Z</updated>

		<summary type="html">&lt;p&gt;Phcerdan: /* C++11: Update source code to use override */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Obsolete Code Removal==&lt;br /&gt;
&lt;br /&gt;
This section documents suggested code changes after removing support for a particular features. Each category has a short description, code snippets, a suggested upgrade path, and references to relevant commits.&lt;br /&gt;
&lt;br /&gt;
===Qt&amp;gt;=5.0.0: Remove obsolete code supporting Qt4 plugin infrastructure (C++)===&lt;br /&gt;
&lt;br /&gt;
These changes apply to Qt loadable modules and designer plugins&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModuleWidgetsPlugin.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;quot;vtkSlicerConfigure.h&amp;quot; // For Slicer_HAVE_QT5&lt;br /&gt;
&lt;br /&gt;
// Qt includes&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
#include &amp;lt;QtUiPlugin/QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
#else&lt;br /&gt;
#include &amp;lt;QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
class Q_SLICER_MODULE_SUBJECTHIERARCHY_WIDGETS_PLUGINS_EXPORT qSlicerSubjectHierarchyModuleWidgetsPlugin&lt;br /&gt;
  : public QObject&lt;br /&gt;
  , public QDesignerCustomWidgetCollectionInterface&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetCollectionInterface&amp;quot;)&lt;br /&gt;
#endif&lt;br /&gt;
  Q_INTERFACES(QDesignerCustomWidgetCollectionInterface);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Qt includes&lt;br /&gt;
#include &amp;lt;QtUiPlugin/QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
class Q_SLICER_MODULE_SUBJECTHIERARCHY_WIDGETS_PLUGINS_EXPORT qSlicerSubjectHierarchyModuleWidgetsPlugin&lt;br /&gt;
  : public QObject&lt;br /&gt;
  , public QDesignerCustomWidgetCollectionInterface&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetCollectionInterface&amp;quot;)&lt;br /&gt;
  Q_INTERFACES(QDesignerCustomWidgetCollectionInterface);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModule.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Q_SLICER_QTMODULES_SUBJECTHIERARCHY_EXPORT qSlicerSubjectHierarchyModule :&lt;br /&gt;
  public qSlicerLoadableModule&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.slicer.modules.loadable.qSlicerLoadableModule/1.0&amp;quot;);&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Q_SLICER_QTMODULES_SUBJECTHIERARCHY_EXPORT qSlicerSubjectHierarchyModule :&lt;br /&gt;
  public qSlicerLoadableModule&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.slicer.modules.loadable.qSlicerLoadableModule/1.0&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModuleWidgetsAbstractPlugin.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  #include &amp;lt;QtGlobal&amp;gt;&lt;br /&gt;
  #if(QT_VERSION &amp;lt; QT_VERSION_CHECKS(5, 0, 0))&lt;br /&gt;
  #include &amp;lt;QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
  #else&lt;br /&gt;
  #include &amp;lt;QtUiPlugin/QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
  [...]&lt;br /&gt;
&lt;br /&gt;
  class Q_SLICER_MODULE_SEGMENTATIONS_WIDGETS_PLUGINS_EXPORT qSlicerSegmentationsModuleWidgetsAbstractPlugin&lt;br /&gt;
      : public QDesignerCustomWidgetInterface&lt;br /&gt;
  {&lt;br /&gt;
  #if (QT_VERSION &amp;gt;= QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
    Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetInterface&amp;quot;)&lt;br /&gt;
  #endif&lt;br /&gt;
    Q_INTERFACES(QDesignerCustomWidgetInterface);&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  #include &amp;lt;QtUiPlugin/QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  [...]&lt;br /&gt;
&lt;br /&gt;
  class Q_SLICER_MODULE_SEGMENTATIONS_WIDGETS_PLUGINS_EXPORT qSlicerSegmentationsModuleWidgetsAbstractPlugin&lt;br /&gt;
      : public QDesignerCustomWidgetInterface&lt;br /&gt;
  {&lt;br /&gt;
    Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetInterface&amp;quot;)&lt;br /&gt;
    Q_INTERFACES(QDesignerCustomWidgetInterface);&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModule.cxx and qSlicerNAMEModuleWidgetsAbstractPlugin.cxx====&lt;br /&gt;
&lt;br /&gt;
'''Remove:'''&lt;br /&gt;
&lt;br /&gt;
  #if (QT_VERSION &amp;lt; QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
  #include &amp;lt;QtPlugin&amp;gt;&lt;br /&gt;
  Q_EXPORT_PLUGIN2(customwidgetplugin, qSlicerSegmentationsModuleWidgetsPlugin);&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
===Qt&amp;gt;=5.0.0: Simpler use of QHeaderView::setSectionResizeMode===&lt;br /&gt;
&lt;br /&gt;
This migration guide entry is obsolete: [[Documentation/Nightly/Developers/Tutorials/MigrationGuide#Qt5:_Fix_error:_.E2.80.98class_QHeaderView.E2.80.99_has_no_member_named_.E2.80.98setResizeMode.E2.80.99]]&lt;br /&gt;
&lt;br /&gt;
'''Solution for Cpp'''&lt;br /&gt;
&lt;br /&gt;
Before:&lt;br /&gt;
&lt;br /&gt;
  #if (QT_VERSION &amp;lt; QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(QHeaderView::Stretch);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
  #else&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::Stretch);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::Stretch);&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Solution for Python'''&lt;br /&gt;
&lt;br /&gt;
Before:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def _setSectionResizeMode(header, *args, **kwargs):&lt;br /&gt;
    if version.parse(qt.Qt.qVersion()) &amp;lt; version.parse(&amp;quot;5.0.0&amp;quot;):&lt;br /&gt;
      header.setResizeMode(*args, **kwargs)&lt;br /&gt;
    else:&lt;br /&gt;
      header.setSectionResizeMode(*args, **kwargs)&lt;br /&gt;
&lt;br /&gt;
    [...]&lt;br /&gt;
   &lt;br /&gt;
  _setSectionResizeMode(self.horizontalHeader(), 0, qt.QHeaderView.Stretch)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After:&lt;br /&gt;
&lt;br /&gt;
  self.horizontalHeader().setSectionResizeMode(0, qt.QHeaderView.Stretch)&lt;br /&gt;
&lt;br /&gt;
===C++11: Update source code to use nullptr===&lt;br /&gt;
&lt;br /&gt;
C++11 introduced the keyword &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt; allowing to explicitly identify a pointer of type &amp;lt;tt&amp;gt;std::nullptr_t&amp;lt;/tt&amp;gt;. It avoids ambiguous function overloads. See also https://stackoverflow.com/questions/20509734/null-vs-nullptr-why-was-it-replaced&lt;br /&gt;
&lt;br /&gt;
Prior to supporting only C++11, &amp;lt;tt&amp;gt;0&amp;lt;/tt&amp;gt; and [http://www.cplusplus.com/reference/cstring/NULL/ NULL] integral type were used to check for pointer value, and macro like &amp;lt;tt&amp;gt;Q_NULLPTR&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;ITK_NULLPTR&amp;lt;/tt&amp;gt; macros were used to ensure usage of &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt; when C++11 support was enabled.&lt;br /&gt;
&lt;br /&gt;
Updating the code base to use &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt; is a 2-step process:&lt;br /&gt;
* use clang-tidy for updating source code being explicitly compiled in the project.&lt;br /&gt;
* directly update source code not being compiled: conditionally compiled code, templated headers, comments, ...&lt;br /&gt;
&lt;br /&gt;
'''Automatic update: Using clang-tidy'''&lt;br /&gt;
&lt;br /&gt;
This will iteratively check files for updates. It takes a while. The sources are only modified at the end of the process, so you could cancel anytime before with no consequences.&lt;br /&gt;
# Compile Slicer with the CMake option -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON to generate the file compile_commands.json at configuration time.&lt;br /&gt;
# Run clang-tidy on the generated compile_commands.json (in the build folder: Slicer-build)&lt;br /&gt;
  run-clang-tidy.py -header-filter='.*' -checks='-*,modernize-use-nullptr' -fix&lt;br /&gt;
[http://clang.llvm.org/extra/clang-tidy/ clang-tidy] is a tool from clang. In Archlinux: sudo pacman -S clang, in other distros might be clang-extra-tools or similar.&lt;br /&gt;
&lt;br /&gt;
clang-tidy will substitute NULL and 0 for nullptr when appropiate. It is an iterative process, so it may take time. Also, it replaces all the compiled code, including external dependencies.&lt;br /&gt;
It is recommended to do a fresh build with the modified code, for testing it without modifications in any external repo.&lt;br /&gt;
&lt;br /&gt;
'''Direct update: Using shell script'''&lt;br /&gt;
&lt;br /&gt;
After clang-tidy has modified the compiled code with the help of compile_commands.json, there will still be ignored instances of NULL and 0 in some headers, and comments.&lt;br /&gt;
&lt;br /&gt;
Manually replace with the following regex to change those.&lt;br /&gt;
&lt;br /&gt;
1) Change NULL to nullptr except when there is a quote or an underscore in&lt;br /&gt;
front of it. And there is not a quote after.&lt;br /&gt;
&lt;br /&gt;
  ack --cpp &amp;quot;NULL&amp;quot; -l --print0 | xargs -0 -n 1 sed -i 's/\([^\&amp;quot;\_]\)NULL\([^\&amp;quot;\_]\)/\1nullptr\2/g'&lt;br /&gt;
&lt;br /&gt;
2) The same than before but match end of line NULL&lt;br /&gt;
  ack --cpp &amp;quot;NULL&amp;quot; -l --print0 | xargs -0 -n 1 sed -i 's/\([^\&amp;quot;\_]\)NULL$/\1nullptr/g'&lt;br /&gt;
&lt;br /&gt;
'''Replace ITK_NULLPTR'''&lt;br /&gt;
&lt;br /&gt;
It was adapted from the ITK script in [https://github.com/InsightSoftwareConsortium/ITK/blob/master/Utilities/ITKv5Preparation/ReplaceITK_NULLPTRMacroNames.sh ReplaceITK_NULLPTRMacroNames.sh]&lt;br /&gt;
&lt;br /&gt;
  git grep -l &amp;quot;ITK_NULLPTR&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/ITK_NULLPTR/nullptr/g&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===C++11: Update source code to use override===&lt;br /&gt;
&lt;br /&gt;
From: https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-override.html&lt;br /&gt;
&lt;br /&gt;
Adds override (introduced in C++11) to overridden virtual functions and removes virtual from those functions as it is not required.&lt;br /&gt;
&lt;br /&gt;
virtual on non base class implementations was used to help indicate to the user that a function was virtual. C++ compilers did not use the presence of this to signify an overriden function.&lt;br /&gt;
&lt;br /&gt;
In C++ 11 override and final keywords were introduced to allow overridden functions to be marked appropriately. Their presence allows compilers to verify that an overridden function correctly overrides a base class implementation.&lt;br /&gt;
&lt;br /&gt;
This can be useful as compilers can generate a compile time error when:&lt;br /&gt;
&lt;br /&gt;
# The base class implementation function signature changes.&lt;br /&gt;
# The user has not created the override with the correct signature.&lt;br /&gt;
&lt;br /&gt;
First we replace ITK_OVERRIDE and VTK_OVERRIDE for override:&lt;br /&gt;
&lt;br /&gt;
'''Replace ITK_OVERRIDE'''&lt;br /&gt;
&lt;br /&gt;
The regexp involving ITK were extracted from the [https://github.com/InsightSoftwareConsortium/ITK/blob/master/Utilities/ITKv5Preparation/ReplaceITK_OVERRIDEMacroNames.sh ReplaceITK_OVERRIDEMacroNames.sh] script in ITK.&lt;br /&gt;
&lt;br /&gt;
  git grep -l &amp;quot;ITK_OVERRIDE&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/ITK_OVERRIDE/override/g&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''Replace VTK_OVERRIDE'''&lt;br /&gt;
&lt;br /&gt;
  git grep -l &amp;quot;VTK_OVERRIDE&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/VTK_OVERRIDE/override/g&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''Automatic update: Using clang-tidy'''&lt;br /&gt;
&lt;br /&gt;
This will iteratively check files for updates. It takes a while. The sources are only modified at the end of the process, so you could cancel anytime before with no consequences.&lt;br /&gt;
&lt;br /&gt;
Compile Slicer with the CMake option -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON to generate the file compile_commands.json at configuration time.&lt;br /&gt;
Run clang-tidy on the generated compile_commands.json (in the build folder: Slicer-build)&lt;br /&gt;
&lt;br /&gt;
  run-clang-tidy.py -checks=-*,modernize-use-override  -header-filter=.* -fix&lt;br /&gt;
&lt;br /&gt;
'''Manual fix'''&lt;br /&gt;
&lt;br /&gt;
Multiple override are added to the same method. For example:&lt;br /&gt;
&lt;br /&gt;
  void PrintSelf(ostream&amp;amp; os, vtkIndent indent) override override override;&lt;br /&gt;
&lt;br /&gt;
We clean them with (15 here is just a high enough number):&lt;br /&gt;
&lt;br /&gt;
  for n in `seq 1 15`;&lt;br /&gt;
  do&lt;br /&gt;
      ack &amp;quot;override override&amp;quot; -l --print0 | xargs -0 -n 1 sed -i \&lt;br /&gt;
      's/override override/override/g'&lt;br /&gt;
  done&lt;br /&gt;
&lt;br /&gt;
When all of them are fixed, you should see in the terminal:&lt;br /&gt;
&lt;br /&gt;
  sed: no input files&lt;br /&gt;
&lt;br /&gt;
'''WIP:Adding missing overrides'''&lt;br /&gt;
&lt;br /&gt;
We use the clang compiler to generate warnings about missing overrides with the option -Winconsistent-missing-override.&lt;br /&gt;
&lt;br /&gt;
We then add the missing overrides with the script [https://github.com/Kitware/VTK/blob/master/Utilities/Maintenance/AddOverrides.py AddOverrides.py]&lt;br /&gt;
&lt;br /&gt;
  ninja clean&lt;br /&gt;
  ninja &amp;amp;&amp;gt; output.txt&lt;br /&gt;
  grep &amp;quot;overrides a member function but&amp;quot; output.txt | sort | uniq &amp;gt; overrides.txt&lt;br /&gt;
  python AddOverrides.py &amp;lt;overrides.txt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
However only one override was located, in the macro: qSlicerGetTittleMacro in qSlicerAbstractCoreModule.h&lt;br /&gt;
Note that the script `erroneously` adds the override to every instance of the macro.&lt;br /&gt;
The macro was updated.&lt;br /&gt;
   &lt;br /&gt;
  qSlicerGetTitleMacro(&amp;quot;Loadable Hello world&amp;quot;) override;&lt;/div&gt;</summary>
		<author><name>Phcerdan</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval&amp;diff=60897</id>
		<title>Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval&amp;diff=60897"/>
		<updated>2019-03-14T02:13:27Z</updated>

		<summary type="html">&lt;p&gt;Phcerdan: /* C++11: Update source code to use override */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Obsolete Code Removal==&lt;br /&gt;
&lt;br /&gt;
This section documents suggested code changes after removing support for a particular features. Each category has a short description, code snippets, a suggested upgrade path, and references to relevant commits.&lt;br /&gt;
&lt;br /&gt;
===Qt&amp;gt;=5.0.0: Remove obsolete code supporting Qt4 plugin infrastructure (C++)===&lt;br /&gt;
&lt;br /&gt;
These changes apply to Qt loadable modules and designer plugins&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModuleWidgetsPlugin.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;quot;vtkSlicerConfigure.h&amp;quot; // For Slicer_HAVE_QT5&lt;br /&gt;
&lt;br /&gt;
// Qt includes&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
#include &amp;lt;QtUiPlugin/QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
#else&lt;br /&gt;
#include &amp;lt;QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
class Q_SLICER_MODULE_SUBJECTHIERARCHY_WIDGETS_PLUGINS_EXPORT qSlicerSubjectHierarchyModuleWidgetsPlugin&lt;br /&gt;
  : public QObject&lt;br /&gt;
  , public QDesignerCustomWidgetCollectionInterface&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetCollectionInterface&amp;quot;)&lt;br /&gt;
#endif&lt;br /&gt;
  Q_INTERFACES(QDesignerCustomWidgetCollectionInterface);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Qt includes&lt;br /&gt;
#include &amp;lt;QtUiPlugin/QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
class Q_SLICER_MODULE_SUBJECTHIERARCHY_WIDGETS_PLUGINS_EXPORT qSlicerSubjectHierarchyModuleWidgetsPlugin&lt;br /&gt;
  : public QObject&lt;br /&gt;
  , public QDesignerCustomWidgetCollectionInterface&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetCollectionInterface&amp;quot;)&lt;br /&gt;
  Q_INTERFACES(QDesignerCustomWidgetCollectionInterface);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModule.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Q_SLICER_QTMODULES_SUBJECTHIERARCHY_EXPORT qSlicerSubjectHierarchyModule :&lt;br /&gt;
  public qSlicerLoadableModule&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.slicer.modules.loadable.qSlicerLoadableModule/1.0&amp;quot;);&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Q_SLICER_QTMODULES_SUBJECTHIERARCHY_EXPORT qSlicerSubjectHierarchyModule :&lt;br /&gt;
  public qSlicerLoadableModule&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.slicer.modules.loadable.qSlicerLoadableModule/1.0&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModuleWidgetsAbstractPlugin.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  #include &amp;lt;QtGlobal&amp;gt;&lt;br /&gt;
  #if(QT_VERSION &amp;lt; QT_VERSION_CHECKS(5, 0, 0))&lt;br /&gt;
  #include &amp;lt;QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
  #else&lt;br /&gt;
  #include &amp;lt;QtUiPlugin/QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
  [...]&lt;br /&gt;
&lt;br /&gt;
  class Q_SLICER_MODULE_SEGMENTATIONS_WIDGETS_PLUGINS_EXPORT qSlicerSegmentationsModuleWidgetsAbstractPlugin&lt;br /&gt;
      : public QDesignerCustomWidgetInterface&lt;br /&gt;
  {&lt;br /&gt;
  #if (QT_VERSION &amp;gt;= QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
    Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetInterface&amp;quot;)&lt;br /&gt;
  #endif&lt;br /&gt;
    Q_INTERFACES(QDesignerCustomWidgetInterface);&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  #include &amp;lt;QtUiPlugin/QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  [...]&lt;br /&gt;
&lt;br /&gt;
  class Q_SLICER_MODULE_SEGMENTATIONS_WIDGETS_PLUGINS_EXPORT qSlicerSegmentationsModuleWidgetsAbstractPlugin&lt;br /&gt;
      : public QDesignerCustomWidgetInterface&lt;br /&gt;
  {&lt;br /&gt;
    Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetInterface&amp;quot;)&lt;br /&gt;
    Q_INTERFACES(QDesignerCustomWidgetInterface);&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModule.cxx and qSlicerNAMEModuleWidgetsAbstractPlugin.cxx====&lt;br /&gt;
&lt;br /&gt;
'''Remove:'''&lt;br /&gt;
&lt;br /&gt;
  #if (QT_VERSION &amp;lt; QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
  #include &amp;lt;QtPlugin&amp;gt;&lt;br /&gt;
  Q_EXPORT_PLUGIN2(customwidgetplugin, qSlicerSegmentationsModuleWidgetsPlugin);&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
===Qt&amp;gt;=5.0.0: Simpler use of QHeaderView::setSectionResizeMode===&lt;br /&gt;
&lt;br /&gt;
This migration guide entry is obsolete: [[Documentation/Nightly/Developers/Tutorials/MigrationGuide#Qt5:_Fix_error:_.E2.80.98class_QHeaderView.E2.80.99_has_no_member_named_.E2.80.98setResizeMode.E2.80.99]]&lt;br /&gt;
&lt;br /&gt;
'''Solution for Cpp'''&lt;br /&gt;
&lt;br /&gt;
Before:&lt;br /&gt;
&lt;br /&gt;
  #if (QT_VERSION &amp;lt; QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(QHeaderView::Stretch);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
  #else&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::Stretch);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::Stretch);&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Solution for Python'''&lt;br /&gt;
&lt;br /&gt;
Before:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def _setSectionResizeMode(header, *args, **kwargs):&lt;br /&gt;
    if version.parse(qt.Qt.qVersion()) &amp;lt; version.parse(&amp;quot;5.0.0&amp;quot;):&lt;br /&gt;
      header.setResizeMode(*args, **kwargs)&lt;br /&gt;
    else:&lt;br /&gt;
      header.setSectionResizeMode(*args, **kwargs)&lt;br /&gt;
&lt;br /&gt;
    [...]&lt;br /&gt;
   &lt;br /&gt;
  _setSectionResizeMode(self.horizontalHeader(), 0, qt.QHeaderView.Stretch)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After:&lt;br /&gt;
&lt;br /&gt;
  self.horizontalHeader().setSectionResizeMode(0, qt.QHeaderView.Stretch)&lt;br /&gt;
&lt;br /&gt;
===C++11: Update source code to use nullptr===&lt;br /&gt;
&lt;br /&gt;
C++11 introduced the keyword &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt; allowing to explicitly identify a pointer of type &amp;lt;tt&amp;gt;std::nullptr_t&amp;lt;/tt&amp;gt;. It avoids ambiguous function overloads. See also https://stackoverflow.com/questions/20509734/null-vs-nullptr-why-was-it-replaced&lt;br /&gt;
&lt;br /&gt;
Prior to supporting only C++11, &amp;lt;tt&amp;gt;0&amp;lt;/tt&amp;gt; and [http://www.cplusplus.com/reference/cstring/NULL/ NULL] integral type were used to check for pointer value, and macro like &amp;lt;tt&amp;gt;Q_NULLPTR&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;ITK_NULLPTR&amp;lt;/tt&amp;gt; macros were used to ensure usage of &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt; when C++11 support was enabled.&lt;br /&gt;
&lt;br /&gt;
Updating the code base to use &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt; is a 2-step process:&lt;br /&gt;
* use clang-tidy for updating source code being explicitly compiled in the project.&lt;br /&gt;
* directly update source code not being compiled: conditionally compiled code, templated headers, comments, ...&lt;br /&gt;
&lt;br /&gt;
'''Automatic update: Using clang-tidy'''&lt;br /&gt;
&lt;br /&gt;
This will iteratively check files for updates. It takes a while. The sources are only modified at the end of the process, so you could cancel anytime before with no consequences.&lt;br /&gt;
# Compile Slicer with the CMake option -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON to generate the file compile_commands.json at configuration time.&lt;br /&gt;
# Run clang-tidy on the generated compile_commands.json (in the build folder: Slicer-build)&lt;br /&gt;
  run-clang-tidy.py -header-filter='.*' -checks='-*,modernize-use-nullptr' -fix&lt;br /&gt;
[http://clang.llvm.org/extra/clang-tidy/ clang-tidy] is a tool from clang. In Archlinux: sudo pacman -S clang, in other distros might be clang-extra-tools or similar.&lt;br /&gt;
&lt;br /&gt;
clang-tidy will substitute NULL and 0 for nullptr when appropiate. It is an iterative process, so it may take time. Also, it replaces all the compiled code, including external dependencies.&lt;br /&gt;
It is recommended to do a fresh build with the modified code, for testing it without modifications in any external repo.&lt;br /&gt;
&lt;br /&gt;
'''Direct update: Using shell script'''&lt;br /&gt;
&lt;br /&gt;
After clang-tidy has modified the compiled code with the help of compile_commands.json, there will still be ignored instances of NULL and 0 in some headers, and comments.&lt;br /&gt;
&lt;br /&gt;
Manually replace with the following regex to change those.&lt;br /&gt;
&lt;br /&gt;
1) Change NULL to nullptr except when there is a quote or an underscore in&lt;br /&gt;
front of it. And there is not a quote after.&lt;br /&gt;
&lt;br /&gt;
  ack --cpp &amp;quot;NULL&amp;quot; -l --print0 | xargs -0 -n 1 sed -i 's/\([^\&amp;quot;\_]\)NULL\([^\&amp;quot;\_]\)/\1nullptr\2/g'&lt;br /&gt;
&lt;br /&gt;
2) The same than before but match end of line NULL&lt;br /&gt;
  ack --cpp &amp;quot;NULL&amp;quot; -l --print0 | xargs -0 -n 1 sed -i 's/\([^\&amp;quot;\_]\)NULL$/\1nullptr/g'&lt;br /&gt;
&lt;br /&gt;
'''Replace ITK_NULLPTR'''&lt;br /&gt;
&lt;br /&gt;
It was adapted from the ITK script in [https://github.com/InsightSoftwareConsortium/ITK/blob/master/Utilities/ITKv5Preparation/ReplaceITK_NULLPTRMacroNames.sh ReplaceITK_NULLPTRMacroNames.sh]&lt;br /&gt;
&lt;br /&gt;
  git grep -l &amp;quot;ITK_NULLPTR&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/ITK_NULLPTR/nullptr/g&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===C++11: Update source code to use override===&lt;br /&gt;
&lt;br /&gt;
From: https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-override.html&lt;br /&gt;
&lt;br /&gt;
Adds override (introduced in C++11) to overridden virtual functions and removes virtual from those functions as it is not required.&lt;br /&gt;
&lt;br /&gt;
virtual on non base class implementations was used to help indicate to the user that a function was virtual. C++ compilers did not use the presence of this to signify an overriden function.&lt;br /&gt;
&lt;br /&gt;
In C++ 11 override and final keywords were introduced to allow overridden functions to be marked appropriately. Their presence allows compilers to verify that an overridden function correctly overrides a base class implementation.&lt;br /&gt;
&lt;br /&gt;
This can be useful as compilers can generate a compile time error when:&lt;br /&gt;
&lt;br /&gt;
# The base class implementation function signature changes.&lt;br /&gt;
# The user has not created the override with the correct signature.&lt;br /&gt;
&lt;br /&gt;
First we replace ITK_OVERRIDE and VTK_OVERRIDE for override:&lt;br /&gt;
&lt;br /&gt;
'''Replace ITK_OVERRIDE'''&lt;br /&gt;
&lt;br /&gt;
The regexp involving ITK were extracted from the [https://github.com/InsightSoftwareConsortium/ITK/blob/master/Utilities/ITKv5Preparation/ReplaceITK_OVERRIDEMacroNames.sh ReplaceITK_OVERRIDEMacroNames.sh] script in ITK.&lt;br /&gt;
&lt;br /&gt;
  git grep -l &amp;quot;ITK_OVERRIDE&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/ITK_OVERRIDE/override/g&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''Replace VTK_OVERRIDE'''&lt;br /&gt;
&lt;br /&gt;
  git grep -l &amp;quot;VTK_OVERRIDE&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/VTK_OVERRIDE/override/g&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''Automatic update: Using clang-tidy'''&lt;br /&gt;
&lt;br /&gt;
This will iteratively check files for updates. It takes a while. The sources are only modified at the end of the process, so you could cancel anytime before with no consequences.&lt;br /&gt;
&lt;br /&gt;
Compile Slicer with the CMake option -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON to generate the file compile_commands.json at configuration time.&lt;br /&gt;
Run clang-tidy on the generated compile_commands.json (in the build folder: Slicer-build)&lt;br /&gt;
&lt;br /&gt;
  run-clang-tidy.py -checks=-*,modernize-use-override  -header-filter=.* -fix&lt;br /&gt;
&lt;br /&gt;
'''Manual fix'''&lt;br /&gt;
&lt;br /&gt;
Multiple override are added to the same method. For example:&lt;br /&gt;
&lt;br /&gt;
  void PrintSelf(ostream&amp;amp; os, vtkIndent indent) override override override;&lt;br /&gt;
&lt;br /&gt;
We clean them with (15 here is just a high enough number):&lt;br /&gt;
&lt;br /&gt;
  for n in `seq 1 15`;&lt;br /&gt;
  do&lt;br /&gt;
      ack &amp;quot;override override&amp;quot; -l --print0 | xargs -0 -n 1 sed -i \&lt;br /&gt;
      's/override override/override/g'&lt;br /&gt;
  done&lt;br /&gt;
&lt;br /&gt;
When all of them are fixed, you should see in the terminal:&lt;br /&gt;
&lt;br /&gt;
  sed: no input files&lt;br /&gt;
&lt;br /&gt;
'''WIP:Adding missing overrides'''&lt;br /&gt;
&lt;br /&gt;
We use the clang compiler to generate warnings about missing overrides.&lt;br /&gt;
We then add the missing overrides with the script [https://github.com/Kitware/VTK/blob/master/Utilities/Maintenance/AddOverrides.py AddOverrides.py]&lt;/div&gt;</summary>
		<author><name>Phcerdan</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval&amp;diff=60895</id>
		<title>Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval&amp;diff=60895"/>
		<updated>2019-03-14T01:28:24Z</updated>

		<summary type="html">&lt;p&gt;Phcerdan: /* C++11: Update source code to use override */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Obsolete Code Removal==&lt;br /&gt;
&lt;br /&gt;
This section documents suggested code changes after removing support for a particular features. Each category has a short description, code snippets, a suggested upgrade path, and references to relevant commits.&lt;br /&gt;
&lt;br /&gt;
===Qt&amp;gt;=5.0.0: Remove obsolete code supporting Qt4 plugin infrastructure (C++)===&lt;br /&gt;
&lt;br /&gt;
These changes apply to Qt loadable modules and designer plugins&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModuleWidgetsPlugin.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;quot;vtkSlicerConfigure.h&amp;quot; // For Slicer_HAVE_QT5&lt;br /&gt;
&lt;br /&gt;
// Qt includes&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
#include &amp;lt;QtUiPlugin/QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
#else&lt;br /&gt;
#include &amp;lt;QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
class Q_SLICER_MODULE_SUBJECTHIERARCHY_WIDGETS_PLUGINS_EXPORT qSlicerSubjectHierarchyModuleWidgetsPlugin&lt;br /&gt;
  : public QObject&lt;br /&gt;
  , public QDesignerCustomWidgetCollectionInterface&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetCollectionInterface&amp;quot;)&lt;br /&gt;
#endif&lt;br /&gt;
  Q_INTERFACES(QDesignerCustomWidgetCollectionInterface);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Qt includes&lt;br /&gt;
#include &amp;lt;QtUiPlugin/QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
class Q_SLICER_MODULE_SUBJECTHIERARCHY_WIDGETS_PLUGINS_EXPORT qSlicerSubjectHierarchyModuleWidgetsPlugin&lt;br /&gt;
  : public QObject&lt;br /&gt;
  , public QDesignerCustomWidgetCollectionInterface&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetCollectionInterface&amp;quot;)&lt;br /&gt;
  Q_INTERFACES(QDesignerCustomWidgetCollectionInterface);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModule.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Q_SLICER_QTMODULES_SUBJECTHIERARCHY_EXPORT qSlicerSubjectHierarchyModule :&lt;br /&gt;
  public qSlicerLoadableModule&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.slicer.modules.loadable.qSlicerLoadableModule/1.0&amp;quot;);&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Q_SLICER_QTMODULES_SUBJECTHIERARCHY_EXPORT qSlicerSubjectHierarchyModule :&lt;br /&gt;
  public qSlicerLoadableModule&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.slicer.modules.loadable.qSlicerLoadableModule/1.0&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModuleWidgetsAbstractPlugin.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  #include &amp;lt;QtGlobal&amp;gt;&lt;br /&gt;
  #if(QT_VERSION &amp;lt; QT_VERSION_CHECKS(5, 0, 0))&lt;br /&gt;
  #include &amp;lt;QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
  #else&lt;br /&gt;
  #include &amp;lt;QtUiPlugin/QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
  [...]&lt;br /&gt;
&lt;br /&gt;
  class Q_SLICER_MODULE_SEGMENTATIONS_WIDGETS_PLUGINS_EXPORT qSlicerSegmentationsModuleWidgetsAbstractPlugin&lt;br /&gt;
      : public QDesignerCustomWidgetInterface&lt;br /&gt;
  {&lt;br /&gt;
  #if (QT_VERSION &amp;gt;= QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
    Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetInterface&amp;quot;)&lt;br /&gt;
  #endif&lt;br /&gt;
    Q_INTERFACES(QDesignerCustomWidgetInterface);&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  #include &amp;lt;QtUiPlugin/QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  [...]&lt;br /&gt;
&lt;br /&gt;
  class Q_SLICER_MODULE_SEGMENTATIONS_WIDGETS_PLUGINS_EXPORT qSlicerSegmentationsModuleWidgetsAbstractPlugin&lt;br /&gt;
      : public QDesignerCustomWidgetInterface&lt;br /&gt;
  {&lt;br /&gt;
    Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetInterface&amp;quot;)&lt;br /&gt;
    Q_INTERFACES(QDesignerCustomWidgetInterface);&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModule.cxx and qSlicerNAMEModuleWidgetsAbstractPlugin.cxx====&lt;br /&gt;
&lt;br /&gt;
'''Remove:'''&lt;br /&gt;
&lt;br /&gt;
  #if (QT_VERSION &amp;lt; QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
  #include &amp;lt;QtPlugin&amp;gt;&lt;br /&gt;
  Q_EXPORT_PLUGIN2(customwidgetplugin, qSlicerSegmentationsModuleWidgetsPlugin);&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
===Qt&amp;gt;=5.0.0: Simpler use of QHeaderView::setSectionResizeMode===&lt;br /&gt;
&lt;br /&gt;
This migration guide entry is obsolete: [[Documentation/Nightly/Developers/Tutorials/MigrationGuide#Qt5:_Fix_error:_.E2.80.98class_QHeaderView.E2.80.99_has_no_member_named_.E2.80.98setResizeMode.E2.80.99]]&lt;br /&gt;
&lt;br /&gt;
'''Solution for Cpp'''&lt;br /&gt;
&lt;br /&gt;
Before:&lt;br /&gt;
&lt;br /&gt;
  #if (QT_VERSION &amp;lt; QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(QHeaderView::Stretch);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
  #else&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::Stretch);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::Stretch);&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Solution for Python'''&lt;br /&gt;
&lt;br /&gt;
Before:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def _setSectionResizeMode(header, *args, **kwargs):&lt;br /&gt;
    if version.parse(qt.Qt.qVersion()) &amp;lt; version.parse(&amp;quot;5.0.0&amp;quot;):&lt;br /&gt;
      header.setResizeMode(*args, **kwargs)&lt;br /&gt;
    else:&lt;br /&gt;
      header.setSectionResizeMode(*args, **kwargs)&lt;br /&gt;
&lt;br /&gt;
    [...]&lt;br /&gt;
   &lt;br /&gt;
  _setSectionResizeMode(self.horizontalHeader(), 0, qt.QHeaderView.Stretch)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After:&lt;br /&gt;
&lt;br /&gt;
  self.horizontalHeader().setSectionResizeMode(0, qt.QHeaderView.Stretch)&lt;br /&gt;
&lt;br /&gt;
===C++11: Update source code to use nullptr===&lt;br /&gt;
&lt;br /&gt;
C++11 introduced the keyword &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt; allowing to explicitly identify a pointer of type &amp;lt;tt&amp;gt;std::nullptr_t&amp;lt;/tt&amp;gt;. It avoids ambiguous function overloads. See also https://stackoverflow.com/questions/20509734/null-vs-nullptr-why-was-it-replaced&lt;br /&gt;
&lt;br /&gt;
Prior to supporting only C++11, &amp;lt;tt&amp;gt;0&amp;lt;/tt&amp;gt; and [http://www.cplusplus.com/reference/cstring/NULL/ NULL] integral type were used to check for pointer value, and macro like &amp;lt;tt&amp;gt;Q_NULLPTR&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;ITK_NULLPTR&amp;lt;/tt&amp;gt; macros were used to ensure usage of &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt; when C++11 support was enabled.&lt;br /&gt;
&lt;br /&gt;
Updating the code base to use &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt; is a 2-step process:&lt;br /&gt;
* use clang-tidy for updating source code being explicitly compiled in the project.&lt;br /&gt;
* directly update source code not being compiled: conditionally compiled code, templated headers, comments, ...&lt;br /&gt;
&lt;br /&gt;
'''Automatic update: Using clang-tidy'''&lt;br /&gt;
&lt;br /&gt;
This will iteratively check files for updates. It takes a while. The sources are only modified at the end of the process, so you could cancel anytime before with no consequences.&lt;br /&gt;
# Compile Slicer with the CMake option -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON to generate the file compile_commands.json at configuration time.&lt;br /&gt;
# Run clang-tidy on the generated compile_commands.json (in the build folder: Slicer-build)&lt;br /&gt;
  run-clang-tidy.py -header-filter='.*' -checks='-*,modernize-use-nullptr' -fix&lt;br /&gt;
[http://clang.llvm.org/extra/clang-tidy/ clang-tidy] is a tool from clang. In Archlinux: sudo pacman -S clang, in other distros might be clang-extra-tools or similar.&lt;br /&gt;
&lt;br /&gt;
clang-tidy will substitute NULL and 0 for nullptr when appropiate. It is an iterative process, so it may take time. Also, it replaces all the compiled code, including external dependencies.&lt;br /&gt;
It is recommended to do a fresh build with the modified code, for testing it without modifications in any external repo.&lt;br /&gt;
&lt;br /&gt;
'''Direct update: Using shell script'''&lt;br /&gt;
&lt;br /&gt;
After clang-tidy has modified the compiled code with the help of compile_commands.json, there will still be ignored instances of NULL and 0 in some headers, and comments.&lt;br /&gt;
&lt;br /&gt;
Manually replace with the following regex to change those.&lt;br /&gt;
&lt;br /&gt;
1) Change NULL to nullptr except when there is a quote or an underscore in&lt;br /&gt;
front of it. And there is not a quote after.&lt;br /&gt;
&lt;br /&gt;
  ack --cpp &amp;quot;NULL&amp;quot; -l --print0 | xargs -0 -n 1 sed -i 's/\([^\&amp;quot;\_]\)NULL\([^\&amp;quot;\_]\)/\1nullptr\2/g'&lt;br /&gt;
&lt;br /&gt;
2) The same than before but match end of line NULL&lt;br /&gt;
  ack --cpp &amp;quot;NULL&amp;quot; -l --print0 | xargs -0 -n 1 sed -i 's/\([^\&amp;quot;\_]\)NULL$/\1nullptr/g'&lt;br /&gt;
&lt;br /&gt;
'''Replace ITK_NULLPTR'''&lt;br /&gt;
&lt;br /&gt;
It was adapted from the ITK script in [https://github.com/InsightSoftwareConsortium/ITK/blob/master/Utilities/ITKv5Preparation/ReplaceITK_NULLPTRMacroNames.sh ReplaceITK_NULLPTRMacroNames.sh]&lt;br /&gt;
&lt;br /&gt;
  git grep -l &amp;quot;ITK_NULLPTR&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/ITK_NULLPTR/nullptr/g&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===C++11: Update source code to use override===&lt;br /&gt;
&lt;br /&gt;
From: https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-override.html&lt;br /&gt;
&lt;br /&gt;
Adds override (introduced in C++11) to overridden virtual functions and removes virtual from those functions as it is not required.&lt;br /&gt;
&lt;br /&gt;
virtual on non base class implementations was used to help indicate to the user that a function was virtual. C++ compilers did not use the presence of this to signify an overriden function.&lt;br /&gt;
&lt;br /&gt;
In C++ 11 override and final keywords were introduced to allow overridden functions to be marked appropriately. Their presence allows compilers to verify that an overridden function correctly overrides a base class implementation.&lt;br /&gt;
&lt;br /&gt;
This can be useful as compilers can generate a compile time error when:&lt;br /&gt;
&lt;br /&gt;
# The base class implementation function signature changes.&lt;br /&gt;
# The user has not created the override with the correct signature.&lt;br /&gt;
&lt;br /&gt;
First we replace ITK_OVERRIDE and VTK_OVERRIDE for override:&lt;br /&gt;
&lt;br /&gt;
'''Replace ITK_OVERRIDE'''&lt;br /&gt;
&lt;br /&gt;
The regexp involving ITK were extracted from the [https://github.com/InsightSoftwareConsortium/ITK/blob/master/Utilities/ITKv5Preparation/ReplaceITK_OVERRIDEMacroNames.sh ReplaceITK_OVERRIDEMacroNames.sh] script in ITK.&lt;br /&gt;
&lt;br /&gt;
  git grep -l &amp;quot;ITK_OVERRIDE&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/ITK_OVERRIDE/override/g&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''Replace VTK_OVERRIDE'''&lt;br /&gt;
&lt;br /&gt;
  git grep -l &amp;quot;VTK_OVERRIDE&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/VTK_OVERRIDE/override/g&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''Automatic update: Using clang-tidy'''&lt;br /&gt;
&lt;br /&gt;
This will iteratively check files for updates. It takes a while. The sources are only modified at the end of the process, so you could cancel anytime before with no consequences.&lt;br /&gt;
&lt;br /&gt;
Compile Slicer with the CMake option -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON to generate the file compile_commands.json at configuration time.&lt;br /&gt;
Run clang-tidy on the generated compile_commands.json (in the build folder: Slicer-build)&lt;br /&gt;
&lt;br /&gt;
  run-clang-tidy.py -checks=-*,modernize-use-override  -header-filter=.* -fix&lt;br /&gt;
&lt;br /&gt;
'''Manual fix'''&lt;br /&gt;
&lt;br /&gt;
Multiple override are added to the same method. For example:&lt;br /&gt;
&lt;br /&gt;
  void PrintSelf(ostream&amp;amp; os, vtkIndent indent) override override override;&lt;br /&gt;
&lt;br /&gt;
We clean them with (15 here is just a high enough number):&lt;br /&gt;
&lt;br /&gt;
  for n in `seq 1 15`;&lt;br /&gt;
  do&lt;br /&gt;
      ack &amp;quot;override override&amp;quot; -l --print0 | xargs -0 -n 1 sed -i \&lt;br /&gt;
      's/override override/override/g'&lt;br /&gt;
  done&lt;br /&gt;
&lt;br /&gt;
When all of them are fixed, you should see in the terminal:&lt;br /&gt;
&lt;br /&gt;
  sed: no input files&lt;/div&gt;</summary>
		<author><name>Phcerdan</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval&amp;diff=60894</id>
		<title>Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval&amp;diff=60894"/>
		<updated>2019-03-14T01:19:45Z</updated>

		<summary type="html">&lt;p&gt;Phcerdan: /* C++11: Update source code to use override */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Obsolete Code Removal==&lt;br /&gt;
&lt;br /&gt;
This section documents suggested code changes after removing support for a particular features. Each category has a short description, code snippets, a suggested upgrade path, and references to relevant commits.&lt;br /&gt;
&lt;br /&gt;
===Qt&amp;gt;=5.0.0: Remove obsolete code supporting Qt4 plugin infrastructure (C++)===&lt;br /&gt;
&lt;br /&gt;
These changes apply to Qt loadable modules and designer plugins&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModuleWidgetsPlugin.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;quot;vtkSlicerConfigure.h&amp;quot; // For Slicer_HAVE_QT5&lt;br /&gt;
&lt;br /&gt;
// Qt includes&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
#include &amp;lt;QtUiPlugin/QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
#else&lt;br /&gt;
#include &amp;lt;QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
class Q_SLICER_MODULE_SUBJECTHIERARCHY_WIDGETS_PLUGINS_EXPORT qSlicerSubjectHierarchyModuleWidgetsPlugin&lt;br /&gt;
  : public QObject&lt;br /&gt;
  , public QDesignerCustomWidgetCollectionInterface&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetCollectionInterface&amp;quot;)&lt;br /&gt;
#endif&lt;br /&gt;
  Q_INTERFACES(QDesignerCustomWidgetCollectionInterface);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Qt includes&lt;br /&gt;
#include &amp;lt;QtUiPlugin/QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
class Q_SLICER_MODULE_SUBJECTHIERARCHY_WIDGETS_PLUGINS_EXPORT qSlicerSubjectHierarchyModuleWidgetsPlugin&lt;br /&gt;
  : public QObject&lt;br /&gt;
  , public QDesignerCustomWidgetCollectionInterface&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetCollectionInterface&amp;quot;)&lt;br /&gt;
  Q_INTERFACES(QDesignerCustomWidgetCollectionInterface);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModule.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Q_SLICER_QTMODULES_SUBJECTHIERARCHY_EXPORT qSlicerSubjectHierarchyModule :&lt;br /&gt;
  public qSlicerLoadableModule&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.slicer.modules.loadable.qSlicerLoadableModule/1.0&amp;quot;);&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Q_SLICER_QTMODULES_SUBJECTHIERARCHY_EXPORT qSlicerSubjectHierarchyModule :&lt;br /&gt;
  public qSlicerLoadableModule&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.slicer.modules.loadable.qSlicerLoadableModule/1.0&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModuleWidgetsAbstractPlugin.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  #include &amp;lt;QtGlobal&amp;gt;&lt;br /&gt;
  #if(QT_VERSION &amp;lt; QT_VERSION_CHECKS(5, 0, 0))&lt;br /&gt;
  #include &amp;lt;QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
  #else&lt;br /&gt;
  #include &amp;lt;QtUiPlugin/QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
  [...]&lt;br /&gt;
&lt;br /&gt;
  class Q_SLICER_MODULE_SEGMENTATIONS_WIDGETS_PLUGINS_EXPORT qSlicerSegmentationsModuleWidgetsAbstractPlugin&lt;br /&gt;
      : public QDesignerCustomWidgetInterface&lt;br /&gt;
  {&lt;br /&gt;
  #if (QT_VERSION &amp;gt;= QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
    Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetInterface&amp;quot;)&lt;br /&gt;
  #endif&lt;br /&gt;
    Q_INTERFACES(QDesignerCustomWidgetInterface);&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  #include &amp;lt;QtUiPlugin/QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  [...]&lt;br /&gt;
&lt;br /&gt;
  class Q_SLICER_MODULE_SEGMENTATIONS_WIDGETS_PLUGINS_EXPORT qSlicerSegmentationsModuleWidgetsAbstractPlugin&lt;br /&gt;
      : public QDesignerCustomWidgetInterface&lt;br /&gt;
  {&lt;br /&gt;
    Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetInterface&amp;quot;)&lt;br /&gt;
    Q_INTERFACES(QDesignerCustomWidgetInterface);&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModule.cxx and qSlicerNAMEModuleWidgetsAbstractPlugin.cxx====&lt;br /&gt;
&lt;br /&gt;
'''Remove:'''&lt;br /&gt;
&lt;br /&gt;
  #if (QT_VERSION &amp;lt; QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
  #include &amp;lt;QtPlugin&amp;gt;&lt;br /&gt;
  Q_EXPORT_PLUGIN2(customwidgetplugin, qSlicerSegmentationsModuleWidgetsPlugin);&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
===Qt&amp;gt;=5.0.0: Simpler use of QHeaderView::setSectionResizeMode===&lt;br /&gt;
&lt;br /&gt;
This migration guide entry is obsolete: [[Documentation/Nightly/Developers/Tutorials/MigrationGuide#Qt5:_Fix_error:_.E2.80.98class_QHeaderView.E2.80.99_has_no_member_named_.E2.80.98setResizeMode.E2.80.99]]&lt;br /&gt;
&lt;br /&gt;
'''Solution for Cpp'''&lt;br /&gt;
&lt;br /&gt;
Before:&lt;br /&gt;
&lt;br /&gt;
  #if (QT_VERSION &amp;lt; QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(QHeaderView::Stretch);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
  #else&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::Stretch);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::Stretch);&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Solution for Python'''&lt;br /&gt;
&lt;br /&gt;
Before:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def _setSectionResizeMode(header, *args, **kwargs):&lt;br /&gt;
    if version.parse(qt.Qt.qVersion()) &amp;lt; version.parse(&amp;quot;5.0.0&amp;quot;):&lt;br /&gt;
      header.setResizeMode(*args, **kwargs)&lt;br /&gt;
    else:&lt;br /&gt;
      header.setSectionResizeMode(*args, **kwargs)&lt;br /&gt;
&lt;br /&gt;
    [...]&lt;br /&gt;
   &lt;br /&gt;
  _setSectionResizeMode(self.horizontalHeader(), 0, qt.QHeaderView.Stretch)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After:&lt;br /&gt;
&lt;br /&gt;
  self.horizontalHeader().setSectionResizeMode(0, qt.QHeaderView.Stretch)&lt;br /&gt;
&lt;br /&gt;
===C++11: Update source code to use nullptr===&lt;br /&gt;
&lt;br /&gt;
C++11 introduced the keyword &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt; allowing to explicitly identify a pointer of type &amp;lt;tt&amp;gt;std::nullptr_t&amp;lt;/tt&amp;gt;. It avoids ambiguous function overloads. See also https://stackoverflow.com/questions/20509734/null-vs-nullptr-why-was-it-replaced&lt;br /&gt;
&lt;br /&gt;
Prior to supporting only C++11, &amp;lt;tt&amp;gt;0&amp;lt;/tt&amp;gt; and [http://www.cplusplus.com/reference/cstring/NULL/ NULL] integral type were used to check for pointer value, and macro like &amp;lt;tt&amp;gt;Q_NULLPTR&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;ITK_NULLPTR&amp;lt;/tt&amp;gt; macros were used to ensure usage of &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt; when C++11 support was enabled.&lt;br /&gt;
&lt;br /&gt;
Updating the code base to use &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt; is a 2-step process:&lt;br /&gt;
* use clang-tidy for updating source code being explicitly compiled in the project.&lt;br /&gt;
* directly update source code not being compiled: conditionally compiled code, templated headers, comments, ...&lt;br /&gt;
&lt;br /&gt;
'''Automatic update: Using clang-tidy'''&lt;br /&gt;
&lt;br /&gt;
This will iteratively check files for updates. It takes a while. The sources are only modified at the end of the process, so you could cancel anytime before with no consequences.&lt;br /&gt;
# Compile Slicer with the CMake option -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON to generate the file compile_commands.json at configuration time.&lt;br /&gt;
# Run clang-tidy on the generated compile_commands.json (in the build folder: Slicer-build)&lt;br /&gt;
  run-clang-tidy.py -header-filter='.*' -checks='-*,modernize-use-nullptr' -fix&lt;br /&gt;
[http://clang.llvm.org/extra/clang-tidy/ clang-tidy] is a tool from clang. In Archlinux: sudo pacman -S clang, in other distros might be clang-extra-tools or similar.&lt;br /&gt;
&lt;br /&gt;
clang-tidy will substitute NULL and 0 for nullptr when appropiate. It is an iterative process, so it may take time. Also, it replaces all the compiled code, including external dependencies.&lt;br /&gt;
It is recommended to do a fresh build with the modified code, for testing it without modifications in any external repo.&lt;br /&gt;
&lt;br /&gt;
'''Direct update: Using shell script'''&lt;br /&gt;
&lt;br /&gt;
After clang-tidy has modified the compiled code with the help of compile_commands.json, there will still be ignored instances of NULL and 0 in some headers, and comments.&lt;br /&gt;
&lt;br /&gt;
Manually replace with the following regex to change those.&lt;br /&gt;
&lt;br /&gt;
1) Change NULL to nullptr except when there is a quote or an underscore in&lt;br /&gt;
front of it. And there is not a quote after.&lt;br /&gt;
&lt;br /&gt;
  ack --cpp &amp;quot;NULL&amp;quot; -l --print0 | xargs -0 -n 1 sed -i 's/\([^\&amp;quot;\_]\)NULL\([^\&amp;quot;\_]\)/\1nullptr\2/g'&lt;br /&gt;
&lt;br /&gt;
2) The same than before but match end of line NULL&lt;br /&gt;
  ack --cpp &amp;quot;NULL&amp;quot; -l --print0 | xargs -0 -n 1 sed -i 's/\([^\&amp;quot;\_]\)NULL$/\1nullptr/g'&lt;br /&gt;
&lt;br /&gt;
'''Replace ITK_NULLPTR'''&lt;br /&gt;
&lt;br /&gt;
It was adapted from the ITK script in [https://github.com/InsightSoftwareConsortium/ITK/blob/master/Utilities/ITKv5Preparation/ReplaceITK_NULLPTRMacroNames.sh ReplaceITK_NULLPTRMacroNames.sh]&lt;br /&gt;
&lt;br /&gt;
  git grep -l &amp;quot;ITK_NULLPTR&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/ITK_NULLPTR/nullptr/g&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===C++11: Update source code to use override===&lt;br /&gt;
&lt;br /&gt;
From: https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-override.html&lt;br /&gt;
&lt;br /&gt;
Adds override (introduced in C++11) to overridden virtual functions and removes virtual from those functions as it is not required.&lt;br /&gt;
&lt;br /&gt;
virtual on non base class implementations was used to help indicate to the user that a function was virtual. C++ compilers did not use the presence of this to signify an overriden function.&lt;br /&gt;
&lt;br /&gt;
In C++ 11 override and final keywords were introduced to allow overridden functions to be marked appropriately. Their presence allows compilers to verify that an overridden function correctly overrides a base class implementation.&lt;br /&gt;
&lt;br /&gt;
This can be useful as compilers can generate a compile time error when:&lt;br /&gt;
&lt;br /&gt;
# The base class implementation function signature changes.&lt;br /&gt;
# The user has not created the override with the correct signature.&lt;br /&gt;
&lt;br /&gt;
First we replace ITK_OVERRIDE and VTK_OVERRIDE for override:&lt;br /&gt;
&lt;br /&gt;
'''Replace ITK_OVERRIDE'''&lt;br /&gt;
&lt;br /&gt;
The regexp involving ITK were extracted from the [https://github.com/InsightSoftwareConsortium/ITK/blob/master/Utilities/ITKv5Preparation/ReplaceITK_OVERRIDEMacroNames.sh ReplaceITK_OVERRIDEMacroNames.sh] script in ITK.&lt;br /&gt;
&lt;br /&gt;
  git grep -l &amp;quot;ITK_OVERRIDE&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/ITK_OVERRIDE/override/g&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''Replace VTK_OVERRIDE'''&lt;br /&gt;
&lt;br /&gt;
  git grep -l &amp;quot;VTK_OVERRIDE&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/VTK_OVERRIDE/override/g&amp;quot;&lt;/div&gt;</summary>
		<author><name>Phcerdan</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval&amp;diff=60893</id>
		<title>Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval&amp;diff=60893"/>
		<updated>2019-03-14T01:16:39Z</updated>

		<summary type="html">&lt;p&gt;Phcerdan: /* C++11: Update source code to use nullptr */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Obsolete Code Removal==&lt;br /&gt;
&lt;br /&gt;
This section documents suggested code changes after removing support for a particular features. Each category has a short description, code snippets, a suggested upgrade path, and references to relevant commits.&lt;br /&gt;
&lt;br /&gt;
===Qt&amp;gt;=5.0.0: Remove obsolete code supporting Qt4 plugin infrastructure (C++)===&lt;br /&gt;
&lt;br /&gt;
These changes apply to Qt loadable modules and designer plugins&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModuleWidgetsPlugin.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;quot;vtkSlicerConfigure.h&amp;quot; // For Slicer_HAVE_QT5&lt;br /&gt;
&lt;br /&gt;
// Qt includes&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
#include &amp;lt;QtUiPlugin/QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
#else&lt;br /&gt;
#include &amp;lt;QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
class Q_SLICER_MODULE_SUBJECTHIERARCHY_WIDGETS_PLUGINS_EXPORT qSlicerSubjectHierarchyModuleWidgetsPlugin&lt;br /&gt;
  : public QObject&lt;br /&gt;
  , public QDesignerCustomWidgetCollectionInterface&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetCollectionInterface&amp;quot;)&lt;br /&gt;
#endif&lt;br /&gt;
  Q_INTERFACES(QDesignerCustomWidgetCollectionInterface);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Qt includes&lt;br /&gt;
#include &amp;lt;QtUiPlugin/QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
class Q_SLICER_MODULE_SUBJECTHIERARCHY_WIDGETS_PLUGINS_EXPORT qSlicerSubjectHierarchyModuleWidgetsPlugin&lt;br /&gt;
  : public QObject&lt;br /&gt;
  , public QDesignerCustomWidgetCollectionInterface&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetCollectionInterface&amp;quot;)&lt;br /&gt;
  Q_INTERFACES(QDesignerCustomWidgetCollectionInterface);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModule.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Q_SLICER_QTMODULES_SUBJECTHIERARCHY_EXPORT qSlicerSubjectHierarchyModule :&lt;br /&gt;
  public qSlicerLoadableModule&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.slicer.modules.loadable.qSlicerLoadableModule/1.0&amp;quot;);&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Q_SLICER_QTMODULES_SUBJECTHIERARCHY_EXPORT qSlicerSubjectHierarchyModule :&lt;br /&gt;
  public qSlicerLoadableModule&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.slicer.modules.loadable.qSlicerLoadableModule/1.0&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModuleWidgetsAbstractPlugin.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  #include &amp;lt;QtGlobal&amp;gt;&lt;br /&gt;
  #if(QT_VERSION &amp;lt; QT_VERSION_CHECKS(5, 0, 0))&lt;br /&gt;
  #include &amp;lt;QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
  #else&lt;br /&gt;
  #include &amp;lt;QtUiPlugin/QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
  [...]&lt;br /&gt;
&lt;br /&gt;
  class Q_SLICER_MODULE_SEGMENTATIONS_WIDGETS_PLUGINS_EXPORT qSlicerSegmentationsModuleWidgetsAbstractPlugin&lt;br /&gt;
      : public QDesignerCustomWidgetInterface&lt;br /&gt;
  {&lt;br /&gt;
  #if (QT_VERSION &amp;gt;= QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
    Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetInterface&amp;quot;)&lt;br /&gt;
  #endif&lt;br /&gt;
    Q_INTERFACES(QDesignerCustomWidgetInterface);&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  #include &amp;lt;QtUiPlugin/QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  [...]&lt;br /&gt;
&lt;br /&gt;
  class Q_SLICER_MODULE_SEGMENTATIONS_WIDGETS_PLUGINS_EXPORT qSlicerSegmentationsModuleWidgetsAbstractPlugin&lt;br /&gt;
      : public QDesignerCustomWidgetInterface&lt;br /&gt;
  {&lt;br /&gt;
    Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetInterface&amp;quot;)&lt;br /&gt;
    Q_INTERFACES(QDesignerCustomWidgetInterface);&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModule.cxx and qSlicerNAMEModuleWidgetsAbstractPlugin.cxx====&lt;br /&gt;
&lt;br /&gt;
'''Remove:'''&lt;br /&gt;
&lt;br /&gt;
  #if (QT_VERSION &amp;lt; QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
  #include &amp;lt;QtPlugin&amp;gt;&lt;br /&gt;
  Q_EXPORT_PLUGIN2(customwidgetplugin, qSlicerSegmentationsModuleWidgetsPlugin);&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
===Qt&amp;gt;=5.0.0: Simpler use of QHeaderView::setSectionResizeMode===&lt;br /&gt;
&lt;br /&gt;
This migration guide entry is obsolete: [[Documentation/Nightly/Developers/Tutorials/MigrationGuide#Qt5:_Fix_error:_.E2.80.98class_QHeaderView.E2.80.99_has_no_member_named_.E2.80.98setResizeMode.E2.80.99]]&lt;br /&gt;
&lt;br /&gt;
'''Solution for Cpp'''&lt;br /&gt;
&lt;br /&gt;
Before:&lt;br /&gt;
&lt;br /&gt;
  #if (QT_VERSION &amp;lt; QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(QHeaderView::Stretch);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
  #else&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::Stretch);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::Stretch);&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Solution for Python'''&lt;br /&gt;
&lt;br /&gt;
Before:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def _setSectionResizeMode(header, *args, **kwargs):&lt;br /&gt;
    if version.parse(qt.Qt.qVersion()) &amp;lt; version.parse(&amp;quot;5.0.0&amp;quot;):&lt;br /&gt;
      header.setResizeMode(*args, **kwargs)&lt;br /&gt;
    else:&lt;br /&gt;
      header.setSectionResizeMode(*args, **kwargs)&lt;br /&gt;
&lt;br /&gt;
    [...]&lt;br /&gt;
   &lt;br /&gt;
  _setSectionResizeMode(self.horizontalHeader(), 0, qt.QHeaderView.Stretch)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After:&lt;br /&gt;
&lt;br /&gt;
  self.horizontalHeader().setSectionResizeMode(0, qt.QHeaderView.Stretch)&lt;br /&gt;
&lt;br /&gt;
===C++11: Update source code to use nullptr===&lt;br /&gt;
&lt;br /&gt;
C++11 introduced the keyword &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt; allowing to explicitly identify a pointer of type &amp;lt;tt&amp;gt;std::nullptr_t&amp;lt;/tt&amp;gt;. It avoids ambiguous function overloads. See also https://stackoverflow.com/questions/20509734/null-vs-nullptr-why-was-it-replaced&lt;br /&gt;
&lt;br /&gt;
Prior to supporting only C++11, &amp;lt;tt&amp;gt;0&amp;lt;/tt&amp;gt; and [http://www.cplusplus.com/reference/cstring/NULL/ NULL] integral type were used to check for pointer value, and macro like &amp;lt;tt&amp;gt;Q_NULLPTR&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;ITK_NULLPTR&amp;lt;/tt&amp;gt; macros were used to ensure usage of &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt; when C++11 support was enabled.&lt;br /&gt;
&lt;br /&gt;
Updating the code base to use &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt; is a 2-step process:&lt;br /&gt;
* use clang-tidy for updating source code being explicitly compiled in the project.&lt;br /&gt;
* directly update source code not being compiled: conditionally compiled code, templated headers, comments, ...&lt;br /&gt;
&lt;br /&gt;
'''Automatic update: Using clang-tidy'''&lt;br /&gt;
&lt;br /&gt;
This will iteratively check files for updates. It takes a while. The sources are only modified at the end of the process, so you could cancel anytime before with no consequences.&lt;br /&gt;
# Compile Slicer with the CMake option -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON to generate the file compile_commands.json at configuration time.&lt;br /&gt;
# Run clang-tidy on the generated compile_commands.json (in the build folder: Slicer-build)&lt;br /&gt;
  run-clang-tidy.py -header-filter='.*' -checks='-*,modernize-use-nullptr' -fix&lt;br /&gt;
[http://clang.llvm.org/extra/clang-tidy/ clang-tidy] is a tool from clang. In Archlinux: sudo pacman -S clang, in other distros might be clang-extra-tools or similar.&lt;br /&gt;
&lt;br /&gt;
clang-tidy will substitute NULL and 0 for nullptr when appropiate. It is an iterative process, so it may take time. Also, it replaces all the compiled code, including external dependencies.&lt;br /&gt;
It is recommended to do a fresh build with the modified code, for testing it without modifications in any external repo.&lt;br /&gt;
&lt;br /&gt;
'''Direct update: Using shell script'''&lt;br /&gt;
&lt;br /&gt;
After clang-tidy has modified the compiled code with the help of compile_commands.json, there will still be ignored instances of NULL and 0 in some headers, and comments.&lt;br /&gt;
&lt;br /&gt;
Manually replace with the following regex to change those.&lt;br /&gt;
&lt;br /&gt;
1) Change NULL to nullptr except when there is a quote or an underscore in&lt;br /&gt;
front of it. And there is not a quote after.&lt;br /&gt;
&lt;br /&gt;
  ack --cpp &amp;quot;NULL&amp;quot; -l --print0 | xargs -0 -n 1 sed -i 's/\([^\&amp;quot;\_]\)NULL\([^\&amp;quot;\_]\)/\1nullptr\2/g'&lt;br /&gt;
&lt;br /&gt;
2) The same than before but match end of line NULL&lt;br /&gt;
  ack --cpp &amp;quot;NULL&amp;quot; -l --print0 | xargs -0 -n 1 sed -i 's/\([^\&amp;quot;\_]\)NULL$/\1nullptr/g'&lt;br /&gt;
&lt;br /&gt;
'''Replace ITK_NULLPTR'''&lt;br /&gt;
&lt;br /&gt;
It was adapted from the ITK script in [https://github.com/InsightSoftwareConsortium/ITK/blob/master/Utilities/ITKv5Preparation/ReplaceITK_NULLPTRMacroNames.sh ReplaceITK_NULLPTRMacroNames.sh]&lt;br /&gt;
&lt;br /&gt;
  git grep -l &amp;quot;ITK_NULLPTR&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/ITK_NULLPTR/nullptr/g&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===C++11: Update source code to use override===&lt;br /&gt;
'''Replace ITK_OVERRIDE'''&lt;br /&gt;
&lt;br /&gt;
The regexp involving ITK were extracted from the [https://github.com/InsightSoftwareConsortium/ITK/blob/master/Utilities/ITKv5Preparation/ReplaceITK_OVERRIDEMacroNames.sh ReplaceITK_OVERRIDEMacroNames.sh] script in ITK.&lt;br /&gt;
&lt;br /&gt;
  git grep -l &amp;quot;ITK_OVERRIDE&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/ITK_OVERRIDE/override/g&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''Replace VTK_OVERRIDE'''&lt;br /&gt;
&lt;br /&gt;
  git grep -l &amp;quot;VTK_OVERRIDE&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/VTK_OVERRIDE/override/g&amp;quot;&lt;/div&gt;</summary>
		<author><name>Phcerdan</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval&amp;diff=60892</id>
		<title>Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval&amp;diff=60892"/>
		<updated>2019-03-14T01:15:24Z</updated>

		<summary type="html">&lt;p&gt;Phcerdan: /* C++11: Update source code to use nullptr */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Obsolete Code Removal==&lt;br /&gt;
&lt;br /&gt;
This section documents suggested code changes after removing support for a particular features. Each category has a short description, code snippets, a suggested upgrade path, and references to relevant commits.&lt;br /&gt;
&lt;br /&gt;
===Qt&amp;gt;=5.0.0: Remove obsolete code supporting Qt4 plugin infrastructure (C++)===&lt;br /&gt;
&lt;br /&gt;
These changes apply to Qt loadable modules and designer plugins&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModuleWidgetsPlugin.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;quot;vtkSlicerConfigure.h&amp;quot; // For Slicer_HAVE_QT5&lt;br /&gt;
&lt;br /&gt;
// Qt includes&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
#include &amp;lt;QtUiPlugin/QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
#else&lt;br /&gt;
#include &amp;lt;QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
class Q_SLICER_MODULE_SUBJECTHIERARCHY_WIDGETS_PLUGINS_EXPORT qSlicerSubjectHierarchyModuleWidgetsPlugin&lt;br /&gt;
  : public QObject&lt;br /&gt;
  , public QDesignerCustomWidgetCollectionInterface&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetCollectionInterface&amp;quot;)&lt;br /&gt;
#endif&lt;br /&gt;
  Q_INTERFACES(QDesignerCustomWidgetCollectionInterface);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Qt includes&lt;br /&gt;
#include &amp;lt;QtUiPlugin/QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
class Q_SLICER_MODULE_SUBJECTHIERARCHY_WIDGETS_PLUGINS_EXPORT qSlicerSubjectHierarchyModuleWidgetsPlugin&lt;br /&gt;
  : public QObject&lt;br /&gt;
  , public QDesignerCustomWidgetCollectionInterface&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetCollectionInterface&amp;quot;)&lt;br /&gt;
  Q_INTERFACES(QDesignerCustomWidgetCollectionInterface);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModule.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Q_SLICER_QTMODULES_SUBJECTHIERARCHY_EXPORT qSlicerSubjectHierarchyModule :&lt;br /&gt;
  public qSlicerLoadableModule&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.slicer.modules.loadable.qSlicerLoadableModule/1.0&amp;quot;);&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Q_SLICER_QTMODULES_SUBJECTHIERARCHY_EXPORT qSlicerSubjectHierarchyModule :&lt;br /&gt;
  public qSlicerLoadableModule&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.slicer.modules.loadable.qSlicerLoadableModule/1.0&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModuleWidgetsAbstractPlugin.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  #include &amp;lt;QtGlobal&amp;gt;&lt;br /&gt;
  #if(QT_VERSION &amp;lt; QT_VERSION_CHECKS(5, 0, 0))&lt;br /&gt;
  #include &amp;lt;QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
  #else&lt;br /&gt;
  #include &amp;lt;QtUiPlugin/QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
  [...]&lt;br /&gt;
&lt;br /&gt;
  class Q_SLICER_MODULE_SEGMENTATIONS_WIDGETS_PLUGINS_EXPORT qSlicerSegmentationsModuleWidgetsAbstractPlugin&lt;br /&gt;
      : public QDesignerCustomWidgetInterface&lt;br /&gt;
  {&lt;br /&gt;
  #if (QT_VERSION &amp;gt;= QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
    Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetInterface&amp;quot;)&lt;br /&gt;
  #endif&lt;br /&gt;
    Q_INTERFACES(QDesignerCustomWidgetInterface);&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  #include &amp;lt;QtUiPlugin/QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  [...]&lt;br /&gt;
&lt;br /&gt;
  class Q_SLICER_MODULE_SEGMENTATIONS_WIDGETS_PLUGINS_EXPORT qSlicerSegmentationsModuleWidgetsAbstractPlugin&lt;br /&gt;
      : public QDesignerCustomWidgetInterface&lt;br /&gt;
  {&lt;br /&gt;
    Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetInterface&amp;quot;)&lt;br /&gt;
    Q_INTERFACES(QDesignerCustomWidgetInterface);&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModule.cxx and qSlicerNAMEModuleWidgetsAbstractPlugin.cxx====&lt;br /&gt;
&lt;br /&gt;
'''Remove:'''&lt;br /&gt;
&lt;br /&gt;
  #if (QT_VERSION &amp;lt; QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
  #include &amp;lt;QtPlugin&amp;gt;&lt;br /&gt;
  Q_EXPORT_PLUGIN2(customwidgetplugin, qSlicerSegmentationsModuleWidgetsPlugin);&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
===Qt&amp;gt;=5.0.0: Simpler use of QHeaderView::setSectionResizeMode===&lt;br /&gt;
&lt;br /&gt;
This migration guide entry is obsolete: [[Documentation/Nightly/Developers/Tutorials/MigrationGuide#Qt5:_Fix_error:_.E2.80.98class_QHeaderView.E2.80.99_has_no_member_named_.E2.80.98setResizeMode.E2.80.99]]&lt;br /&gt;
&lt;br /&gt;
'''Solution for Cpp'''&lt;br /&gt;
&lt;br /&gt;
Before:&lt;br /&gt;
&lt;br /&gt;
  #if (QT_VERSION &amp;lt; QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(QHeaderView::Stretch);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
  #else&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::Stretch);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::Stretch);&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Solution for Python'''&lt;br /&gt;
&lt;br /&gt;
Before:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def _setSectionResizeMode(header, *args, **kwargs):&lt;br /&gt;
    if version.parse(qt.Qt.qVersion()) &amp;lt; version.parse(&amp;quot;5.0.0&amp;quot;):&lt;br /&gt;
      header.setResizeMode(*args, **kwargs)&lt;br /&gt;
    else:&lt;br /&gt;
      header.setSectionResizeMode(*args, **kwargs)&lt;br /&gt;
&lt;br /&gt;
    [...]&lt;br /&gt;
   &lt;br /&gt;
  _setSectionResizeMode(self.horizontalHeader(), 0, qt.QHeaderView.Stretch)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After:&lt;br /&gt;
&lt;br /&gt;
  self.horizontalHeader().setSectionResizeMode(0, qt.QHeaderView.Stretch)&lt;br /&gt;
&lt;br /&gt;
===C++11: Update source code to use nullptr===&lt;br /&gt;
&lt;br /&gt;
C++11 introduced the keyword &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt; allowing to explicitly identify a pointer of type &amp;lt;tt&amp;gt;std::nullptr_t&amp;lt;/tt&amp;gt;. It avoids ambiguous function overloads. See also https://stackoverflow.com/questions/20509734/null-vs-nullptr-why-was-it-replaced&lt;br /&gt;
&lt;br /&gt;
Prior to supporting only C++11, &amp;lt;tt&amp;gt;0&amp;lt;/tt&amp;gt; and [http://www.cplusplus.com/reference/cstring/NULL/ NULL] integral type were used to check for pointer value, and macro like &amp;lt;tt&amp;gt;Q_NULLPTR&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;ITK_NULLPTR&amp;lt;/tt&amp;gt; macros were used to ensure usage of &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt; when C++11 support was enabled.&lt;br /&gt;
&lt;br /&gt;
Updating the code base to use &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt; is a 2-step process:&lt;br /&gt;
* use clang-tidy for updating source code being explicitly compiled in the project.&lt;br /&gt;
* directly update source code not being compiled: conditionally compiled code, templated headers, comments, ...&lt;br /&gt;
&lt;br /&gt;
'''Replace ITK_NULLPTR'''&lt;br /&gt;
&lt;br /&gt;
It was adapted from the ITK script in [https://github.com/InsightSoftwareConsortium/ITK/blob/master/Utilities/ITKv5Preparation/ReplaceITK_NULLPTRMacroNames.sh ReplaceITK_NULLPTRMacroNames.sh]&lt;br /&gt;
&lt;br /&gt;
  git grep -l &amp;quot;ITK_NULLPTR&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/ITK_NULLPTR/nullptr/g&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Automatic update: Using clang-tidy'''&lt;br /&gt;
&lt;br /&gt;
This will iteratively check files for updates. It takes a while. The sources are only modified at the end of the process, so you could cancel anytime before with no consequences.&lt;br /&gt;
# Compile Slicer with the CMake option -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON to generate the file compile_commands.json at configuration time.&lt;br /&gt;
# Run clang-tidy on the generated compile_commands.json (in the build folder: Slicer-build)&lt;br /&gt;
  run-clang-tidy.py -header-filter='.*' -checks='-*,modernize-use-nullptr' -fix&lt;br /&gt;
[http://clang.llvm.org/extra/clang-tidy/ clang-tidy] is a tool from clang. In Archlinux: sudo pacman -S clang, in other distros might be clang-extra-tools or similar.&lt;br /&gt;
&lt;br /&gt;
clang-tidy will substitute NULL and 0 for nullptr when appropiate. It is an iterative process, so it may take time. Also, it replaces all the compiled code, including external dependencies.&lt;br /&gt;
It is recommended to do a fresh build with the modified code, for testing it without modifications in any external repo.&lt;br /&gt;
&lt;br /&gt;
'''Direct update: Using shell script'''&lt;br /&gt;
&lt;br /&gt;
After clang-tidy has modified the compiled code with the help of compile_commands.json, there will still be ignored instances of NULL and 0 in some headers, and comments.&lt;br /&gt;
&lt;br /&gt;
Manually replace with the following regex to change those.&lt;br /&gt;
&lt;br /&gt;
1) Change NULL to nullptr except when there is a quote or an underscore in&lt;br /&gt;
front of it. And there is not a quote after.&lt;br /&gt;
&lt;br /&gt;
  ack --cpp &amp;quot;NULL&amp;quot; -l --print0 | xargs -0 -n 1 sed -i 's/\([^\&amp;quot;\_]\)NULL\([^\&amp;quot;\_]\)/\1nullptr\2/g'&lt;br /&gt;
&lt;br /&gt;
2) The same than before but match end of line NULL&lt;br /&gt;
  ack --cpp &amp;quot;NULL&amp;quot; -l --print0 | xargs -0 -n 1 sed -i 's/\([^\&amp;quot;\_]\)NULL$/\1nullptr/g'&lt;br /&gt;
&lt;br /&gt;
===C++11: Update source code to use override===&lt;br /&gt;
'''Replace ITK_OVERRIDE'''&lt;br /&gt;
&lt;br /&gt;
The regexp involving ITK were extracted from the [https://github.com/InsightSoftwareConsortium/ITK/blob/master/Utilities/ITKv5Preparation/ReplaceITK_OVERRIDEMacroNames.sh ReplaceITK_OVERRIDEMacroNames.sh] script in ITK.&lt;br /&gt;
&lt;br /&gt;
  git grep -l &amp;quot;ITK_OVERRIDE&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/ITK_OVERRIDE/override/g&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''Replace VTK_OVERRIDE'''&lt;br /&gt;
&lt;br /&gt;
  git grep -l &amp;quot;VTK_OVERRIDE&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/VTK_OVERRIDE/override/g&amp;quot;&lt;/div&gt;</summary>
		<author><name>Phcerdan</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval&amp;diff=60889</id>
		<title>Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval&amp;diff=60889"/>
		<updated>2019-03-13T15:51:26Z</updated>

		<summary type="html">&lt;p&gt;Phcerdan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Obsolete Code Removal==&lt;br /&gt;
&lt;br /&gt;
This section documents suggested code changes after removing support for a particular features. Each category has a short description, code snippets, a suggested upgrade path, and references to relevant commits.&lt;br /&gt;
&lt;br /&gt;
===Qt&amp;gt;=5.0.0: Remove obsolete code supporting Qt4 plugin infrastructure (C++)===&lt;br /&gt;
&lt;br /&gt;
These changes apply to Qt loadable modules and designer plugins&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModuleWidgetsPlugin.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;quot;vtkSlicerConfigure.h&amp;quot; // For Slicer_HAVE_QT5&lt;br /&gt;
&lt;br /&gt;
// Qt includes&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
#include &amp;lt;QtUiPlugin/QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
#else&lt;br /&gt;
#include &amp;lt;QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
class Q_SLICER_MODULE_SUBJECTHIERARCHY_WIDGETS_PLUGINS_EXPORT qSlicerSubjectHierarchyModuleWidgetsPlugin&lt;br /&gt;
  : public QObject&lt;br /&gt;
  , public QDesignerCustomWidgetCollectionInterface&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetCollectionInterface&amp;quot;)&lt;br /&gt;
#endif&lt;br /&gt;
  Q_INTERFACES(QDesignerCustomWidgetCollectionInterface);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Qt includes&lt;br /&gt;
#include &amp;lt;QtUiPlugin/QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
class Q_SLICER_MODULE_SUBJECTHIERARCHY_WIDGETS_PLUGINS_EXPORT qSlicerSubjectHierarchyModuleWidgetsPlugin&lt;br /&gt;
  : public QObject&lt;br /&gt;
  , public QDesignerCustomWidgetCollectionInterface&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetCollectionInterface&amp;quot;)&lt;br /&gt;
  Q_INTERFACES(QDesignerCustomWidgetCollectionInterface);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModule.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Q_SLICER_QTMODULES_SUBJECTHIERARCHY_EXPORT qSlicerSubjectHierarchyModule :&lt;br /&gt;
  public qSlicerLoadableModule&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.slicer.modules.loadable.qSlicerLoadableModule/1.0&amp;quot;);&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Q_SLICER_QTMODULES_SUBJECTHIERARCHY_EXPORT qSlicerSubjectHierarchyModule :&lt;br /&gt;
  public qSlicerLoadableModule&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.slicer.modules.loadable.qSlicerLoadableModule/1.0&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModuleWidgetsAbstractPlugin.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  #include &amp;lt;QtGlobal&amp;gt;&lt;br /&gt;
  #if(QT_VERSION &amp;lt; QT_VERSION_CHECKS(5, 0, 0))&lt;br /&gt;
  #include &amp;lt;QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
  #else&lt;br /&gt;
  #include &amp;lt;QtUiPlugin/QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
  [...]&lt;br /&gt;
&lt;br /&gt;
  class Q_SLICER_MODULE_SEGMENTATIONS_WIDGETS_PLUGINS_EXPORT qSlicerSegmentationsModuleWidgetsAbstractPlugin&lt;br /&gt;
      : public QDesignerCustomWidgetInterface&lt;br /&gt;
  {&lt;br /&gt;
  #if (QT_VERSION &amp;gt;= QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
    Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetInterface&amp;quot;)&lt;br /&gt;
  #endif&lt;br /&gt;
    Q_INTERFACES(QDesignerCustomWidgetInterface);&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  #include &amp;lt;QtUiPlugin/QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  [...]&lt;br /&gt;
&lt;br /&gt;
  class Q_SLICER_MODULE_SEGMENTATIONS_WIDGETS_PLUGINS_EXPORT qSlicerSegmentationsModuleWidgetsAbstractPlugin&lt;br /&gt;
      : public QDesignerCustomWidgetInterface&lt;br /&gt;
  {&lt;br /&gt;
    Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetInterface&amp;quot;)&lt;br /&gt;
    Q_INTERFACES(QDesignerCustomWidgetInterface);&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModule.cxx and qSlicerNAMEModuleWidgetsAbstractPlugin.cxx====&lt;br /&gt;
&lt;br /&gt;
'''Remove:'''&lt;br /&gt;
&lt;br /&gt;
  #if (QT_VERSION &amp;lt; QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
  #include &amp;lt;QtPlugin&amp;gt;&lt;br /&gt;
  Q_EXPORT_PLUGIN2(customwidgetplugin, qSlicerSegmentationsModuleWidgetsPlugin);&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
===Qt&amp;gt;=5.0.0: Simpler use of QHeaderView::setSectionResizeMode===&lt;br /&gt;
&lt;br /&gt;
This migration guide entry is obsolete: [[Documentation/Nightly/Developers/Tutorials/MigrationGuide#Qt5:_Fix_error:_.E2.80.98class_QHeaderView.E2.80.99_has_no_member_named_.E2.80.98setResizeMode.E2.80.99]]&lt;br /&gt;
&lt;br /&gt;
'''Solution for Cpp'''&lt;br /&gt;
&lt;br /&gt;
Before:&lt;br /&gt;
&lt;br /&gt;
  #if (QT_VERSION &amp;lt; QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(QHeaderView::Stretch);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
  #else&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::Stretch);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::Stretch);&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Solution for Python'''&lt;br /&gt;
&lt;br /&gt;
Before:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def _setSectionResizeMode(header, *args, **kwargs):&lt;br /&gt;
    if version.parse(qt.Qt.qVersion()) &amp;lt; version.parse(&amp;quot;5.0.0&amp;quot;):&lt;br /&gt;
      header.setResizeMode(*args, **kwargs)&lt;br /&gt;
    else:&lt;br /&gt;
      header.setSectionResizeMode(*args, **kwargs)&lt;br /&gt;
&lt;br /&gt;
    [...]&lt;br /&gt;
   &lt;br /&gt;
  _setSectionResizeMode(self.horizontalHeader(), 0, qt.QHeaderView.Stretch)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After:&lt;br /&gt;
&lt;br /&gt;
  self.horizontalHeader().setSectionResizeMode(0, qt.QHeaderView.Stretch)&lt;br /&gt;
&lt;br /&gt;
===C++11: Update source code to use nullptr===&lt;br /&gt;
&lt;br /&gt;
C++11 introduced the keyword &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt; allowing to explicitly identify a pointer of type &amp;lt;tt&amp;gt;std::nullptr_t&amp;lt;/tt&amp;gt;. It avoids ambiguous function overloads. See also https://stackoverflow.com/questions/20509734/null-vs-nullptr-why-was-it-replaced&lt;br /&gt;
&lt;br /&gt;
Prior to supporting only C++11, &amp;lt;tt&amp;gt;0&amp;lt;/tt&amp;gt; and [http://www.cplusplus.com/reference/cstring/NULL/ NULL] integral type were used to check for pointer value, and macro like &amp;lt;tt&amp;gt;Q_NULLPTR&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;ITK_NULLPTR&amp;lt;/tt&amp;gt; macros were used to ensure usage of &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt; when C++11 support was enabled.&lt;br /&gt;
&lt;br /&gt;
Updating the code base to use &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt; is a 2-step process:&lt;br /&gt;
* use clang-tidy for updating source code being explicitly compiled in the project.&lt;br /&gt;
* directly update source code not being compiled: conditionally compiled code, templated headers, comments, ...&lt;br /&gt;
&lt;br /&gt;
'''Automatic update: Using clang-tidy'''&lt;br /&gt;
&lt;br /&gt;
This will iteratively check files for updates. It takes a while. The sources are only modified at the end of the process, so you could cancel anytime before with no consequences.&lt;br /&gt;
# Compile Slicer with the CMake option -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON to generate the file compile_commands.json at configuration time.&lt;br /&gt;
# Run clang-tidy on the generated compile_commands.json (in the build folder: Slicer-build)&lt;br /&gt;
  run-clang-tidy.py -header-filter='.*' -checks='-*,modernize-use-nullptr' -fix&lt;br /&gt;
[http://clang.llvm.org/extra/clang-tidy/ clang-tidy] is a tool from clang. In Archlinux: sudo pacman -S clang, in other distros might be clang-extra-tools or similar.&lt;br /&gt;
&lt;br /&gt;
clang-tidy will substitute NULL and 0 for nullptr when appropiate. It is an iterative process, so it may take time. Also, it replaces all the compiled code, including external dependencies.&lt;br /&gt;
It is recommended to do a fresh build with the modified code, for testing it without modifications in any external repo.&lt;br /&gt;
&lt;br /&gt;
'''Direct update: Using shell script'''&lt;br /&gt;
&lt;br /&gt;
After clang-tidy has modified the compiled code with the help of compile_commands.json, there will still be ignored instances of NULL and 0 in some headers, and comments.&lt;br /&gt;
&lt;br /&gt;
Manually replace with the following regex to change those.&lt;br /&gt;
&lt;br /&gt;
1) Change NULL to nullptr except when there is a quote or an underscore in&lt;br /&gt;
front of it. And there is not a quote after.&lt;br /&gt;
&lt;br /&gt;
  ack --cpp &amp;quot;NULL&amp;quot; -l --print0 | xargs -0 -n 1 sed -i 's/\([^\&amp;quot;\_]\)NULL\([^\&amp;quot;\_]\)/\1nullptr\2/g'&lt;br /&gt;
&lt;br /&gt;
2) The same than before but match end of line NULL&lt;br /&gt;
  ack --cpp &amp;quot;NULL&amp;quot; -l --print0 | xargs -0 -n 1 sed -i 's/\([^\&amp;quot;\_]\)NULL$/\1nullptr/g'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Replace ITK_NULLPTR'''&lt;br /&gt;
&lt;br /&gt;
It was adapted from the ITK script in [https://github.com/InsightSoftwareConsortium/ITK/blob/master/Utilities/ITKv5Preparation/ReplaceITK_NULLPTRMacroNames.sh ReplaceITK_NULLPTRMacroNames.sh]&lt;br /&gt;
&lt;br /&gt;
  git grep -l &amp;quot;ITK_NULLPTR&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/ITK_NULLPTR/nullptr/g&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===C++11: Update source code to use override===&lt;br /&gt;
'''Replace ITK_OVERRIDE'''&lt;br /&gt;
&lt;br /&gt;
The regexp involving ITK were extracted from the [https://github.com/InsightSoftwareConsortium/ITK/blob/master/Utilities/ITKv5Preparation/ReplaceITK_OVERRIDEMacroNames.sh ReplaceITK_OVERRIDEMacroNames.sh] script in ITK.&lt;br /&gt;
&lt;br /&gt;
  git grep -l &amp;quot;ITK_OVERRIDE&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/ITK_OVERRIDE/override/g&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''Replace VTK_OVERRIDE'''&lt;br /&gt;
&lt;br /&gt;
  git grep -l &amp;quot;VTK_OVERRIDE&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/VTK_OVERRIDE/override/g&amp;quot;&lt;/div&gt;</summary>
		<author><name>Phcerdan</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval&amp;diff=60888</id>
		<title>Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval&amp;diff=60888"/>
		<updated>2019-03-13T15:45:59Z</updated>

		<summary type="html">&lt;p&gt;Phcerdan: /* C++11: Update source code to use override */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Obsolete Code Removal==&lt;br /&gt;
&lt;br /&gt;
This section documents suggested code changes after removing support for a particular features. Each category has a short description, code snippets, a suggested upgrade path, and references to relevant commits.&lt;br /&gt;
&lt;br /&gt;
===Qt&amp;gt;=5.0.0: Remove obsolete code supporting Qt4 plugin infrastructure (C++)===&lt;br /&gt;
&lt;br /&gt;
These changes apply to Qt loadable modules and designer plugins&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModuleWidgetsPlugin.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;quot;vtkSlicerConfigure.h&amp;quot; // For Slicer_HAVE_QT5&lt;br /&gt;
&lt;br /&gt;
// Qt includes&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
#include &amp;lt;QtUiPlugin/QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
#else&lt;br /&gt;
#include &amp;lt;QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
class Q_SLICER_MODULE_SUBJECTHIERARCHY_WIDGETS_PLUGINS_EXPORT qSlicerSubjectHierarchyModuleWidgetsPlugin&lt;br /&gt;
  : public QObject&lt;br /&gt;
  , public QDesignerCustomWidgetCollectionInterface&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetCollectionInterface&amp;quot;)&lt;br /&gt;
#endif&lt;br /&gt;
  Q_INTERFACES(QDesignerCustomWidgetCollectionInterface);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Qt includes&lt;br /&gt;
#include &amp;lt;QtUiPlugin/QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
class Q_SLICER_MODULE_SUBJECTHIERARCHY_WIDGETS_PLUGINS_EXPORT qSlicerSubjectHierarchyModuleWidgetsPlugin&lt;br /&gt;
  : public QObject&lt;br /&gt;
  , public QDesignerCustomWidgetCollectionInterface&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetCollectionInterface&amp;quot;)&lt;br /&gt;
  Q_INTERFACES(QDesignerCustomWidgetCollectionInterface);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModule.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Q_SLICER_QTMODULES_SUBJECTHIERARCHY_EXPORT qSlicerSubjectHierarchyModule :&lt;br /&gt;
  public qSlicerLoadableModule&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.slicer.modules.loadable.qSlicerLoadableModule/1.0&amp;quot;);&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Q_SLICER_QTMODULES_SUBJECTHIERARCHY_EXPORT qSlicerSubjectHierarchyModule :&lt;br /&gt;
  public qSlicerLoadableModule&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.slicer.modules.loadable.qSlicerLoadableModule/1.0&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModuleWidgetsAbstractPlugin.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  #include &amp;lt;QtGlobal&amp;gt;&lt;br /&gt;
  #if(QT_VERSION &amp;lt; QT_VERSION_CHECKS(5, 0, 0))&lt;br /&gt;
  #include &amp;lt;QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
  #else&lt;br /&gt;
  #include &amp;lt;QtUiPlugin/QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
  [...]&lt;br /&gt;
&lt;br /&gt;
  class Q_SLICER_MODULE_SEGMENTATIONS_WIDGETS_PLUGINS_EXPORT qSlicerSegmentationsModuleWidgetsAbstractPlugin&lt;br /&gt;
      : public QDesignerCustomWidgetInterface&lt;br /&gt;
  {&lt;br /&gt;
  #if (QT_VERSION &amp;gt;= QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
    Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetInterface&amp;quot;)&lt;br /&gt;
  #endif&lt;br /&gt;
    Q_INTERFACES(QDesignerCustomWidgetInterface);&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  #include &amp;lt;QtUiPlugin/QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  [...]&lt;br /&gt;
&lt;br /&gt;
  class Q_SLICER_MODULE_SEGMENTATIONS_WIDGETS_PLUGINS_EXPORT qSlicerSegmentationsModuleWidgetsAbstractPlugin&lt;br /&gt;
      : public QDesignerCustomWidgetInterface&lt;br /&gt;
  {&lt;br /&gt;
    Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetInterface&amp;quot;)&lt;br /&gt;
    Q_INTERFACES(QDesignerCustomWidgetInterface);&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModule.cxx and qSlicerNAMEModuleWidgetsAbstractPlugin.cxx====&lt;br /&gt;
&lt;br /&gt;
'''Remove:'''&lt;br /&gt;
&lt;br /&gt;
  #if (QT_VERSION &amp;lt; QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
  #include &amp;lt;QtPlugin&amp;gt;&lt;br /&gt;
  Q_EXPORT_PLUGIN2(customwidgetplugin, qSlicerSegmentationsModuleWidgetsPlugin);&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
===Qt&amp;gt;=5.0.0: Simpler use of QHeaderView::setSectionResizeMode===&lt;br /&gt;
&lt;br /&gt;
This migration guide entry is obsolete: [[Documentation/Nightly/Developers/Tutorials/MigrationGuide#Qt5:_Fix_error:_.E2.80.98class_QHeaderView.E2.80.99_has_no_member_named_.E2.80.98setResizeMode.E2.80.99]]&lt;br /&gt;
&lt;br /&gt;
'''Solution for Cpp'''&lt;br /&gt;
&lt;br /&gt;
Before:&lt;br /&gt;
&lt;br /&gt;
  #if (QT_VERSION &amp;lt; QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(QHeaderView::Stretch);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
  #else&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::Stretch);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::Stretch);&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Solution for Python'''&lt;br /&gt;
&lt;br /&gt;
Before:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def _setSectionResizeMode(header, *args, **kwargs):&lt;br /&gt;
    if version.parse(qt.Qt.qVersion()) &amp;lt; version.parse(&amp;quot;5.0.0&amp;quot;):&lt;br /&gt;
      header.setResizeMode(*args, **kwargs)&lt;br /&gt;
    else:&lt;br /&gt;
      header.setSectionResizeMode(*args, **kwargs)&lt;br /&gt;
&lt;br /&gt;
    [...]&lt;br /&gt;
   &lt;br /&gt;
  _setSectionResizeMode(self.horizontalHeader(), 0, qt.QHeaderView.Stretch)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After:&lt;br /&gt;
&lt;br /&gt;
  self.horizontalHeader().setSectionResizeMode(0, qt.QHeaderView.Stretch)&lt;br /&gt;
&lt;br /&gt;
===C++11: Update source code to use nullptr===&lt;br /&gt;
&lt;br /&gt;
C++11 introduced the keyword &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt; allowing to explicitly identify a pointer of type &amp;lt;tt&amp;gt;std::nullptr_t&amp;lt;/tt&amp;gt;. It avoids ambiguous function overloads. See also https://stackoverflow.com/questions/20509734/null-vs-nullptr-why-was-it-replaced&lt;br /&gt;
&lt;br /&gt;
Prior to supporting only C++11, &amp;lt;tt&amp;gt;0&amp;lt;/tt&amp;gt; and [http://www.cplusplus.com/reference/cstring/NULL/ NULL] integral type were used to check for pointer value, and macro like &amp;lt;tt&amp;gt;Q_NULLPTR&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;ITK_NULLPTR&amp;lt;/tt&amp;gt; macros were used to ensure usage of &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt; when C++11 support was enabled.&lt;br /&gt;
&lt;br /&gt;
Updating the code base to use &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt; is a 2-step process:&lt;br /&gt;
* use clang-tidy for updating source code being explicitly compiled in the project.&lt;br /&gt;
* directly update source code not being compiled: conditionally compiled code, templated headers, comments, ...&lt;br /&gt;
&lt;br /&gt;
'''Automatic update: Using clang-tidy'''&lt;br /&gt;
&lt;br /&gt;
This will iteratively check files for updates. It takes a while. The sources are only modified at the end of the process, so you could cancel anytime before with no consequences.&lt;br /&gt;
# Compile Slicer with the CMake option -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON to generate the file compile_commands.json at configuration time.&lt;br /&gt;
# Run clang-tidy on the generated compile_commands.json (in the build folder: Slicer-build)&lt;br /&gt;
  run-clang-tidy.py -header-filter='.*' -checks='-*,modernize-use-nullptr' -fix&lt;br /&gt;
[http://clang.llvm.org/extra/clang-tidy/ clang-tidy] is a tool from clang. In Archlinux: sudo pacman -S clang, in other distros might be clang-extra-tools or similar.&lt;br /&gt;
&lt;br /&gt;
clang-tidy will substitute NULL and 0 for nullptr when appropiate. It is an iterative process, so it may take time. Also, it replaces all the compiled code, including external dependencies.&lt;br /&gt;
It is recommended to do a fresh build with the modified code, for testing it without modifications in any external repo.&lt;br /&gt;
&lt;br /&gt;
'''Direct update: Using shell script'''&lt;br /&gt;
&lt;br /&gt;
After clang-tidy has modified the compiled code with the help of compile_commands.json, there will still be ignored instances of NULL and 0 in some headers, and comments.&lt;br /&gt;
&lt;br /&gt;
Manually replace with the following regex to change those.&lt;br /&gt;
&lt;br /&gt;
1) Change NULL to nullptr except when there is a quote or an underscore in&lt;br /&gt;
front of it. And there is not a quote after.&lt;br /&gt;
&lt;br /&gt;
  ack --cpp &amp;quot;NULL&amp;quot; -l --print0 | xargs -0 -n 1 sed -i 's/\([^\&amp;quot;\_]\)NULL\([^\&amp;quot;\_]\)/\1nullptr\2/g'&lt;br /&gt;
&lt;br /&gt;
2) The same than before but match end of line NULL&lt;br /&gt;
  ack --cpp &amp;quot;NULL&amp;quot; -l --print0 | xargs -0 -n 1 sed -i 's/\([^\&amp;quot;\_]\)NULL$/\1nullptr/g'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Replace ITK_NULLPTR'''&lt;br /&gt;
&lt;br /&gt;
It was adapted from the ITK script in [https://github.com/InsightSoftwareConsortium/ITK/blob/master/Utilities/ITKv5Preparation/ReplaceITK_NULLPTRMacroNames.sh ReplaceITK_NULLPTRMacroNames.sh]&lt;br /&gt;
&lt;br /&gt;
  git grep -l &amp;quot;ITK_NULLPTR&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/ITK_NULLPTR/nullptr/g&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===C++11: Update source code to use override===&lt;br /&gt;
&lt;br /&gt;
The regexp involving ITK were extracted from the [https://github.com/InsightSoftwareConsortium/ITK/blob/master/Utilities/ITKv5Preparation/ReplaceITK_OVERRIDEMacroNames.sh ReplaceITK_OVERRIDEMacroNames.sh] script in ITK.&lt;br /&gt;
&lt;br /&gt;
  git grep -l &amp;quot;ITK_OVERRIDE&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/ITK_OVERRIDE/override/g&amp;quot;&lt;/div&gt;</summary>
		<author><name>Phcerdan</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval&amp;diff=60887</id>
		<title>Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval&amp;diff=60887"/>
		<updated>2019-03-13T15:36:36Z</updated>

		<summary type="html">&lt;p&gt;Phcerdan: /* C++11: Update source code to use nullptr */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Obsolete Code Removal==&lt;br /&gt;
&lt;br /&gt;
This section documents suggested code changes after removing support for a particular features. Each category has a short description, code snippets, a suggested upgrade path, and references to relevant commits.&lt;br /&gt;
&lt;br /&gt;
===Qt&amp;gt;=5.0.0: Remove obsolete code supporting Qt4 plugin infrastructure (C++)===&lt;br /&gt;
&lt;br /&gt;
These changes apply to Qt loadable modules and designer plugins&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModuleWidgetsPlugin.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;quot;vtkSlicerConfigure.h&amp;quot; // For Slicer_HAVE_QT5&lt;br /&gt;
&lt;br /&gt;
// Qt includes&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
#include &amp;lt;QtUiPlugin/QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
#else&lt;br /&gt;
#include &amp;lt;QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
class Q_SLICER_MODULE_SUBJECTHIERARCHY_WIDGETS_PLUGINS_EXPORT qSlicerSubjectHierarchyModuleWidgetsPlugin&lt;br /&gt;
  : public QObject&lt;br /&gt;
  , public QDesignerCustomWidgetCollectionInterface&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetCollectionInterface&amp;quot;)&lt;br /&gt;
#endif&lt;br /&gt;
  Q_INTERFACES(QDesignerCustomWidgetCollectionInterface);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Qt includes&lt;br /&gt;
#include &amp;lt;QtUiPlugin/QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
class Q_SLICER_MODULE_SUBJECTHIERARCHY_WIDGETS_PLUGINS_EXPORT qSlicerSubjectHierarchyModuleWidgetsPlugin&lt;br /&gt;
  : public QObject&lt;br /&gt;
  , public QDesignerCustomWidgetCollectionInterface&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetCollectionInterface&amp;quot;)&lt;br /&gt;
  Q_INTERFACES(QDesignerCustomWidgetCollectionInterface);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModule.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Q_SLICER_QTMODULES_SUBJECTHIERARCHY_EXPORT qSlicerSubjectHierarchyModule :&lt;br /&gt;
  public qSlicerLoadableModule&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.slicer.modules.loadable.qSlicerLoadableModule/1.0&amp;quot;);&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Q_SLICER_QTMODULES_SUBJECTHIERARCHY_EXPORT qSlicerSubjectHierarchyModule :&lt;br /&gt;
  public qSlicerLoadableModule&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.slicer.modules.loadable.qSlicerLoadableModule/1.0&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModuleWidgetsAbstractPlugin.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  #include &amp;lt;QtGlobal&amp;gt;&lt;br /&gt;
  #if(QT_VERSION &amp;lt; QT_VERSION_CHECKS(5, 0, 0))&lt;br /&gt;
  #include &amp;lt;QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
  #else&lt;br /&gt;
  #include &amp;lt;QtUiPlugin/QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
  [...]&lt;br /&gt;
&lt;br /&gt;
  class Q_SLICER_MODULE_SEGMENTATIONS_WIDGETS_PLUGINS_EXPORT qSlicerSegmentationsModuleWidgetsAbstractPlugin&lt;br /&gt;
      : public QDesignerCustomWidgetInterface&lt;br /&gt;
  {&lt;br /&gt;
  #if (QT_VERSION &amp;gt;= QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
    Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetInterface&amp;quot;)&lt;br /&gt;
  #endif&lt;br /&gt;
    Q_INTERFACES(QDesignerCustomWidgetInterface);&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  #include &amp;lt;QtUiPlugin/QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  [...]&lt;br /&gt;
&lt;br /&gt;
  class Q_SLICER_MODULE_SEGMENTATIONS_WIDGETS_PLUGINS_EXPORT qSlicerSegmentationsModuleWidgetsAbstractPlugin&lt;br /&gt;
      : public QDesignerCustomWidgetInterface&lt;br /&gt;
  {&lt;br /&gt;
    Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetInterface&amp;quot;)&lt;br /&gt;
    Q_INTERFACES(QDesignerCustomWidgetInterface);&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModule.cxx and qSlicerNAMEModuleWidgetsAbstractPlugin.cxx====&lt;br /&gt;
&lt;br /&gt;
'''Remove:'''&lt;br /&gt;
&lt;br /&gt;
  #if (QT_VERSION &amp;lt; QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
  #include &amp;lt;QtPlugin&amp;gt;&lt;br /&gt;
  Q_EXPORT_PLUGIN2(customwidgetplugin, qSlicerSegmentationsModuleWidgetsPlugin);&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
===Qt&amp;gt;=5.0.0: Simpler use of QHeaderView::setSectionResizeMode===&lt;br /&gt;
&lt;br /&gt;
This migration guide entry is obsolete: [[Documentation/Nightly/Developers/Tutorials/MigrationGuide#Qt5:_Fix_error:_.E2.80.98class_QHeaderView.E2.80.99_has_no_member_named_.E2.80.98setResizeMode.E2.80.99]]&lt;br /&gt;
&lt;br /&gt;
'''Solution for Cpp'''&lt;br /&gt;
&lt;br /&gt;
Before:&lt;br /&gt;
&lt;br /&gt;
  #if (QT_VERSION &amp;lt; QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(QHeaderView::Stretch);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
  #else&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::Stretch);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::Stretch);&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Solution for Python'''&lt;br /&gt;
&lt;br /&gt;
Before:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def _setSectionResizeMode(header, *args, **kwargs):&lt;br /&gt;
    if version.parse(qt.Qt.qVersion()) &amp;lt; version.parse(&amp;quot;5.0.0&amp;quot;):&lt;br /&gt;
      header.setResizeMode(*args, **kwargs)&lt;br /&gt;
    else:&lt;br /&gt;
      header.setSectionResizeMode(*args, **kwargs)&lt;br /&gt;
&lt;br /&gt;
    [...]&lt;br /&gt;
   &lt;br /&gt;
  _setSectionResizeMode(self.horizontalHeader(), 0, qt.QHeaderView.Stretch)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After:&lt;br /&gt;
&lt;br /&gt;
  self.horizontalHeader().setSectionResizeMode(0, qt.QHeaderView.Stretch)&lt;br /&gt;
&lt;br /&gt;
===C++11: Update source code to use nullptr===&lt;br /&gt;
&lt;br /&gt;
C++11 introduced the keyword &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt; allowing to explicitly identify a pointer of type &amp;lt;tt&amp;gt;std::nullptr_t&amp;lt;/tt&amp;gt;. It avoids ambiguous function overloads. See also https://stackoverflow.com/questions/20509734/null-vs-nullptr-why-was-it-replaced&lt;br /&gt;
&lt;br /&gt;
Prior to supporting only C++11, &amp;lt;tt&amp;gt;0&amp;lt;/tt&amp;gt; and [http://www.cplusplus.com/reference/cstring/NULL/ NULL] integral type were used to check for pointer value, and macro like &amp;lt;tt&amp;gt;Q_NULLPTR&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;ITK_NULLPTR&amp;lt;/tt&amp;gt; macros were used to ensure usage of &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt; when C++11 support was enabled.&lt;br /&gt;
&lt;br /&gt;
Updating the code base to use &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt; is a 2-step process:&lt;br /&gt;
* use clang-tidy for updating source code being explicitly compiled in the project.&lt;br /&gt;
* directly update source code not being compiled: conditionally compiled code, templated headers, comments, ...&lt;br /&gt;
&lt;br /&gt;
'''Automatic update: Using clang-tidy'''&lt;br /&gt;
&lt;br /&gt;
This will iteratively check files for updates. It takes a while. The sources are only modified at the end of the process, so you could cancel anytime before with no consequences.&lt;br /&gt;
# Compile Slicer with the CMake option -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON to generate the file compile_commands.json at configuration time.&lt;br /&gt;
# Run clang-tidy on the generated compile_commands.json (in the build folder: Slicer-build)&lt;br /&gt;
  run-clang-tidy.py -header-filter='.*' -checks='-*,modernize-use-nullptr' -fix&lt;br /&gt;
[http://clang.llvm.org/extra/clang-tidy/ clang-tidy] is a tool from clang. In Archlinux: sudo pacman -S clang, in other distros might be clang-extra-tools or similar.&lt;br /&gt;
&lt;br /&gt;
clang-tidy will substitute NULL and 0 for nullptr when appropiate. It is an iterative process, so it may take time. Also, it replaces all the compiled code, including external dependencies.&lt;br /&gt;
It is recommended to do a fresh build with the modified code, for testing it without modifications in any external repo.&lt;br /&gt;
&lt;br /&gt;
'''Direct update: Using shell script'''&lt;br /&gt;
&lt;br /&gt;
After clang-tidy has modified the compiled code with the help of compile_commands.json, there will still be ignored instances of NULL and 0 in some headers, and comments.&lt;br /&gt;
&lt;br /&gt;
Manually replace with the following regex to change those.&lt;br /&gt;
&lt;br /&gt;
1) Change NULL to nullptr except when there is a quote or an underscore in&lt;br /&gt;
front of it. And there is not a quote after.&lt;br /&gt;
&lt;br /&gt;
  ack --cpp &amp;quot;NULL&amp;quot; -l --print0 | xargs -0 -n 1 sed -i 's/\([^\&amp;quot;\_]\)NULL\([^\&amp;quot;\_]\)/\1nullptr\2/g'&lt;br /&gt;
&lt;br /&gt;
2) The same than before but match end of line NULL&lt;br /&gt;
  ack --cpp &amp;quot;NULL&amp;quot; -l --print0 | xargs -0 -n 1 sed -i 's/\([^\&amp;quot;\_]\)NULL$/\1nullptr/g'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Replace ITK_NULLPTR'''&lt;br /&gt;
&lt;br /&gt;
It was adapted from the ITK script in [https://github.com/InsightSoftwareConsortium/ITK/blob/master/Utilities/ITKv5Preparation/ReplaceITK_NULLPTRMacroNames.sh ReplaceITK_NULLPTRMacroNames.sh]&lt;br /&gt;
&lt;br /&gt;
  git grep -l &amp;quot;ITK_NULLPTR&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/ITK_NULLPTR/nullptr/g&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===C++11: Update source code to use override===&lt;br /&gt;
&lt;br /&gt;
The regexp involving ITK were extracted from the [https://github.com/InsightSoftwareConsortium/ITK/tree/master/Utilities/ITKv5Preparation Utilities/ITKv5Preparation] folder of ITK.&lt;br /&gt;
&lt;br /&gt;
  git grep -l &amp;quot;ITK_OVERRIDE&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/ITK_OVERRIDE/override/g&amp;quot;&lt;/div&gt;</summary>
		<author><name>Phcerdan</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval&amp;diff=60886</id>
		<title>Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval&amp;diff=60886"/>
		<updated>2019-03-13T15:30:37Z</updated>

		<summary type="html">&lt;p&gt;Phcerdan: /* Obsolete Code Removal */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Obsolete Code Removal==&lt;br /&gt;
&lt;br /&gt;
This section documents suggested code changes after removing support for a particular features. Each category has a short description, code snippets, a suggested upgrade path, and references to relevant commits.&lt;br /&gt;
&lt;br /&gt;
===Qt&amp;gt;=5.0.0: Remove obsolete code supporting Qt4 plugin infrastructure (C++)===&lt;br /&gt;
&lt;br /&gt;
These changes apply to Qt loadable modules and designer plugins&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModuleWidgetsPlugin.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;quot;vtkSlicerConfigure.h&amp;quot; // For Slicer_HAVE_QT5&lt;br /&gt;
&lt;br /&gt;
// Qt includes&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
#include &amp;lt;QtUiPlugin/QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
#else&lt;br /&gt;
#include &amp;lt;QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
class Q_SLICER_MODULE_SUBJECTHIERARCHY_WIDGETS_PLUGINS_EXPORT qSlicerSubjectHierarchyModuleWidgetsPlugin&lt;br /&gt;
  : public QObject&lt;br /&gt;
  , public QDesignerCustomWidgetCollectionInterface&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetCollectionInterface&amp;quot;)&lt;br /&gt;
#endif&lt;br /&gt;
  Q_INTERFACES(QDesignerCustomWidgetCollectionInterface);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Qt includes&lt;br /&gt;
#include &amp;lt;QtUiPlugin/QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
class Q_SLICER_MODULE_SUBJECTHIERARCHY_WIDGETS_PLUGINS_EXPORT qSlicerSubjectHierarchyModuleWidgetsPlugin&lt;br /&gt;
  : public QObject&lt;br /&gt;
  , public QDesignerCustomWidgetCollectionInterface&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetCollectionInterface&amp;quot;)&lt;br /&gt;
  Q_INTERFACES(QDesignerCustomWidgetCollectionInterface);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModule.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Q_SLICER_QTMODULES_SUBJECTHIERARCHY_EXPORT qSlicerSubjectHierarchyModule :&lt;br /&gt;
  public qSlicerLoadableModule&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.slicer.modules.loadable.qSlicerLoadableModule/1.0&amp;quot;);&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Q_SLICER_QTMODULES_SUBJECTHIERARCHY_EXPORT qSlicerSubjectHierarchyModule :&lt;br /&gt;
  public qSlicerLoadableModule&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.slicer.modules.loadable.qSlicerLoadableModule/1.0&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModuleWidgetsAbstractPlugin.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  #include &amp;lt;QtGlobal&amp;gt;&lt;br /&gt;
  #if(QT_VERSION &amp;lt; QT_VERSION_CHECKS(5, 0, 0))&lt;br /&gt;
  #include &amp;lt;QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
  #else&lt;br /&gt;
  #include &amp;lt;QtUiPlugin/QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
  [...]&lt;br /&gt;
&lt;br /&gt;
  class Q_SLICER_MODULE_SEGMENTATIONS_WIDGETS_PLUGINS_EXPORT qSlicerSegmentationsModuleWidgetsAbstractPlugin&lt;br /&gt;
      : public QDesignerCustomWidgetInterface&lt;br /&gt;
  {&lt;br /&gt;
  #if (QT_VERSION &amp;gt;= QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
    Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetInterface&amp;quot;)&lt;br /&gt;
  #endif&lt;br /&gt;
    Q_INTERFACES(QDesignerCustomWidgetInterface);&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  #include &amp;lt;QtUiPlugin/QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  [...]&lt;br /&gt;
&lt;br /&gt;
  class Q_SLICER_MODULE_SEGMENTATIONS_WIDGETS_PLUGINS_EXPORT qSlicerSegmentationsModuleWidgetsAbstractPlugin&lt;br /&gt;
      : public QDesignerCustomWidgetInterface&lt;br /&gt;
  {&lt;br /&gt;
    Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetInterface&amp;quot;)&lt;br /&gt;
    Q_INTERFACES(QDesignerCustomWidgetInterface);&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModule.cxx and qSlicerNAMEModuleWidgetsAbstractPlugin.cxx====&lt;br /&gt;
&lt;br /&gt;
'''Remove:'''&lt;br /&gt;
&lt;br /&gt;
  #if (QT_VERSION &amp;lt; QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
  #include &amp;lt;QtPlugin&amp;gt;&lt;br /&gt;
  Q_EXPORT_PLUGIN2(customwidgetplugin, qSlicerSegmentationsModuleWidgetsPlugin);&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
===Qt&amp;gt;=5.0.0: Simpler use of QHeaderView::setSectionResizeMode===&lt;br /&gt;
&lt;br /&gt;
This migration guide entry is obsolete: [[Documentation/Nightly/Developers/Tutorials/MigrationGuide#Qt5:_Fix_error:_.E2.80.98class_QHeaderView.E2.80.99_has_no_member_named_.E2.80.98setResizeMode.E2.80.99]]&lt;br /&gt;
&lt;br /&gt;
'''Solution for Cpp'''&lt;br /&gt;
&lt;br /&gt;
Before:&lt;br /&gt;
&lt;br /&gt;
  #if (QT_VERSION &amp;lt; QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(QHeaderView::Stretch);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
  #else&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::Stretch);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::Stretch);&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Solution for Python'''&lt;br /&gt;
&lt;br /&gt;
Before:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def _setSectionResizeMode(header, *args, **kwargs):&lt;br /&gt;
    if version.parse(qt.Qt.qVersion()) &amp;lt; version.parse(&amp;quot;5.0.0&amp;quot;):&lt;br /&gt;
      header.setResizeMode(*args, **kwargs)&lt;br /&gt;
    else:&lt;br /&gt;
      header.setSectionResizeMode(*args, **kwargs)&lt;br /&gt;
&lt;br /&gt;
    [...]&lt;br /&gt;
   &lt;br /&gt;
  _setSectionResizeMode(self.horizontalHeader(), 0, qt.QHeaderView.Stretch)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After:&lt;br /&gt;
&lt;br /&gt;
  self.horizontalHeader().setSectionResizeMode(0, qt.QHeaderView.Stretch)&lt;br /&gt;
&lt;br /&gt;
===C++11: Update source code to use nullptr===&lt;br /&gt;
&lt;br /&gt;
C++11 introduced the keyword &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt; allowing to explicitly identify a pointer of type &amp;lt;tt&amp;gt;std::nullptr_t&amp;lt;/tt&amp;gt;. It avoids ambiguous function overloads. See also https://stackoverflow.com/questions/20509734/null-vs-nullptr-why-was-it-replaced&lt;br /&gt;
&lt;br /&gt;
Prior to supporting only C++11, &amp;lt;tt&amp;gt;0&amp;lt;/tt&amp;gt; and [http://www.cplusplus.com/reference/cstring/NULL/ NULL] integral type were used to check for pointer value, and macro like &amp;lt;tt&amp;gt;Q_NULLPTR&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;ITK_NULLPTR&amp;lt;/tt&amp;gt; macros were used to ensure usage of &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt; when C++11 support was enabled.&lt;br /&gt;
&lt;br /&gt;
Updating the code base to use &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt; is a 2-step process:&lt;br /&gt;
* use clang-tidy for updating source code being explicitly compiled in the project.&lt;br /&gt;
* directly update source code not being compiled: conditionally compiled code, templated headers, comments, ...&lt;br /&gt;
&lt;br /&gt;
'''Automatic update: Using clang-tidy'''&lt;br /&gt;
&lt;br /&gt;
This will iteratively check files for updates. It takes a while. The sources are only modified at the end of the process, so you could cancel anytime before with no consequences.&lt;br /&gt;
# Compile Slicer with the CMake option -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON to generate the file compile_commands.json at configuration time.&lt;br /&gt;
# Run clang-tidy on the generated compile_commands.json (in the build folder: Slicer-build)&lt;br /&gt;
  run-clang-tidy.py -header-filter='.*' -checks='-*,modernize-use-nullptr' -fix&lt;br /&gt;
[http://clang.llvm.org/extra/clang-tidy/ clang-tidy] is a tool from clang. In Archlinux: sudo pacman -S clang, in other distros might be clang-extra-tools or similar.&lt;br /&gt;
&lt;br /&gt;
clang-tidy will substitute NULL and 0 for nullptr when appropiate. It is an iterative process, so it may take time. Also, it replaces all the compiled code, including external dependencies.&lt;br /&gt;
It is recommended to do a fresh build with the modified code, for testing it without modifications in any external repo.&lt;br /&gt;
&lt;br /&gt;
'''Direct update: Using shell script'''&lt;br /&gt;
&lt;br /&gt;
After clang-tidy has modified the compiled code with the help of compile_commands.json, there will still be ignored instances of NULL and 0 in some headers, and comments.&lt;br /&gt;
&lt;br /&gt;
Manually replace with the following regex to change those.&lt;br /&gt;
&lt;br /&gt;
1) Change NULL to nullptr except when there is a quote or an underscore in&lt;br /&gt;
front of it. And there is not a quote after.&lt;br /&gt;
&lt;br /&gt;
  ack --cpp &amp;quot;NULL&amp;quot; -l --print0 | xargs -0 -n 1 sed -i 's/\([^\&amp;quot;\_]\)NULL\([^\&amp;quot;\_]\)/\1nullptr\2/g'&lt;br /&gt;
&lt;br /&gt;
2) The same than before but match end of line NULL&lt;br /&gt;
  ack --cpp &amp;quot;NULL&amp;quot; -l --print0 | xargs -0 -n 1 sed -i 's/\([^\&amp;quot;\_]\)NULL$/\1nullptr/g'&lt;br /&gt;
&lt;br /&gt;
===C++11: Update source code to use override===&lt;br /&gt;
&lt;br /&gt;
The regexp involving ITK were extracted from the [https://github.com/InsightSoftwareConsortium/ITK/tree/master/Utilities/ITKv5Preparation Utilities/ITKv5Preparation] folder of ITK.&lt;br /&gt;
&lt;br /&gt;
  git grep -l &amp;quot;ITK_OVERRIDE&amp;quot; | fgrep -v CMakeLists.txt |fgrep -v .cmake | xargs sed -i '' -e &amp;quot;s/ITK_OVERRIDE/override/g&amp;quot;&lt;/div&gt;</summary>
		<author><name>Phcerdan</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval&amp;diff=60881</id>
		<title>Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval&amp;diff=60881"/>
		<updated>2019-03-12T20:41:35Z</updated>

		<summary type="html">&lt;p&gt;Phcerdan: /* C++11: Replace NULL and 0 for nullptr */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Obsolete Code Removal==&lt;br /&gt;
&lt;br /&gt;
This section documents suggested code changes after removing support for a particular features. Each category has a short description, code snippets, a suggested upgrade path, and references to relevant commits.&lt;br /&gt;
&lt;br /&gt;
===Qt&amp;gt;=5.0.0: Remove obsolete code supporting Qt4 plugin infrastructure (C++)===&lt;br /&gt;
&lt;br /&gt;
These changes apply to Qt loadable modules and designer plugins&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModuleWidgetsPlugin.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;quot;vtkSlicerConfigure.h&amp;quot; // For Slicer_HAVE_QT5&lt;br /&gt;
&lt;br /&gt;
// Qt includes&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
#include &amp;lt;QtUiPlugin/QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
#else&lt;br /&gt;
#include &amp;lt;QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
class Q_SLICER_MODULE_SUBJECTHIERARCHY_WIDGETS_PLUGINS_EXPORT qSlicerSubjectHierarchyModuleWidgetsPlugin&lt;br /&gt;
  : public QObject&lt;br /&gt;
  , public QDesignerCustomWidgetCollectionInterface&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetCollectionInterface&amp;quot;)&lt;br /&gt;
#endif&lt;br /&gt;
  Q_INTERFACES(QDesignerCustomWidgetCollectionInterface);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Qt includes&lt;br /&gt;
#include &amp;lt;QtUiPlugin/QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
class Q_SLICER_MODULE_SUBJECTHIERARCHY_WIDGETS_PLUGINS_EXPORT qSlicerSubjectHierarchyModuleWidgetsPlugin&lt;br /&gt;
  : public QObject&lt;br /&gt;
  , public QDesignerCustomWidgetCollectionInterface&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetCollectionInterface&amp;quot;)&lt;br /&gt;
  Q_INTERFACES(QDesignerCustomWidgetCollectionInterface);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModule.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Q_SLICER_QTMODULES_SUBJECTHIERARCHY_EXPORT qSlicerSubjectHierarchyModule :&lt;br /&gt;
  public qSlicerLoadableModule&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.slicer.modules.loadable.qSlicerLoadableModule/1.0&amp;quot;);&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Q_SLICER_QTMODULES_SUBJECTHIERARCHY_EXPORT qSlicerSubjectHierarchyModule :&lt;br /&gt;
  public qSlicerLoadableModule&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.slicer.modules.loadable.qSlicerLoadableModule/1.0&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModuleWidgetsAbstractPlugin.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  #include &amp;lt;QtGlobal&amp;gt;&lt;br /&gt;
  #if(QT_VERSION &amp;lt; QT_VERSION_CHECKS(5, 0, 0))&lt;br /&gt;
  #include &amp;lt;QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
  #else&lt;br /&gt;
  #include &amp;lt;QtUiPlugin/QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
  [...]&lt;br /&gt;
&lt;br /&gt;
  class Q_SLICER_MODULE_SEGMENTATIONS_WIDGETS_PLUGINS_EXPORT qSlicerSegmentationsModuleWidgetsAbstractPlugin&lt;br /&gt;
      : public QDesignerCustomWidgetInterface&lt;br /&gt;
  {&lt;br /&gt;
  #if (QT_VERSION &amp;gt;= QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
    Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetInterface&amp;quot;)&lt;br /&gt;
  #endif&lt;br /&gt;
    Q_INTERFACES(QDesignerCustomWidgetInterface);&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  #include &amp;lt;QtUiPlugin/QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  [...]&lt;br /&gt;
&lt;br /&gt;
  class Q_SLICER_MODULE_SEGMENTATIONS_WIDGETS_PLUGINS_EXPORT qSlicerSegmentationsModuleWidgetsAbstractPlugin&lt;br /&gt;
      : public QDesignerCustomWidgetInterface&lt;br /&gt;
  {&lt;br /&gt;
    Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetInterface&amp;quot;)&lt;br /&gt;
    Q_INTERFACES(QDesignerCustomWidgetInterface);&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModule.cxx and qSlicerNAMEModuleWidgetsAbstractPlugin.cxx====&lt;br /&gt;
&lt;br /&gt;
'''Remove:'''&lt;br /&gt;
&lt;br /&gt;
  #if (QT_VERSION &amp;lt; QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
  #include &amp;lt;QtPlugin&amp;gt;&lt;br /&gt;
  Q_EXPORT_PLUGIN2(customwidgetplugin, qSlicerSegmentationsModuleWidgetsPlugin);&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
===Qt&amp;gt;=5.0.0: Simpler use of QHeaderView::setSectionResizeMode===&lt;br /&gt;
&lt;br /&gt;
This migration guide entry is obsolete: [[Documentation/Nightly/Developers/Tutorials/MigrationGuide#Qt5:_Fix_error:_.E2.80.98class_QHeaderView.E2.80.99_has_no_member_named_.E2.80.98setResizeMode.E2.80.99]]&lt;br /&gt;
&lt;br /&gt;
'''Solution for Cpp'''&lt;br /&gt;
&lt;br /&gt;
Before:&lt;br /&gt;
&lt;br /&gt;
  #if (QT_VERSION &amp;lt; QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(QHeaderView::Stretch);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
  #else&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::Stretch);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::Stretch);&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Solution for Python'''&lt;br /&gt;
&lt;br /&gt;
Before:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def _setSectionResizeMode(header, *args, **kwargs):&lt;br /&gt;
    if version.parse(qt.Qt.qVersion()) &amp;lt; version.parse(&amp;quot;5.0.0&amp;quot;):&lt;br /&gt;
      header.setResizeMode(*args, **kwargs)&lt;br /&gt;
    else:&lt;br /&gt;
      header.setSectionResizeMode(*args, **kwargs)&lt;br /&gt;
&lt;br /&gt;
    [...]&lt;br /&gt;
   &lt;br /&gt;
  _setSectionResizeMode(self.horizontalHeader(), 0, qt.QHeaderView.Stretch)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After:&lt;br /&gt;
&lt;br /&gt;
  self.horizontalHeader().setSectionResizeMode(0, qt.QHeaderView.Stretch)&lt;br /&gt;
&lt;br /&gt;
===C++11: Replace NULL and 0 for nullptr===&lt;br /&gt;
&lt;br /&gt;
C++11 introduced the keyword &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt; allowing to explicitly identify a pointer of type &amp;lt;tt&amp;gt;std::nullptr_t&amp;lt;/tt&amp;gt;. It avoids ambiguous function overloads. See also https://stackoverflow.com/questions/20509734/null-vs-nullptr-why-was-it-replaced&lt;br /&gt;
&lt;br /&gt;
Prior to supporting only C++11, &amp;lt;tt&amp;gt;0&amp;lt;/tt&amp;gt; and [http://www.cplusplus.com/reference/cstring/NULL/ NULL] integral type were used to check for pointer value, and macro like &amp;lt;tt&amp;gt;Q_NULLPTR&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;ITK_NULLPTR&amp;lt;/tt&amp;gt; macros were used to ensure usage of &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt; when C++11 support was enabled.&lt;br /&gt;
&lt;br /&gt;
Updating the code base to use &amp;lt;tt&amp;gt;nullptr&amp;lt;/tt&amp;gt; is a 2-step process:&lt;br /&gt;
* use clang-tidy for updating source code being explicitly compiled in the project.&lt;br /&gt;
* directly update source code not being compiled: conditionally compiled code, templated headers, comments, ...&lt;br /&gt;
&lt;br /&gt;
'''Automatic update: Using clang-tidy'''&lt;br /&gt;
&lt;br /&gt;
This will iteratively check files for updates. It takes a while. The sources are only modified at the end of the process, so you could cancel anytime before with no consequences.&lt;br /&gt;
# Compile Slicer with the CMake option -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON to generate the file compile_commands.json at configuration time.&lt;br /&gt;
# Run clang-tidy on the generated compile_commands.json (in the build folder: Slicer-build)&lt;br /&gt;
  run-clang-tidy.py -header-filter='.*' -checks='-*,modernize-use-nullptr' -fix&lt;br /&gt;
[http://clang.llvm.org/extra/clang-tidy/ clang-tidy] is a tool from clang. In Archlinux: sudo pacman -S clang, in other distros might be clang-extra-tools or similar.&lt;br /&gt;
&lt;br /&gt;
clang-tidy will substitute NULL and 0 for nullptr when appropiate. It is an iterative process, so it may take time. Also, it replaces all the compiled code, including external dependencies.&lt;br /&gt;
It is recommended to do a fresh build with the modified code, for testing it without modifications in any external repo.&lt;br /&gt;
&lt;br /&gt;
'''Direct update: Using shell script'''&lt;br /&gt;
&lt;br /&gt;
After clang-tidy has modified the compiled code with the help of compile_commands.json, there will still be ignored instances of NULL and 0 in some headers, and comments.&lt;br /&gt;
&lt;br /&gt;
Manually replace with the following regex to change those.&lt;br /&gt;
&lt;br /&gt;
1) Change NULL to nullptr except when there is a quote or an underscore in&lt;br /&gt;
front of it. And there is not a quote after.&lt;br /&gt;
&lt;br /&gt;
  ack --cpp &amp;quot;NULL&amp;quot; -l --print0 | xargs -0 -n 1 sed -i 's/\([^\&amp;quot;\_]\)NULL\([^\&amp;quot;\_]\)/\1nullptr\2/g'&lt;br /&gt;
&lt;br /&gt;
2) The same than before but match end of line NULL&lt;br /&gt;
  ack --cpp &amp;quot;NULL&amp;quot; -l --print0 | xargs -0 -n 1 sed -i 's/\([^\&amp;quot;\_]\)NULL$/\1nullptr/g'&lt;/div&gt;</summary>
		<author><name>Phcerdan</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval&amp;diff=60876</id>
		<title>Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval&amp;diff=60876"/>
		<updated>2019-03-12T09:05:59Z</updated>

		<summary type="html">&lt;p&gt;Phcerdan: /* Manual */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Obsolete Code Removal==&lt;br /&gt;
&lt;br /&gt;
This section documents suggested code changes after removing support for a particular features. Each category has a short description, code snippets, a suggested upgrade path, and references to relevant commits.&lt;br /&gt;
&lt;br /&gt;
===Qt&amp;gt;=5.0.0: Remove obsolete code supporting Qt4 plugin infrastructure (C++)===&lt;br /&gt;
&lt;br /&gt;
These changes apply to Qt loadable modules and designer plugins&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModuleWidgetsPlugin.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;quot;vtkSlicerConfigure.h&amp;quot; // For Slicer_HAVE_QT5&lt;br /&gt;
&lt;br /&gt;
// Qt includes&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
#include &amp;lt;QtUiPlugin/QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
#else&lt;br /&gt;
#include &amp;lt;QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
class Q_SLICER_MODULE_SUBJECTHIERARCHY_WIDGETS_PLUGINS_EXPORT qSlicerSubjectHierarchyModuleWidgetsPlugin&lt;br /&gt;
  : public QObject&lt;br /&gt;
  , public QDesignerCustomWidgetCollectionInterface&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetCollectionInterface&amp;quot;)&lt;br /&gt;
#endif&lt;br /&gt;
  Q_INTERFACES(QDesignerCustomWidgetCollectionInterface);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Qt includes&lt;br /&gt;
#include &amp;lt;QtUiPlugin/QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
class Q_SLICER_MODULE_SUBJECTHIERARCHY_WIDGETS_PLUGINS_EXPORT qSlicerSubjectHierarchyModuleWidgetsPlugin&lt;br /&gt;
  : public QObject&lt;br /&gt;
  , public QDesignerCustomWidgetCollectionInterface&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetCollectionInterface&amp;quot;)&lt;br /&gt;
  Q_INTERFACES(QDesignerCustomWidgetCollectionInterface);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModule.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Q_SLICER_QTMODULES_SUBJECTHIERARCHY_EXPORT qSlicerSubjectHierarchyModule :&lt;br /&gt;
  public qSlicerLoadableModule&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.slicer.modules.loadable.qSlicerLoadableModule/1.0&amp;quot;);&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Q_SLICER_QTMODULES_SUBJECTHIERARCHY_EXPORT qSlicerSubjectHierarchyModule :&lt;br /&gt;
  public qSlicerLoadableModule&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.slicer.modules.loadable.qSlicerLoadableModule/1.0&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModuleWidgetsAbstractPlugin.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  #include &amp;lt;QtGlobal&amp;gt;&lt;br /&gt;
  #if(QT_VERSION &amp;lt; QT_VERSION_CHECKS(5, 0, 0))&lt;br /&gt;
  #include &amp;lt;QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
  #else&lt;br /&gt;
  #include &amp;lt;QtUiPlugin/QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
  [...]&lt;br /&gt;
&lt;br /&gt;
  class Q_SLICER_MODULE_SEGMENTATIONS_WIDGETS_PLUGINS_EXPORT qSlicerSegmentationsModuleWidgetsAbstractPlugin&lt;br /&gt;
      : public QDesignerCustomWidgetInterface&lt;br /&gt;
  {&lt;br /&gt;
  #if (QT_VERSION &amp;gt;= QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
    Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetInterface&amp;quot;)&lt;br /&gt;
  #endif&lt;br /&gt;
    Q_INTERFACES(QDesignerCustomWidgetInterface);&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  #include &amp;lt;QtUiPlugin/QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  [...]&lt;br /&gt;
&lt;br /&gt;
  class Q_SLICER_MODULE_SEGMENTATIONS_WIDGETS_PLUGINS_EXPORT qSlicerSegmentationsModuleWidgetsAbstractPlugin&lt;br /&gt;
      : public QDesignerCustomWidgetInterface&lt;br /&gt;
  {&lt;br /&gt;
    Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetInterface&amp;quot;)&lt;br /&gt;
    Q_INTERFACES(QDesignerCustomWidgetInterface);&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModule.cxx and qSlicerNAMEModuleWidgetsAbstractPlugin.cxx====&lt;br /&gt;
&lt;br /&gt;
'''Remove:'''&lt;br /&gt;
&lt;br /&gt;
  #if (QT_VERSION &amp;lt; QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
  #include &amp;lt;QtPlugin&amp;gt;&lt;br /&gt;
  Q_EXPORT_PLUGIN2(customwidgetplugin, qSlicerSegmentationsModuleWidgetsPlugin);&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
===Qt&amp;gt;=5.0.0: Simpler use of QHeaderView::setSectionResizeMode===&lt;br /&gt;
&lt;br /&gt;
This migration guide entry is obsolete: [[Documentation/Nightly/Developers/Tutorials/MigrationGuide#Qt5:_Fix_error:_.E2.80.98class_QHeaderView.E2.80.99_has_no_member_named_.E2.80.98setResizeMode.E2.80.99]]&lt;br /&gt;
&lt;br /&gt;
'''Solution for Cpp'''&lt;br /&gt;
&lt;br /&gt;
Before:&lt;br /&gt;
&lt;br /&gt;
  #if (QT_VERSION &amp;lt; QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(QHeaderView::Stretch);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
  #else&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::Stretch);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::Stretch);&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Solution for Python'''&lt;br /&gt;
&lt;br /&gt;
Before:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def _setSectionResizeMode(header, *args, **kwargs):&lt;br /&gt;
    if version.parse(qt.Qt.qVersion()) &amp;lt; version.parse(&amp;quot;5.0.0&amp;quot;):&lt;br /&gt;
      header.setResizeMode(*args, **kwargs)&lt;br /&gt;
    else:&lt;br /&gt;
      header.setSectionResizeMode(*args, **kwargs)&lt;br /&gt;
&lt;br /&gt;
    [...]&lt;br /&gt;
   &lt;br /&gt;
  _setSectionResizeMode(self.horizontalHeader(), 0, qt.QHeaderView.Stretch)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After:&lt;br /&gt;
&lt;br /&gt;
  self.horizontalHeader().setSectionResizeMode(0, qt.QHeaderView.Stretch)&lt;br /&gt;
&lt;br /&gt;
===Replace NULL and 0 for nullptr (C++11)===&lt;br /&gt;
&lt;br /&gt;
Two steps, first use clang-tidy for replacing in all the compiled code.&lt;br /&gt;
Then, do a manual replace for code not compiled (templated headers, comments, ...)&lt;br /&gt;
&lt;br /&gt;
====Automatically: Steps to run clang-tidy====&lt;br /&gt;
&lt;br /&gt;
This will iteratively check files for updates. It takes a while. The sources are only modified at the end of the process, so you could cancel anytime before with no consequences.&lt;br /&gt;
# Compile Slicer with the CMake option -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON to generate the file compile_commands.json at configuration time.&lt;br /&gt;
# Run clang-tidy on the generated compile_commands.json (in the build folder: Slicer-build)&lt;br /&gt;
  run-clang-tidy.py -header-filter='.*' -checks='-*,modernize-use-nullptr' -fix&lt;br /&gt;
[http://clang.llvm.org/extra/clang-tidy/ clang-tidy] is a tool from clang. In Archlinux: sudo pacman -S clang, in other distros might be clang-extra-tools or similar.&lt;br /&gt;
&lt;br /&gt;
clang-tidy will substitute NULL and 0 for nullptr when appropiate. It is an iterative process, so it may take time. Also, it replaces all the compiled code, including external dependencies.&lt;br /&gt;
It is recommended to do a fresh build with the modified code, for testing it without modifications in any external repo.&lt;br /&gt;
&lt;br /&gt;
====Manual====&lt;br /&gt;
&lt;br /&gt;
After clang-tidy has modified the compiled code with the help of compile_commands.json, there will still be ignored instances of NULL and 0 in some headers, and comments.&lt;br /&gt;
&lt;br /&gt;
Manually replace with the following regex to change those.&lt;br /&gt;
&lt;br /&gt;
1) Change NULL to nullptr except when there is a quote or an underscore in&lt;br /&gt;
front of it. And there is not a quote after.&lt;br /&gt;
&lt;br /&gt;
  ack --cpp &amp;quot;NULL&amp;quot; -l --print0 | xargs -0 -n 1 sed -i 's/\([^\&amp;quot;\_]\)NULL\([^\&amp;quot;]\)/\1nullptr\2/g'&lt;br /&gt;
&lt;br /&gt;
2) The same than before but match end of line NULL&lt;br /&gt;
  ack --cpp &amp;quot;NULL&amp;quot; -l --print0 | xargs -0 -n 1 sed -i 's/\([^\&amp;quot;\_]\)NULL$/\1nullptr/g'&lt;/div&gt;</summary>
		<author><name>Phcerdan</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval&amp;diff=60875</id>
		<title>Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval&amp;diff=60875"/>
		<updated>2019-03-12T09:02:49Z</updated>

		<summary type="html">&lt;p&gt;Phcerdan: /* Automatically: Steps to run clang-tidy */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Obsolete Code Removal==&lt;br /&gt;
&lt;br /&gt;
This section documents suggested code changes after removing support for a particular features. Each category has a short description, code snippets, a suggested upgrade path, and references to relevant commits.&lt;br /&gt;
&lt;br /&gt;
===Qt&amp;gt;=5.0.0: Remove obsolete code supporting Qt4 plugin infrastructure (C++)===&lt;br /&gt;
&lt;br /&gt;
These changes apply to Qt loadable modules and designer plugins&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModuleWidgetsPlugin.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;quot;vtkSlicerConfigure.h&amp;quot; // For Slicer_HAVE_QT5&lt;br /&gt;
&lt;br /&gt;
// Qt includes&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
#include &amp;lt;QtUiPlugin/QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
#else&lt;br /&gt;
#include &amp;lt;QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
class Q_SLICER_MODULE_SUBJECTHIERARCHY_WIDGETS_PLUGINS_EXPORT qSlicerSubjectHierarchyModuleWidgetsPlugin&lt;br /&gt;
  : public QObject&lt;br /&gt;
  , public QDesignerCustomWidgetCollectionInterface&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetCollectionInterface&amp;quot;)&lt;br /&gt;
#endif&lt;br /&gt;
  Q_INTERFACES(QDesignerCustomWidgetCollectionInterface);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Qt includes&lt;br /&gt;
#include &amp;lt;QtUiPlugin/QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
class Q_SLICER_MODULE_SUBJECTHIERARCHY_WIDGETS_PLUGINS_EXPORT qSlicerSubjectHierarchyModuleWidgetsPlugin&lt;br /&gt;
  : public QObject&lt;br /&gt;
  , public QDesignerCustomWidgetCollectionInterface&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetCollectionInterface&amp;quot;)&lt;br /&gt;
  Q_INTERFACES(QDesignerCustomWidgetCollectionInterface);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModule.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Q_SLICER_QTMODULES_SUBJECTHIERARCHY_EXPORT qSlicerSubjectHierarchyModule :&lt;br /&gt;
  public qSlicerLoadableModule&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.slicer.modules.loadable.qSlicerLoadableModule/1.0&amp;quot;);&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Q_SLICER_QTMODULES_SUBJECTHIERARCHY_EXPORT qSlicerSubjectHierarchyModule :&lt;br /&gt;
  public qSlicerLoadableModule&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.slicer.modules.loadable.qSlicerLoadableModule/1.0&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModuleWidgetsAbstractPlugin.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  #include &amp;lt;QtGlobal&amp;gt;&lt;br /&gt;
  #if(QT_VERSION &amp;lt; QT_VERSION_CHECKS(5, 0, 0))&lt;br /&gt;
  #include &amp;lt;QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
  #else&lt;br /&gt;
  #include &amp;lt;QtUiPlugin/QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
  [...]&lt;br /&gt;
&lt;br /&gt;
  class Q_SLICER_MODULE_SEGMENTATIONS_WIDGETS_PLUGINS_EXPORT qSlicerSegmentationsModuleWidgetsAbstractPlugin&lt;br /&gt;
      : public QDesignerCustomWidgetInterface&lt;br /&gt;
  {&lt;br /&gt;
  #if (QT_VERSION &amp;gt;= QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
    Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetInterface&amp;quot;)&lt;br /&gt;
  #endif&lt;br /&gt;
    Q_INTERFACES(QDesignerCustomWidgetInterface);&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  #include &amp;lt;QtUiPlugin/QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  [...]&lt;br /&gt;
&lt;br /&gt;
  class Q_SLICER_MODULE_SEGMENTATIONS_WIDGETS_PLUGINS_EXPORT qSlicerSegmentationsModuleWidgetsAbstractPlugin&lt;br /&gt;
      : public QDesignerCustomWidgetInterface&lt;br /&gt;
  {&lt;br /&gt;
    Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetInterface&amp;quot;)&lt;br /&gt;
    Q_INTERFACES(QDesignerCustomWidgetInterface);&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModule.cxx and qSlicerNAMEModuleWidgetsAbstractPlugin.cxx====&lt;br /&gt;
&lt;br /&gt;
'''Remove:'''&lt;br /&gt;
&lt;br /&gt;
  #if (QT_VERSION &amp;lt; QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
  #include &amp;lt;QtPlugin&amp;gt;&lt;br /&gt;
  Q_EXPORT_PLUGIN2(customwidgetplugin, qSlicerSegmentationsModuleWidgetsPlugin);&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
===Qt&amp;gt;=5.0.0: Simpler use of QHeaderView::setSectionResizeMode===&lt;br /&gt;
&lt;br /&gt;
This migration guide entry is obsolete: [[Documentation/Nightly/Developers/Tutorials/MigrationGuide#Qt5:_Fix_error:_.E2.80.98class_QHeaderView.E2.80.99_has_no_member_named_.E2.80.98setResizeMode.E2.80.99]]&lt;br /&gt;
&lt;br /&gt;
'''Solution for Cpp'''&lt;br /&gt;
&lt;br /&gt;
Before:&lt;br /&gt;
&lt;br /&gt;
  #if (QT_VERSION &amp;lt; QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(QHeaderView::Stretch);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
  #else&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::Stretch);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::Stretch);&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Solution for Python'''&lt;br /&gt;
&lt;br /&gt;
Before:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def _setSectionResizeMode(header, *args, **kwargs):&lt;br /&gt;
    if version.parse(qt.Qt.qVersion()) &amp;lt; version.parse(&amp;quot;5.0.0&amp;quot;):&lt;br /&gt;
      header.setResizeMode(*args, **kwargs)&lt;br /&gt;
    else:&lt;br /&gt;
      header.setSectionResizeMode(*args, **kwargs)&lt;br /&gt;
&lt;br /&gt;
    [...]&lt;br /&gt;
   &lt;br /&gt;
  _setSectionResizeMode(self.horizontalHeader(), 0, qt.QHeaderView.Stretch)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After:&lt;br /&gt;
&lt;br /&gt;
  self.horizontalHeader().setSectionResizeMode(0, qt.QHeaderView.Stretch)&lt;br /&gt;
&lt;br /&gt;
===Replace NULL and 0 for nullptr (C++11)===&lt;br /&gt;
&lt;br /&gt;
Two steps, first use clang-tidy for replacing in all the compiled code.&lt;br /&gt;
Then, do a manual replace for code not compiled (templated headers, comments, ...)&lt;br /&gt;
&lt;br /&gt;
====Automatically: Steps to run clang-tidy====&lt;br /&gt;
&lt;br /&gt;
This will iteratively check files for updates. It takes a while. The sources are only modified at the end of the process, so you could cancel anytime before with no consequences.&lt;br /&gt;
# Compile Slicer with the CMake option -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON to generate the file compile_commands.json at configuration time.&lt;br /&gt;
# Run clang-tidy on the generated compile_commands.json (in the build folder: Slicer-build)&lt;br /&gt;
  run-clang-tidy.py -header-filter='.*' -checks='-*,modernize-use-nullptr' -fix&lt;br /&gt;
[http://clang.llvm.org/extra/clang-tidy/ clang-tidy] is a tool from clang. In Archlinux: sudo pacman -S clang, in other distros might be clang-extra-tools or similar.&lt;br /&gt;
&lt;br /&gt;
clang-tidy will substitute NULL and 0 for nullptr when appropiate. It is an iterative process, so it may take time. Also, it replaces all the compiled code, including external dependencies.&lt;br /&gt;
It is recommended to do a fresh build with the modified code, for testing it without modifications in any external repo.&lt;br /&gt;
&lt;br /&gt;
====Manual====&lt;br /&gt;
&lt;br /&gt;
After clang-tidy has modified the compiled code with the help of compile_commands.json, there will still be ignored instances of NULL and 0 in some headers, and comments.&lt;br /&gt;
&lt;br /&gt;
Manually replace with the following regex to change those.&lt;br /&gt;
&lt;br /&gt;
1) Change NULL to nullptr except when there is a quote or an underscore in&lt;br /&gt;
front of it. And there is not a quote after.&lt;br /&gt;
&lt;br /&gt;
  ack &amp;quot;NULL&amp;quot; -l --print0 | xargs -0 -n 1 sed -i 's/\([^\&amp;quot;\_]\)NULL\([^\&amp;quot;]\)/\1nullptr\2/g'&lt;br /&gt;
&lt;br /&gt;
2) The same than before but match end of line NULL&lt;br /&gt;
  ack &amp;quot;NULL&amp;quot; -l --print0 | xargs -0 -n 1 sed -i 's/\([^\&amp;quot;\_]\)NULL$/\1nullptr/g'&lt;/div&gt;</summary>
		<author><name>Phcerdan</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval&amp;diff=60874</id>
		<title>Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/ObsoleteCodeRemoval&amp;diff=60874"/>
		<updated>2019-03-11T15:38:52Z</updated>

		<summary type="html">&lt;p&gt;Phcerdan: /* Obsolete Code Removal */  NULL and 0 to nullptr&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Obsolete Code Removal==&lt;br /&gt;
&lt;br /&gt;
This section documents suggested code changes after removing support for a particular features. Each category has a short description, code snippets, a suggested upgrade path, and references to relevant commits.&lt;br /&gt;
&lt;br /&gt;
===Qt&amp;gt;=5.0.0: Remove obsolete code supporting Qt4 plugin infrastructure (C++)===&lt;br /&gt;
&lt;br /&gt;
These changes apply to Qt loadable modules and designer plugins&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModuleWidgetsPlugin.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;quot;vtkSlicerConfigure.h&amp;quot; // For Slicer_HAVE_QT5&lt;br /&gt;
&lt;br /&gt;
// Qt includes&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
#include &amp;lt;QtUiPlugin/QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
#else&lt;br /&gt;
#include &amp;lt;QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
class Q_SLICER_MODULE_SUBJECTHIERARCHY_WIDGETS_PLUGINS_EXPORT qSlicerSubjectHierarchyModuleWidgetsPlugin&lt;br /&gt;
  : public QObject&lt;br /&gt;
  , public QDesignerCustomWidgetCollectionInterface&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetCollectionInterface&amp;quot;)&lt;br /&gt;
#endif&lt;br /&gt;
  Q_INTERFACES(QDesignerCustomWidgetCollectionInterface);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Qt includes&lt;br /&gt;
#include &amp;lt;QtUiPlugin/QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
class Q_SLICER_MODULE_SUBJECTHIERARCHY_WIDGETS_PLUGINS_EXPORT qSlicerSubjectHierarchyModuleWidgetsPlugin&lt;br /&gt;
  : public QObject&lt;br /&gt;
  , public QDesignerCustomWidgetCollectionInterface&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetCollectionInterface&amp;quot;)&lt;br /&gt;
  Q_INTERFACES(QDesignerCustomWidgetCollectionInterface);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModule.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Q_SLICER_QTMODULES_SUBJECTHIERARCHY_EXPORT qSlicerSubjectHierarchyModule :&lt;br /&gt;
  public qSlicerLoadableModule&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.slicer.modules.loadable.qSlicerLoadableModule/1.0&amp;quot;);&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class Q_SLICER_QTMODULES_SUBJECTHIERARCHY_EXPORT qSlicerSubjectHierarchyModule :&lt;br /&gt;
  public qSlicerLoadableModule&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.slicer.modules.loadable.qSlicerLoadableModule/1.0&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModuleWidgetsAbstractPlugin.h====&lt;br /&gt;
&lt;br /&gt;
'''Before:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  #include &amp;lt;QtGlobal&amp;gt;&lt;br /&gt;
  #if(QT_VERSION &amp;lt; QT_VERSION_CHECKS(5, 0, 0))&lt;br /&gt;
  #include &amp;lt;QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
  #else&lt;br /&gt;
  #include &amp;lt;QtUiPlugin/QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
  [...]&lt;br /&gt;
&lt;br /&gt;
  class Q_SLICER_MODULE_SEGMENTATIONS_WIDGETS_PLUGINS_EXPORT qSlicerSegmentationsModuleWidgetsAbstractPlugin&lt;br /&gt;
      : public QDesignerCustomWidgetInterface&lt;br /&gt;
  {&lt;br /&gt;
  #if (QT_VERSION &amp;gt;= QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
    Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetInterface&amp;quot;)&lt;br /&gt;
  #endif&lt;br /&gt;
    Q_INTERFACES(QDesignerCustomWidgetInterface);&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  #include &amp;lt;QtUiPlugin/QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  [...]&lt;br /&gt;
&lt;br /&gt;
  class Q_SLICER_MODULE_SEGMENTATIONS_WIDGETS_PLUGINS_EXPORT qSlicerSegmentationsModuleWidgetsAbstractPlugin&lt;br /&gt;
      : public QDesignerCustomWidgetInterface&lt;br /&gt;
  {&lt;br /&gt;
    Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetInterface&amp;quot;)&lt;br /&gt;
    Q_INTERFACES(QDesignerCustomWidgetInterface);&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====qSlicerNAMEModule.cxx and qSlicerNAMEModuleWidgetsAbstractPlugin.cxx====&lt;br /&gt;
&lt;br /&gt;
'''Remove:'''&lt;br /&gt;
&lt;br /&gt;
  #if (QT_VERSION &amp;lt; QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
  #include &amp;lt;QtPlugin&amp;gt;&lt;br /&gt;
  Q_EXPORT_PLUGIN2(customwidgetplugin, qSlicerSegmentationsModuleWidgetsPlugin);&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
===Qt&amp;gt;=5.0.0: Simpler use of QHeaderView::setSectionResizeMode===&lt;br /&gt;
&lt;br /&gt;
This migration guide entry is obsolete: [[Documentation/Nightly/Developers/Tutorials/MigrationGuide#Qt5:_Fix_error:_.E2.80.98class_QHeaderView.E2.80.99_has_no_member_named_.E2.80.98setResizeMode.E2.80.99]]&lt;br /&gt;
&lt;br /&gt;
'''Solution for Cpp'''&lt;br /&gt;
&lt;br /&gt;
Before:&lt;br /&gt;
&lt;br /&gt;
  #if (QT_VERSION &amp;lt; QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(QHeaderView::Stretch);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
  #else&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::Stretch);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
    this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
'''After:'''&lt;br /&gt;
&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::Stretch);&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(QHeaderView::ResizeToContents);&lt;br /&gt;
  this-&amp;gt;SceneViewTableWidget-&amp;gt;horizontalHeader()-&amp;gt;setSectionResizeMode(SCENE_VIEW_DESCRIPTION_COLUMN, QHeaderView::Stretch);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Solution for Python'''&lt;br /&gt;
&lt;br /&gt;
Before:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def _setSectionResizeMode(header, *args, **kwargs):&lt;br /&gt;
    if version.parse(qt.Qt.qVersion()) &amp;lt; version.parse(&amp;quot;5.0.0&amp;quot;):&lt;br /&gt;
      header.setResizeMode(*args, **kwargs)&lt;br /&gt;
    else:&lt;br /&gt;
      header.setSectionResizeMode(*args, **kwargs)&lt;br /&gt;
&lt;br /&gt;
    [...]&lt;br /&gt;
   &lt;br /&gt;
  _setSectionResizeMode(self.horizontalHeader(), 0, qt.QHeaderView.Stretch)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After:&lt;br /&gt;
&lt;br /&gt;
  self.horizontalHeader().setSectionResizeMode(0, qt.QHeaderView.Stretch)&lt;br /&gt;
&lt;br /&gt;
===Replace NULL and 0 for nullptr (C++11)===&lt;br /&gt;
&lt;br /&gt;
Two steps, first use clang-tidy for replacing in all the compiled code.&lt;br /&gt;
Then, do a manual replace for code not compiled (templated headers, comments, ...)&lt;br /&gt;
&lt;br /&gt;
====Automatically: Steps to run clang-tidy====&lt;br /&gt;
&lt;br /&gt;
This will iteratively check files for updates. It takes a while. The sources are only modified at the end of the process, so you could cancel anytime before with no consequences.&lt;br /&gt;
# Compile Slicer with the CMake option -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON to generate the file compile_commands.json at configuration time.&lt;br /&gt;
# Run clang-tidy on the generated compile_commands.json (in the build folder: Slicer-build)&lt;br /&gt;
  run-clang-tidy.py -header-filter='.*' -checks='-*,modernize-use-nullptr' -fix&lt;br /&gt;
[http://clang.llvm.org/extra/clang-tidy/ clang-tidy] is a tool from clang. In Archlinux: sudo pacman -S clang, in other distros might be clang-extra-tools or similar.&lt;br /&gt;
&lt;br /&gt;
clang-tidy will substitute NULL and 0 for nullptr when appropiate. It is an iterative process, so it make take time. Also, it replaces all the compiled code, including external dependencies.&lt;br /&gt;
It is recommended to do a fresh build with the modified code, for testing it without modifications in any external repo.&lt;br /&gt;
&lt;br /&gt;
====Manual====&lt;br /&gt;
&lt;br /&gt;
After clang-tidy has modified the compiled code with the help of compile_commands.json, there will still be ignored instances of NULL and 0 in some headers, and comments.&lt;br /&gt;
&lt;br /&gt;
Manually replace with the following regex to change those.&lt;br /&gt;
&lt;br /&gt;
1) Change NULL to nullptr except when there is a quote or an underscore in&lt;br /&gt;
front of it. And there is not a quote after.&lt;br /&gt;
&lt;br /&gt;
  ack &amp;quot;NULL&amp;quot; -l --print0 | xargs -0 -n 1 sed -i 's/\([^\&amp;quot;\_]\)NULL\([^\&amp;quot;]\)/\1nullptr\2/g'&lt;br /&gt;
&lt;br /&gt;
2) The same than before but match end of line NULL&lt;br /&gt;
  ack &amp;quot;NULL&amp;quot; -l --print0 | xargs -0 -n 1 sed -i 's/\([^\&amp;quot;\_]\)NULL$/\1nullptr/g'&lt;/div&gt;</summary>
		<author><name>Phcerdan</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Build_Instructions/Prerequisites&amp;diff=60839</id>
		<title>Documentation/Nightly/Developers/Build Instructions/Prerequisites</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Build_Instructions/Prerequisites&amp;diff=60839"/>
		<updated>2019-03-08T18:50:51Z</updated>

		<summary type="html">&lt;p&gt;Phcerdan: /* Experimental/deprecated build environments */  Remove old visual studio instructions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{documentation/versioncheck}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== PREREQUISITES ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- For all systems be sure git-lfs is properly installed for use with VTKv9 (required for VTKm checkout) --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As of early 2018, Slicer migrated to Qt5. Qt4 support was removed in version 4.11. See instructions at this labs page for the new requirements: https://www.slicer.org/wiki/Documentation/Labs/Qt5-and-VTK8&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Please check that the following tools are installed on your machine.&lt;br /&gt;
&lt;br /&gt;
We try to keep current with the most recent releases of these prerequisites, but sometimes it's critical to use the exact versions specified here.  If you run into issues please do whatever you can to find a combination that works or contact the developer mailing list for suggestions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{mbox&lt;br /&gt;
| type = protection&lt;br /&gt;
| text = Qt libraries are '''required'''. Consider reading [[Documentation/{{documentation/version}}/Developers/Build_Instructions/Prerequisites/Qt|Qt requirements]].&lt;br /&gt;
| image= [[{{tool|logo|qt}}|x40px]]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{mbox&lt;br /&gt;
| type = protection&lt;br /&gt;
| text = CMake is '''required'''.&lt;br /&gt;
| image= [[{{tool|logo|cmake}}|x40px]]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{mbox&lt;br /&gt;
| type = protection&lt;br /&gt;
| text = &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;Git is '''required'''.&lt;br /&gt;
| image= [[{{tool|logo|git}}|x40px]]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{mbox&lt;br /&gt;
| type = protection&lt;br /&gt;
| text = SVN is '''required'''.&lt;br /&gt;
| image= [[{{tool|logo|svn}}|x40px]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
The prerequisites listed below are required to be able to configure/build/package/test Slicer.&lt;br /&gt;
&lt;br /&gt;
=== Linux  ===&lt;br /&gt;
* [{{tool|download|cmake}} CMake] &amp;gt;= 3.13.4&lt;br /&gt;
* [{{tool|download|git}} Git] &amp;gt;= 1.7.10&lt;br /&gt;
* [{{tool|download|svn}} Svn] &amp;gt;= 1.7&lt;br /&gt;
* Qt 5.11: &amp;lt;b&amp;gt;tested and recommended&amp;lt;/b&amp;gt;&lt;br /&gt;
** To build Slicer: install Qt using the distribution package manager.&lt;br /&gt;
** To package and redistribute Slicer: download and execute [https://download.qt.io/official_releases/online_installers/qt-unified-linux-x64-online.run qt-unified-linux-x64-online.run], install Qt, make sure to select &amp;lt;tt&amp;gt;qtscript&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;qtwebengine&amp;lt;/tt&amp;gt; components.&lt;br /&gt;
* GCC suite&lt;br /&gt;
&lt;br /&gt;
==== Debian ====&lt;br /&gt;
&lt;br /&gt;
* Debian squeeze/wheezy/testing(jessie) users, start by pasting the following lines in a terminal&lt;br /&gt;
 sudo apt-get install subversion git-core git-svn&lt;br /&gt;
 sudo apt-get install build-essential libx11-dev libxt-dev libgl1-mesa-dev libosmesa6-dev libglu1-mesa-dev libfontconfig-dev libxrender-dev libncurses5-dev&lt;br /&gt;
 sudo apt-get install cmake&lt;br /&gt;
 sudo apt-get install qt-sdk&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Ubuntu ====&lt;br /&gt;
&lt;br /&gt;
===== Common Prerequisites =====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install subversion git-core git-svn&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install make gcc g++ libx11-dev libxt-dev libgl1-mesa-dev libglu1-mesa-dev libfontconfig-dev libxrender-dev libncurses5-dev&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install libosmesa6-dev  # Only for Ubuntu &amp;lt; 14.04.3&lt;br /&gt;
&lt;br /&gt;
{{remark|red|On Ubuntu 14.04.3 LTS, attempting to install &amp;lt;tt&amp;gt;libosmesa6-dev&amp;lt;/tt&amp;gt; results in an error.&amp;lt;pre&amp;gt;&lt;br /&gt;
The following packages have unmet dependencies:&lt;br /&gt;
 libosmesa6-dev : Depends: libosmesa6 (= 10.1.3-0ubuntu0.4) but it is not going to be installed&lt;br /&gt;
 E: Unable to correct problems, you have held broken packages.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
For more details, see [https://bugs.launchpad.net/ubuntu/+source/mesa-lts-utopic/+bug/1424059 Bug 1424059].}}&lt;br /&gt;
&lt;br /&gt;
{{remark|green|Slicer compiles successfully without that package, but &amp;lt;tt&amp;gt;VTK_OPENGL_HAS_OSMESA&amp;lt;/tt&amp;gt; is disabled.}}&lt;br /&gt;
&lt;br /&gt;
* For Qt5.5 on Ubuntu 16.04&lt;br /&gt;
 sudo apt-get install libgstreamer-plugins-base0.10-dev&lt;br /&gt;
&lt;br /&gt;
===== CMake =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open a terminal and copy the command reported below&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Download stable version of CMake and extract the archive:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install curl&lt;br /&gt;
mkdir ~/Support &amp;amp;&amp;amp; cd ~/Support&lt;br /&gt;
curl -O https://cmake.org/files/v3.13/cmake-3.13.4-Linux-x86_64.tar.gz&lt;br /&gt;
tar -xzvf cmake-3.13.4-Linux-x86_64.tar.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Create symbolic links into &amp;lt;code&amp;gt;~/bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir -p ~/bin&lt;br /&gt;
for name in cmake ctest cpack ccmake cmake-gui; do&lt;br /&gt;
  ln -s ~/Support/cmake-3.13.4-Linux-x86_64/bin/$name ~/bin/$name&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{remark|red|You &amp;lt;b&amp;gt;MUST&amp;lt;/b&amp;gt; download the standard CMake binary because the distributed version of CMake cannot be used to build slicer.&amp;lt;br&amp;gt;&lt;br /&gt;
See [[Documentation/{{documentation/version}}/Developers/FAQ/Building#Why_distributed_CMake_can_not_be_used_on_Ubuntu_12.04_and_above_.3F|here]] for more details.}}&lt;br /&gt;
&lt;br /&gt;
==== CentOS ====&lt;br /&gt;
&lt;br /&gt;
See instructions reported in [https://github.com/Slicer/SlicerBuildEnvironment/blob/master/Docker/qt5-centos7/Dockerfile qt5-centos7/Dockerfile]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
*CentOS user type:&lt;br /&gt;
 yum install make gcc-c++ libX11-devel libXt-devel libXrender-devel libXext-devel libGLU-devel mesa-libOSMesa-devel mesa-libGL-devel mesa-libGLU-devel ncurses&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Todo: This will have to be added in FAQ: Troubleshoot section&lt;br /&gt;
''glx-utils'' provides ''glxgears'' that can be used to test rendering&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== MacOSX ===&lt;br /&gt;
* XCode command line tools must be installed:&lt;br /&gt;
  xcode-select --install&lt;br /&gt;
* El Capitan is what most developers use.&lt;br /&gt;
* CMake 3.12.2 is recommended. Check the minimum required CMake version [https://github.com/Slicer/Slicer/blob/master/CMakeLists.txt#L1 here]&lt;br /&gt;
* Qt 5: &amp;lt;b&amp;gt;tested and recommended&amp;lt;/b&amp;gt;.&lt;br /&gt;
** For building Slicer: download and execute [https://download.qt.io/official_releases/online_installers/qt-unified-mac-x64-online.dmg qt-unified-mac-x64-online.dmg], install Qt 5.10, make sure to select &amp;lt;tt&amp;gt;qtscript&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;qtwebengine&amp;lt;/tt&amp;gt; components.&lt;br /&gt;
** For packaging and redistributing Slicer: build Qt using [https://github.com/jcfr/qt-easy-build#readme qt-easy-build]&lt;br /&gt;
&lt;br /&gt;
====MacOSX 10.9.4 (Mavericks)====&lt;br /&gt;
&lt;br /&gt;
''' (1) Make sure to install this update: http://support.apple.com/kb/DL1754'''&lt;br /&gt;
&lt;br /&gt;
''' (2) Use CMake 3.12.2 - it is known to be working and is supported''' (if you want to use CMake already installed on your system, 2.8.12.2 is known to work on Mac OS X 10.9.5)&lt;br /&gt;
&lt;br /&gt;
* Mac Os X &amp;gt;= 10.5 (Leopard)&lt;br /&gt;
* [{{tool|download|cmake}} CMake] &amp;gt;= 2.8.9&lt;br /&gt;
** For Mac Os X &amp;gt;= 10.8 ([http://en.wikipedia.org/wiki/OS_X_Mountain_Lion Mountain Lion]) and/or recent XCode &amp;gt;= 4.5.X - [{{tool|download|cmake}} CMake] &amp;gt;= 2.8.11 is required. See http://www.cmake.org/files/v2.8/cmake-2.8.11-Darwin64-universal.tar.gz&lt;br /&gt;
&amp;lt;!-- Waiting for the official release, get the release candidate rc1 [http://www.cmake.org/files/v2.8/cmake-2.8.11-rc1-Darwin64-universal.tar.gz here]. For explanation, see [[Documentation/{{documentation/version}}/Developers/Build_Instructions#ld:_framework_not_found_QtWebKit|here]] and [[Documentation/{{documentation/version}}/Developers/Build_Instructions#On_MacOSX_10.8.2C_CMake_hangs_forever|here]]. These versions are also known to work: exact version 20130121-g92bd8 [http://www.cmake.org/files/dev/cmake-2.8.10.20130121-g92bd8-Darwin-universal.tar.gz here] (or version &amp;gt;= 2.8.10.20130220 [http://www.cmake.org/files/dev/?C=M;O=D here]).&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 $ curl -O http://www.cmake.org/files/v2.8/cmake-2.8.11-Darwin64-universal.tar.gz&lt;br /&gt;
 $ tar -xzvf cmake-2.8.11-Darwin64-universal.tar.gz --strip-components=1&lt;br /&gt;
&lt;br /&gt;
 $ CMake\ 2.8-11.app/Contents/bin/cmake --version&lt;br /&gt;
 cmake version 2.8.11&lt;br /&gt;
&lt;br /&gt;
* [{{tool|download|git}} Git] &amp;gt;= 1.7.10&lt;br /&gt;
* [{{tool|download|svn}} Svn] &amp;gt;= 1.7&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
*[[{{tool|logo|cmake}}|x16px]] [{{tool|download|cmake}} CMake] &amp;gt;= 2.8.9&lt;br /&gt;
*[[{{tool|logo|git}}|x16px]] [{{tool|download|git}} Git] &amp;gt;= 1.6.5&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* XCode (for the SDK libs)&lt;br /&gt;
** After installing XCode, install XCode command line developer tools: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
xcode-select --install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* XQuartz - For Mac Os X &amp;gt;= 10.8 ([http://en.wikipedia.org/wiki/OS_X_Mountain_Lion Mountain Lion]) install XQuartz (http://xquartz.macosforge.org) to get X11 (no longer a default in OS X).&lt;br /&gt;
* Qt 4 &amp;gt;= 4.8.5. We recommend you install the following two packages:&lt;br /&gt;
** Download and install [http://download.qt-project.org/official_releases/qt/4.8/4.8.6/qt-opensource-mac-4.8.6-1.dmg qt-opensource-mac-4.8.6-1.dmg]&lt;br /&gt;
** Download and install [http://download.qt-project.org/official_releases/qt/4.8/4.8.6/qt-opensource-mac-4.8.6-1-debug-libs.dmg qt-opensource-mac-4.8.6-1-debug-libs.dmg]&lt;br /&gt;
** For more details [[Documentation/{{documentation/version}}/Developers/Build_Instructions/Prerequisites/Qt#Mac|here]]&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
** Newer Xcode versions (e.g. 4.3.2) use clang as the default compiler and '''clang is not compatible with ITK version 3'''.  You should use ITK version 4 with recent versions of Xcode.&lt;br /&gt;
** Xcode with gcc should ork with either version of ITK.&lt;br /&gt;
** OS X Mountain Lion: In Xcode 4.5 you now need to install command line tools (no longer included by default). Install within Xcode under the Xcode-&amp;gt;Preferences-&amp;gt;Downloads tab (otherwise git svn will give errors). Then you will need to install XQuartz (http://xquartz.macosforge.org) to get X11 (no longer a default in OS X).&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Mac OSX 10.11 (El Capitan)====&lt;br /&gt;
&lt;br /&gt;
XCode up to version 7 is known to work for Slicer compilation. XCode 8 breaks things on several levels for now. &lt;br /&gt;
Remember to install XCode command line tools (see above) if a reinstall for XCode is needed. &lt;br /&gt;
&lt;br /&gt;
The standard Qt4 installers fail on this version and the 4.8.6 source code won't build.  But [http://slicer-devel.65872.n3.nabble.com/incompatible-qt-4-8-6-with-OS-X-El-Capitan-td4035551.html as described on the slicer-devel mailing list] it is possible to install the [https://github.com/Homebrew/formula-patches/blob/master/qt/el-capitan.patch homebrew version of qt4 which patches it to work on El Capitan] (see below).&lt;br /&gt;
&lt;br /&gt;
* Install the '''OS''', '''Xcode''', and '''XQuartz''' (see MacOSX 10.10 above)&lt;br /&gt;
* Install '''Qt4''' by running the following two commands:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
brew install qt4&lt;br /&gt;
xcode-select --install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* TCL does not build correctly on El Capitan as of 2015-12-03, so when building Slicer turn `Slicer_USE_PYTHONQT_WITH_TCL` off.&lt;br /&gt;
&lt;br /&gt;
==== Mac OSX 10.12 (Sierra) ====&lt;br /&gt;
&lt;br /&gt;
Similar to 10.11 (El Capitan), there are new issues with Qt4 (caused by Phonon).&lt;br /&gt;
The GitHub user Cartr [https://github.com/Homebrew/homebrew-core/pull/5216 offered a patch to the brew team], and even though it was not integrated (the homebrew team decided to stop patching their recipe to encourage people to use Qt5), he [https://github.com/cartr/homebrew-qt4 turned his formula into a tap] that can be installed (see below).&lt;br /&gt;
&lt;br /&gt;
Follow instructions for 10.11 ''(Installing Xcode, XQuartz, run without TCL)'' but install '''Qt4''' like shown below instead:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
brew install cartr/qt4/qt&lt;br /&gt;
xcode-select --install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirmed with Xcode: &lt;br /&gt;
* Version 8.1 (8B62) and cmake version 3.4.20151021-g8fbc8e&lt;br /&gt;
* Version 8.3.3 and cmake 3.5.2&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.9 -DSlicer_USE_PYTHONQT_WITH_TCL:BOOL=OFF ../Slicer&lt;br /&gt;
make -j `sysctl -n hw.ncpu`&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Windows ===&lt;br /&gt;
&lt;br /&gt;
==== Common Prerequisites ====&lt;br /&gt;
* [{{tool|download|cmake}} CMake] &amp;gt;= 3.13.4&lt;br /&gt;
* [{{tool|download|git}} Git] &amp;gt;= 1.7.10&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
*[[{{tool|logo|cmake}}|x16px]]  [{{tool|download|cmake}}  CMake] &amp;gt;= 3.13.4&lt;br /&gt;
*[[{{tool|logo|git}}|x16px]]  [{{tool|download|git}}  Git] &amp;gt;= 1.7.10&lt;br /&gt;
* [https://code.google.com/p/msysgit/downloads/list?can=3 ''Git-X.X.X-preview2013XXXX.exe''] recommended.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
** Use of [http://code.google.com/p/tortoisegit/ TortoiseGit] is optional.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
** {{note}}CMake must be able to find ''git.exe'' and ''patch.exe''. If git is installed in the default location then they may be found there, but if they are not found then either add the folder that contains them to PATH environment variable; or set GIT_EXECUTABLE and Patch_EXECUTABLE as environment variables or as CMake variables at configure time.&lt;br /&gt;
&lt;br /&gt;
* Subversion (SVN) client: any SVN client that has command line tools&lt;br /&gt;
** [http://www.sliksvn.com/en/download SlikSvn] &amp;lt;!-- or [http://www.cygwin.com cygwin's svn client]--&amp;gt;, or&lt;br /&gt;
** [https://tortoisesvn.net/downloads.html TortoiseSVN] - make sure you install ''Command line client tools'' component (disabled by default)&lt;br /&gt;
&lt;br /&gt;
* NSIS (optional): Needed if packaging Slicer - Click [http://nsis.sourceforge.net/Download here] to download. Make sure you install the language packs.&lt;br /&gt;
&lt;br /&gt;
* Qt5: Download [https://download.qt.io/official_releases/online_installers/qt-unified-windows-x86-online.exe qt-unified-windows-x86-online.exe] and install Qt along with &amp;lt;tt&amp;gt;qtscript&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;qtwebengine&amp;lt;/tt&amp;gt; components. For building with VS2015, Qt version 5.10.x or older is required. For more details, read [[Documentation/Nightly/Developers/Build Instructions/Prerequisites/Qt5|step-by-step]] guide.&lt;br /&gt;
&lt;br /&gt;
==== Tested and recommended build environment ====&lt;br /&gt;
&lt;br /&gt;
* VS2015&lt;br /&gt;
** Make sure you enable installation of component ''Programming languages / Visual C++ / Common Tools for Visual C++ 2015'' (in some distributions, this option is not enabled by default)&lt;br /&gt;
** Installation of [https://msdn.microsoft.com/en-us/library/mt752379.aspx Cumulative Servicing Release for Microsoft Visual Studio 2015 Update 3 (KB3165756)] is required on some older VS2015 distributions&lt;br /&gt;
* Qt 5.10&lt;br /&gt;
* CMake &amp;gt;= 3.13.4&lt;br /&gt;
&lt;br /&gt;
==== Experimental/deprecated build environments ====&lt;br /&gt;
* [https://visualstudio.microsoft.com/vs/community/ Visual Studio 2017 (Community or any other edition)] with VS2015 build tools (tested, works well)&lt;br /&gt;
** When configuring Visual Studio installer, enable installation of component ''VC++ 2015.3 v14.00 (v140) toolset for desktop''&lt;br /&gt;
** Visual Studio 2015 toolset must be set in CMake: ''Optional toolset to use (argument to -T)'' need to be set to ''v140''&lt;br /&gt;
* Cygwin (untested, probably does not work)&lt;br /&gt;
** Cygwin suite (building with cygwin gcc not supported, but the cygwin shell environment can be used to run git, svn, etc).&lt;/div&gt;</summary>
		<author><name>Phcerdan</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Build_Instructions/Prerequisites&amp;diff=60838</id>
		<title>Documentation/Nightly/Developers/Build Instructions/Prerequisites</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Build_Instructions/Prerequisites&amp;diff=60838"/>
		<updated>2019-03-08T18:28:33Z</updated>

		<summary type="html">&lt;p&gt;Phcerdan: /* Windows */  CMake version updates&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{documentation/versioncheck}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== PREREQUISITES ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- For all systems be sure git-lfs is properly installed for use with VTKv9 (required for VTKm checkout) --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As of early 2018, Slicer migrated to Qt5. Qt4 support was removed in version 4.11. See instructions at this labs page for the new requirements: https://www.slicer.org/wiki/Documentation/Labs/Qt5-and-VTK8&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Please check that the following tools are installed on your machine.&lt;br /&gt;
&lt;br /&gt;
We try to keep current with the most recent releases of these prerequisites, but sometimes it's critical to use the exact versions specified here.  If you run into issues please do whatever you can to find a combination that works or contact the developer mailing list for suggestions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{mbox&lt;br /&gt;
| type = protection&lt;br /&gt;
| text = Qt libraries are '''required'''. Consider reading [[Documentation/{{documentation/version}}/Developers/Build_Instructions/Prerequisites/Qt|Qt requirements]].&lt;br /&gt;
| image= [[{{tool|logo|qt}}|x40px]]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{mbox&lt;br /&gt;
| type = protection&lt;br /&gt;
| text = CMake is '''required'''.&lt;br /&gt;
| image= [[{{tool|logo|cmake}}|x40px]]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{mbox&lt;br /&gt;
| type = protection&lt;br /&gt;
| text = &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;Git is '''required'''.&lt;br /&gt;
| image= [[{{tool|logo|git}}|x40px]]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{mbox&lt;br /&gt;
| type = protection&lt;br /&gt;
| text = SVN is '''required'''.&lt;br /&gt;
| image= [[{{tool|logo|svn}}|x40px]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
The prerequisites listed below are required to be able to configure/build/package/test Slicer.&lt;br /&gt;
&lt;br /&gt;
=== Linux  ===&lt;br /&gt;
* [{{tool|download|cmake}} CMake] &amp;gt;= 3.13.4&lt;br /&gt;
* [{{tool|download|git}} Git] &amp;gt;= 1.7.10&lt;br /&gt;
* [{{tool|download|svn}} Svn] &amp;gt;= 1.7&lt;br /&gt;
* Qt 5.11: &amp;lt;b&amp;gt;tested and recommended&amp;lt;/b&amp;gt;&lt;br /&gt;
** To build Slicer: install Qt using the distribution package manager.&lt;br /&gt;
** To package and redistribute Slicer: download and execute [https://download.qt.io/official_releases/online_installers/qt-unified-linux-x64-online.run qt-unified-linux-x64-online.run], install Qt, make sure to select &amp;lt;tt&amp;gt;qtscript&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;qtwebengine&amp;lt;/tt&amp;gt; components.&lt;br /&gt;
* GCC suite&lt;br /&gt;
&lt;br /&gt;
==== Debian ====&lt;br /&gt;
&lt;br /&gt;
* Debian squeeze/wheezy/testing(jessie) users, start by pasting the following lines in a terminal&lt;br /&gt;
 sudo apt-get install subversion git-core git-svn&lt;br /&gt;
 sudo apt-get install build-essential libx11-dev libxt-dev libgl1-mesa-dev libosmesa6-dev libglu1-mesa-dev libfontconfig-dev libxrender-dev libncurses5-dev&lt;br /&gt;
 sudo apt-get install cmake&lt;br /&gt;
 sudo apt-get install qt-sdk&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Ubuntu ====&lt;br /&gt;
&lt;br /&gt;
===== Common Prerequisites =====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install subversion git-core git-svn&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install make gcc g++ libx11-dev libxt-dev libgl1-mesa-dev libglu1-mesa-dev libfontconfig-dev libxrender-dev libncurses5-dev&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install libosmesa6-dev  # Only for Ubuntu &amp;lt; 14.04.3&lt;br /&gt;
&lt;br /&gt;
{{remark|red|On Ubuntu 14.04.3 LTS, attempting to install &amp;lt;tt&amp;gt;libosmesa6-dev&amp;lt;/tt&amp;gt; results in an error.&amp;lt;pre&amp;gt;&lt;br /&gt;
The following packages have unmet dependencies:&lt;br /&gt;
 libosmesa6-dev : Depends: libosmesa6 (= 10.1.3-0ubuntu0.4) but it is not going to be installed&lt;br /&gt;
 E: Unable to correct problems, you have held broken packages.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
For more details, see [https://bugs.launchpad.net/ubuntu/+source/mesa-lts-utopic/+bug/1424059 Bug 1424059].}}&lt;br /&gt;
&lt;br /&gt;
{{remark|green|Slicer compiles successfully without that package, but &amp;lt;tt&amp;gt;VTK_OPENGL_HAS_OSMESA&amp;lt;/tt&amp;gt; is disabled.}}&lt;br /&gt;
&lt;br /&gt;
* For Qt5.5 on Ubuntu 16.04&lt;br /&gt;
 sudo apt-get install libgstreamer-plugins-base0.10-dev&lt;br /&gt;
&lt;br /&gt;
===== CMake =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open a terminal and copy the command reported below&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Download stable version of CMake and extract the archive:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install curl&lt;br /&gt;
mkdir ~/Support &amp;amp;&amp;amp; cd ~/Support&lt;br /&gt;
curl -O https://cmake.org/files/v3.13/cmake-3.13.4-Linux-x86_64.tar.gz&lt;br /&gt;
tar -xzvf cmake-3.13.4-Linux-x86_64.tar.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Create symbolic links into &amp;lt;code&amp;gt;~/bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir -p ~/bin&lt;br /&gt;
for name in cmake ctest cpack ccmake cmake-gui; do&lt;br /&gt;
  ln -s ~/Support/cmake-3.13.4-Linux-x86_64/bin/$name ~/bin/$name&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{remark|red|You &amp;lt;b&amp;gt;MUST&amp;lt;/b&amp;gt; download the standard CMake binary because the distributed version of CMake cannot be used to build slicer.&amp;lt;br&amp;gt;&lt;br /&gt;
See [[Documentation/{{documentation/version}}/Developers/FAQ/Building#Why_distributed_CMake_can_not_be_used_on_Ubuntu_12.04_and_above_.3F|here]] for more details.}}&lt;br /&gt;
&lt;br /&gt;
==== CentOS ====&lt;br /&gt;
&lt;br /&gt;
See instructions reported in [https://github.com/Slicer/SlicerBuildEnvironment/blob/master/Docker/qt5-centos7/Dockerfile qt5-centos7/Dockerfile]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
*CentOS user type:&lt;br /&gt;
 yum install make gcc-c++ libX11-devel libXt-devel libXrender-devel libXext-devel libGLU-devel mesa-libOSMesa-devel mesa-libGL-devel mesa-libGLU-devel ncurses&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Todo: This will have to be added in FAQ: Troubleshoot section&lt;br /&gt;
''glx-utils'' provides ''glxgears'' that can be used to test rendering&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== MacOSX ===&lt;br /&gt;
* XCode command line tools must be installed:&lt;br /&gt;
  xcode-select --install&lt;br /&gt;
* El Capitan is what most developers use.&lt;br /&gt;
* CMake 3.12.2 is recommended. Check the minimum required CMake version [https://github.com/Slicer/Slicer/blob/master/CMakeLists.txt#L1 here]&lt;br /&gt;
* Qt 5: &amp;lt;b&amp;gt;tested and recommended&amp;lt;/b&amp;gt;.&lt;br /&gt;
** For building Slicer: download and execute [https://download.qt.io/official_releases/online_installers/qt-unified-mac-x64-online.dmg qt-unified-mac-x64-online.dmg], install Qt 5.10, make sure to select &amp;lt;tt&amp;gt;qtscript&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;qtwebengine&amp;lt;/tt&amp;gt; components.&lt;br /&gt;
** For packaging and redistributing Slicer: build Qt using [https://github.com/jcfr/qt-easy-build#readme qt-easy-build]&lt;br /&gt;
&lt;br /&gt;
====MacOSX 10.9.4 (Mavericks)====&lt;br /&gt;
&lt;br /&gt;
''' (1) Make sure to install this update: http://support.apple.com/kb/DL1754'''&lt;br /&gt;
&lt;br /&gt;
''' (2) Use CMake 3.12.2 - it is known to be working and is supported''' (if you want to use CMake already installed on your system, 2.8.12.2 is known to work on Mac OS X 10.9.5)&lt;br /&gt;
&lt;br /&gt;
* Mac Os X &amp;gt;= 10.5 (Leopard)&lt;br /&gt;
* [{{tool|download|cmake}} CMake] &amp;gt;= 2.8.9&lt;br /&gt;
** For Mac Os X &amp;gt;= 10.8 ([http://en.wikipedia.org/wiki/OS_X_Mountain_Lion Mountain Lion]) and/or recent XCode &amp;gt;= 4.5.X - [{{tool|download|cmake}} CMake] &amp;gt;= 2.8.11 is required. See http://www.cmake.org/files/v2.8/cmake-2.8.11-Darwin64-universal.tar.gz&lt;br /&gt;
&amp;lt;!-- Waiting for the official release, get the release candidate rc1 [http://www.cmake.org/files/v2.8/cmake-2.8.11-rc1-Darwin64-universal.tar.gz here]. For explanation, see [[Documentation/{{documentation/version}}/Developers/Build_Instructions#ld:_framework_not_found_QtWebKit|here]] and [[Documentation/{{documentation/version}}/Developers/Build_Instructions#On_MacOSX_10.8.2C_CMake_hangs_forever|here]]. These versions are also known to work: exact version 20130121-g92bd8 [http://www.cmake.org/files/dev/cmake-2.8.10.20130121-g92bd8-Darwin-universal.tar.gz here] (or version &amp;gt;= 2.8.10.20130220 [http://www.cmake.org/files/dev/?C=M;O=D here]).&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 $ curl -O http://www.cmake.org/files/v2.8/cmake-2.8.11-Darwin64-universal.tar.gz&lt;br /&gt;
 $ tar -xzvf cmake-2.8.11-Darwin64-universal.tar.gz --strip-components=1&lt;br /&gt;
&lt;br /&gt;
 $ CMake\ 2.8-11.app/Contents/bin/cmake --version&lt;br /&gt;
 cmake version 2.8.11&lt;br /&gt;
&lt;br /&gt;
* [{{tool|download|git}} Git] &amp;gt;= 1.7.10&lt;br /&gt;
* [{{tool|download|svn}} Svn] &amp;gt;= 1.7&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
*[[{{tool|logo|cmake}}|x16px]] [{{tool|download|cmake}} CMake] &amp;gt;= 2.8.9&lt;br /&gt;
*[[{{tool|logo|git}}|x16px]] [{{tool|download|git}} Git] &amp;gt;= 1.6.5&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* XCode (for the SDK libs)&lt;br /&gt;
** After installing XCode, install XCode command line developer tools: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
xcode-select --install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* XQuartz - For Mac Os X &amp;gt;= 10.8 ([http://en.wikipedia.org/wiki/OS_X_Mountain_Lion Mountain Lion]) install XQuartz (http://xquartz.macosforge.org) to get X11 (no longer a default in OS X).&lt;br /&gt;
* Qt 4 &amp;gt;= 4.8.5. We recommend you install the following two packages:&lt;br /&gt;
** Download and install [http://download.qt-project.org/official_releases/qt/4.8/4.8.6/qt-opensource-mac-4.8.6-1.dmg qt-opensource-mac-4.8.6-1.dmg]&lt;br /&gt;
** Download and install [http://download.qt-project.org/official_releases/qt/4.8/4.8.6/qt-opensource-mac-4.8.6-1-debug-libs.dmg qt-opensource-mac-4.8.6-1-debug-libs.dmg]&lt;br /&gt;
** For more details [[Documentation/{{documentation/version}}/Developers/Build_Instructions/Prerequisites/Qt#Mac|here]]&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
** Newer Xcode versions (e.g. 4.3.2) use clang as the default compiler and '''clang is not compatible with ITK version 3'''.  You should use ITK version 4 with recent versions of Xcode.&lt;br /&gt;
** Xcode with gcc should ork with either version of ITK.&lt;br /&gt;
** OS X Mountain Lion: In Xcode 4.5 you now need to install command line tools (no longer included by default). Install within Xcode under the Xcode-&amp;gt;Preferences-&amp;gt;Downloads tab (otherwise git svn will give errors). Then you will need to install XQuartz (http://xquartz.macosforge.org) to get X11 (no longer a default in OS X).&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Mac OSX 10.11 (El Capitan)====&lt;br /&gt;
&lt;br /&gt;
XCode up to version 7 is known to work for Slicer compilation. XCode 8 breaks things on several levels for now. &lt;br /&gt;
Remember to install XCode command line tools (see above) if a reinstall for XCode is needed. &lt;br /&gt;
&lt;br /&gt;
The standard Qt4 installers fail on this version and the 4.8.6 source code won't build.  But [http://slicer-devel.65872.n3.nabble.com/incompatible-qt-4-8-6-with-OS-X-El-Capitan-td4035551.html as described on the slicer-devel mailing list] it is possible to install the [https://github.com/Homebrew/formula-patches/blob/master/qt/el-capitan.patch homebrew version of qt4 which patches it to work on El Capitan] (see below).&lt;br /&gt;
&lt;br /&gt;
* Install the '''OS''', '''Xcode''', and '''XQuartz''' (see MacOSX 10.10 above)&lt;br /&gt;
* Install '''Qt4''' by running the following two commands:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
brew install qt4&lt;br /&gt;
xcode-select --install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* TCL does not build correctly on El Capitan as of 2015-12-03, so when building Slicer turn `Slicer_USE_PYTHONQT_WITH_TCL` off.&lt;br /&gt;
&lt;br /&gt;
==== Mac OSX 10.12 (Sierra) ====&lt;br /&gt;
&lt;br /&gt;
Similar to 10.11 (El Capitan), there are new issues with Qt4 (caused by Phonon).&lt;br /&gt;
The GitHub user Cartr [https://github.com/Homebrew/homebrew-core/pull/5216 offered a patch to the brew team], and even though it was not integrated (the homebrew team decided to stop patching their recipe to encourage people to use Qt5), he [https://github.com/cartr/homebrew-qt4 turned his formula into a tap] that can be installed (see below).&lt;br /&gt;
&lt;br /&gt;
Follow instructions for 10.11 ''(Installing Xcode, XQuartz, run without TCL)'' but install '''Qt4''' like shown below instead:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
brew install cartr/qt4/qt&lt;br /&gt;
xcode-select --install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirmed with Xcode: &lt;br /&gt;
* Version 8.1 (8B62) and cmake version 3.4.20151021-g8fbc8e&lt;br /&gt;
* Version 8.3.3 and cmake 3.5.2&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.9 -DSlicer_USE_PYTHONQT_WITH_TCL:BOOL=OFF ../Slicer&lt;br /&gt;
make -j `sysctl -n hw.ncpu`&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Windows ===&lt;br /&gt;
&lt;br /&gt;
==== Common Prerequisites ====&lt;br /&gt;
* [{{tool|download|cmake}} CMake] &amp;gt;= 3.13.4&lt;br /&gt;
* [{{tool|download|git}} Git] &amp;gt;= 1.7.10&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
*[[{{tool|logo|cmake}}|x16px]]  [{{tool|download|cmake}}  CMake] &amp;gt;= 3.13.4&lt;br /&gt;
*[[{{tool|logo|git}}|x16px]]  [{{tool|download|git}}  Git] &amp;gt;= 1.7.10&lt;br /&gt;
* [https://code.google.com/p/msysgit/downloads/list?can=3 ''Git-X.X.X-preview2013XXXX.exe''] recommended.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
** Use of [http://code.google.com/p/tortoisegit/ TortoiseGit] is optional.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
** {{note}}CMake must be able to find ''git.exe'' and ''patch.exe''. If git is installed in the default location then they may be found there, but if they are not found then either add the folder that contains them to PATH environment variable; or set GIT_EXECUTABLE and Patch_EXECUTABLE as environment variables or as CMake variables at configure time.&lt;br /&gt;
&lt;br /&gt;
* Subversion (SVN) client: any SVN client that has command line tools&lt;br /&gt;
** [http://www.sliksvn.com/en/download SlikSvn] &amp;lt;!-- or [http://www.cygwin.com cygwin's svn client]--&amp;gt;, or&lt;br /&gt;
** [https://tortoisesvn.net/downloads.html TortoiseSVN] - make sure you install ''Command line client tools'' component (disabled by default)&lt;br /&gt;
&lt;br /&gt;
* NSIS (optional): Needed if packaging Slicer - Click [http://nsis.sourceforge.net/Download here] to download. Make sure you install the language packs.&lt;br /&gt;
&lt;br /&gt;
* Qt5: Download [https://download.qt.io/official_releases/online_installers/qt-unified-windows-x86-online.exe qt-unified-windows-x86-online.exe] and install Qt along with &amp;lt;tt&amp;gt;qtscript&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;qtwebengine&amp;lt;/tt&amp;gt; components. For building with VS2015, Qt version 5.10.x or older is required. For more details, read [[Documentation/Nightly/Developers/Build Instructions/Prerequisites/Qt5|step-by-step]] guide.&lt;br /&gt;
&lt;br /&gt;
==== Tested and recommended build environment ====&lt;br /&gt;
&lt;br /&gt;
* VS2015&lt;br /&gt;
** Make sure you enable installation of component ''Programming languages / Visual C++ / Common Tools for Visual C++ 2015'' (in some distributions, this option is not enabled by default)&lt;br /&gt;
** Installation of [https://msdn.microsoft.com/en-us/library/mt752379.aspx Cumulative Servicing Release for Microsoft Visual Studio 2015 Update 3 (KB3165756)] is required on some older VS2015 distributions&lt;br /&gt;
* Qt 5.10&lt;br /&gt;
* CMake &amp;gt;= 3.13.4&lt;br /&gt;
&lt;br /&gt;
==== Experimental/deprecated build environments ====&lt;br /&gt;
* [https://visualstudio.microsoft.com/vs/community/ Visual Studio 2017 (Community or any other edition)] with VS2015 build tools (tested, works well)&lt;br /&gt;
** When configuring Visual Studio installer, enable installation of component ''VC++ 2015.3 v14.00 (v140) toolset for desktop''&lt;br /&gt;
** Visual Studio 2015 toolset must be set in CMake: ''Optional toolset to use (argument to -T)'' need to be set to ''v140''&lt;br /&gt;
* [https://www.visualstudio.com/en-us/news/vs2013-community-vs.aspx Visual Studio 2013] with Update 5 (deprecated, should still work)&lt;br /&gt;
** As of [https://github.com/Slicer/Slicer/commit/71602609ce2ae5e473ece392500825ca96213371 commit 7160260]: Slicer compilation is successful, with some caveats.&lt;br /&gt;
** Build Qt 4.8.7 with SSL support using [https://github.com/jcfr/qt-easy-build/tree/4.8.7 qt-easy-build].&lt;br /&gt;
** '''Note: be sure to pick the version of qmake that you built in the earlier steps if applicable (CMake may pick a different qmake, for example if installed with anaconda)'''&lt;br /&gt;
* VS2012 (untested, may work)&lt;br /&gt;
** Use a desktop version such as [http://www.microsoft.com/visualstudio/eng/downloads#d-express-windows-desktop Visual Studio 2012 Express &amp;lt;b&amp;gt;for Windows Desktop&amp;lt;/b&amp;gt;] and remember [http://www.microsoft.com/en-us/download/details.aspx?id=38188 Visual Studio 2012 Update 2]). Do &amp;lt;b&amp;gt;not&amp;lt;/b&amp;gt; use Visual Studio Express 2012 &amp;lt;em&amp;gt;for Windows 8&amp;lt;/em&amp;gt;. You must install [http://msdn.microsoft.com/en-us/library/ms717422.aspx Windows SDK], otherwise CMake will not even find the C compiler during configure. In CMake, choose &amp;lt;tt&amp;gt;Visual Studio 11 Win64&amp;lt;/tt&amp;gt; as generator.&lt;br /&gt;
* VS2010 (untested, probably does not work)&lt;br /&gt;
** [https://www.microsoft.com/visualstudio/en-us/products/2010-editions Microsoft Visual Studio 2010] (Any edition)&lt;br /&gt;
** Make sure to build or install:&lt;br /&gt;
*** Qt 4.8 &lt;br /&gt;
** Make sure to install:&lt;br /&gt;
*** SP1. Click [http://www.microsoft.com/download/en/details.aspx?id=23691 here] to download SP1 and click [http://developer.qt.nokia.com/faq/answer/why_do_all_qt_4.7_applications_crash_when_using_windows_7_x64_w_vs_2010 here] to understand the motivation.&lt;br /&gt;
*** SP1 Compiler update. Click [https://www.microsoft.com/download/en/details.aspx?id=4422 here] to download and [http://slicer-devel.65872.n3.nabble.com/Windows-7-64Bits-Slicer-4-Build-with-VC-2010-problem-tt3730524.html#a3731661 here] to understand the motivation.&lt;br /&gt;
* VS2008 (untested, probably does not work)&lt;br /&gt;
** [https://www.microsoft.com/visualstudio/en-us/products/2008-editions Microsoft Visual Studio 9 2008] (Any edition). [http://go.microsoft.com/?linkid=7729279 VS Express 2008 with SP1 direct link] (functional as of Jan 11, 2014)&lt;br /&gt;
** Make sure to install SP1: Click [http://www.microsoft.com/download/en/details.aspx?id=10986 here] to download SP1 and click [http://massmail.spl.harvard.edu/public-archives/slicer-devel/2012/008206.html here] to understand the motivation.&lt;br /&gt;
*** Make sure to patch VS2008 using the script [https://gist.github.com/jcfr/3c7bef3f8b32f9f6ad4b fix-vc9-redist-manifests.ps1]&lt;br /&gt;
* Cygwin (untested, probably does not work)&lt;br /&gt;
** Cygwin suite (building with cygwin gcc not supported, but the cygwin shell environment can be used to run git, svn, etc).&lt;/div&gt;</summary>
		<author><name>Phcerdan</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Build_Instructions/Prerequisites&amp;diff=60837</id>
		<title>Documentation/Nightly/Developers/Build Instructions/Prerequisites</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Build_Instructions/Prerequisites&amp;diff=60837"/>
		<updated>2019-03-08T18:23:15Z</updated>

		<summary type="html">&lt;p&gt;Phcerdan: Remove git-lfs comment refering to VTKv9 (VTKm checkout)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{documentation/versioncheck}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== PREREQUISITES ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- For all systems be sure git-lfs is properly installed for use with VTKv9 (required for VTKm checkout) --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As of early 2018, Slicer migrated to Qt5. Qt4 support was removed in version 4.11. See instructions at this labs page for the new requirements: https://www.slicer.org/wiki/Documentation/Labs/Qt5-and-VTK8&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Please check that the following tools are installed on your machine.&lt;br /&gt;
&lt;br /&gt;
We try to keep current with the most recent releases of these prerequisites, but sometimes it's critical to use the exact versions specified here.  If you run into issues please do whatever you can to find a combination that works or contact the developer mailing list for suggestions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{mbox&lt;br /&gt;
| type = protection&lt;br /&gt;
| text = Qt libraries are '''required'''. Consider reading [[Documentation/{{documentation/version}}/Developers/Build_Instructions/Prerequisites/Qt|Qt requirements]].&lt;br /&gt;
| image= [[{{tool|logo|qt}}|x40px]]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{mbox&lt;br /&gt;
| type = protection&lt;br /&gt;
| text = CMake is '''required'''.&lt;br /&gt;
| image= [[{{tool|logo|cmake}}|x40px]]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{mbox&lt;br /&gt;
| type = protection&lt;br /&gt;
| text = &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;Git is '''required'''.&lt;br /&gt;
| image= [[{{tool|logo|git}}|x40px]]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{mbox&lt;br /&gt;
| type = protection&lt;br /&gt;
| text = SVN is '''required'''.&lt;br /&gt;
| image= [[{{tool|logo|svn}}|x40px]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
The prerequisites listed below are required to be able to configure/build/package/test Slicer.&lt;br /&gt;
&lt;br /&gt;
=== Linux  ===&lt;br /&gt;
* [{{tool|download|cmake}} CMake] &amp;gt;= 3.13.4&lt;br /&gt;
* [{{tool|download|git}} Git] &amp;gt;= 1.7.10&lt;br /&gt;
* [{{tool|download|svn}} Svn] &amp;gt;= 1.7&lt;br /&gt;
* Qt 5.11: &amp;lt;b&amp;gt;tested and recommended&amp;lt;/b&amp;gt;&lt;br /&gt;
** To build Slicer: install Qt using the distribution package manager.&lt;br /&gt;
** To package and redistribute Slicer: download and execute [https://download.qt.io/official_releases/online_installers/qt-unified-linux-x64-online.run qt-unified-linux-x64-online.run], install Qt, make sure to select &amp;lt;tt&amp;gt;qtscript&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;qtwebengine&amp;lt;/tt&amp;gt; components.&lt;br /&gt;
* GCC suite&lt;br /&gt;
&lt;br /&gt;
==== Debian ====&lt;br /&gt;
&lt;br /&gt;
* Debian squeeze/wheezy/testing(jessie) users, start by pasting the following lines in a terminal&lt;br /&gt;
 sudo apt-get install subversion git-core git-svn&lt;br /&gt;
 sudo apt-get install build-essential libx11-dev libxt-dev libgl1-mesa-dev libosmesa6-dev libglu1-mesa-dev libfontconfig-dev libxrender-dev libncurses5-dev&lt;br /&gt;
 sudo apt-get install cmake&lt;br /&gt;
 sudo apt-get install qt-sdk&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Ubuntu ====&lt;br /&gt;
&lt;br /&gt;
===== Common Prerequisites =====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install subversion git-core git-svn&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install make gcc g++ libx11-dev libxt-dev libgl1-mesa-dev libglu1-mesa-dev libfontconfig-dev libxrender-dev libncurses5-dev&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install libosmesa6-dev  # Only for Ubuntu &amp;lt; 14.04.3&lt;br /&gt;
&lt;br /&gt;
{{remark|red|On Ubuntu 14.04.3 LTS, attempting to install &amp;lt;tt&amp;gt;libosmesa6-dev&amp;lt;/tt&amp;gt; results in an error.&amp;lt;pre&amp;gt;&lt;br /&gt;
The following packages have unmet dependencies:&lt;br /&gt;
 libosmesa6-dev : Depends: libosmesa6 (= 10.1.3-0ubuntu0.4) but it is not going to be installed&lt;br /&gt;
 E: Unable to correct problems, you have held broken packages.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
For more details, see [https://bugs.launchpad.net/ubuntu/+source/mesa-lts-utopic/+bug/1424059 Bug 1424059].}}&lt;br /&gt;
&lt;br /&gt;
{{remark|green|Slicer compiles successfully without that package, but &amp;lt;tt&amp;gt;VTK_OPENGL_HAS_OSMESA&amp;lt;/tt&amp;gt; is disabled.}}&lt;br /&gt;
&lt;br /&gt;
* For Qt5.5 on Ubuntu 16.04&lt;br /&gt;
 sudo apt-get install libgstreamer-plugins-base0.10-dev&lt;br /&gt;
&lt;br /&gt;
===== CMake =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open a terminal and copy the command reported below&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Download stable version of CMake and extract the archive:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install curl&lt;br /&gt;
mkdir ~/Support &amp;amp;&amp;amp; cd ~/Support&lt;br /&gt;
curl -O https://cmake.org/files/v3.13/cmake-3.13.4-Linux-x86_64.tar.gz&lt;br /&gt;
tar -xzvf cmake-3.13.4-Linux-x86_64.tar.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Create symbolic links into &amp;lt;code&amp;gt;~/bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir -p ~/bin&lt;br /&gt;
for name in cmake ctest cpack ccmake cmake-gui; do&lt;br /&gt;
  ln -s ~/Support/cmake-3.13.4-Linux-x86_64/bin/$name ~/bin/$name&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{remark|red|You &amp;lt;b&amp;gt;MUST&amp;lt;/b&amp;gt; download the standard CMake binary because the distributed version of CMake cannot be used to build slicer.&amp;lt;br&amp;gt;&lt;br /&gt;
See [[Documentation/{{documentation/version}}/Developers/FAQ/Building#Why_distributed_CMake_can_not_be_used_on_Ubuntu_12.04_and_above_.3F|here]] for more details.}}&lt;br /&gt;
&lt;br /&gt;
==== CentOS ====&lt;br /&gt;
&lt;br /&gt;
See instructions reported in [https://github.com/Slicer/SlicerBuildEnvironment/blob/master/Docker/qt5-centos7/Dockerfile qt5-centos7/Dockerfile]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
*CentOS user type:&lt;br /&gt;
 yum install make gcc-c++ libX11-devel libXt-devel libXrender-devel libXext-devel libGLU-devel mesa-libOSMesa-devel mesa-libGL-devel mesa-libGLU-devel ncurses&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Todo: This will have to be added in FAQ: Troubleshoot section&lt;br /&gt;
''glx-utils'' provides ''glxgears'' that can be used to test rendering&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== MacOSX ===&lt;br /&gt;
* XCode command line tools must be installed:&lt;br /&gt;
  xcode-select --install&lt;br /&gt;
* El Capitan is what most developers use.&lt;br /&gt;
* CMake 3.12.2 is recommended. Check the minimum required CMake version [https://github.com/Slicer/Slicer/blob/master/CMakeLists.txt#L1 here]&lt;br /&gt;
* Qt 5: &amp;lt;b&amp;gt;tested and recommended&amp;lt;/b&amp;gt;.&lt;br /&gt;
** For building Slicer: download and execute [https://download.qt.io/official_releases/online_installers/qt-unified-mac-x64-online.dmg qt-unified-mac-x64-online.dmg], install Qt 5.10, make sure to select &amp;lt;tt&amp;gt;qtscript&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;qtwebengine&amp;lt;/tt&amp;gt; components.&lt;br /&gt;
** For packaging and redistributing Slicer: build Qt using [https://github.com/jcfr/qt-easy-build#readme qt-easy-build]&lt;br /&gt;
&lt;br /&gt;
====MacOSX 10.9.4 (Mavericks)====&lt;br /&gt;
&lt;br /&gt;
''' (1) Make sure to install this update: http://support.apple.com/kb/DL1754'''&lt;br /&gt;
&lt;br /&gt;
''' (2) Use CMake 3.12.2 - it is known to be working and is supported''' (if you want to use CMake already installed on your system, 2.8.12.2 is known to work on Mac OS X 10.9.5)&lt;br /&gt;
&lt;br /&gt;
* Mac Os X &amp;gt;= 10.5 (Leopard)&lt;br /&gt;
* [{{tool|download|cmake}} CMake] &amp;gt;= 2.8.9&lt;br /&gt;
** For Mac Os X &amp;gt;= 10.8 ([http://en.wikipedia.org/wiki/OS_X_Mountain_Lion Mountain Lion]) and/or recent XCode &amp;gt;= 4.5.X - [{{tool|download|cmake}} CMake] &amp;gt;= 2.8.11 is required. See http://www.cmake.org/files/v2.8/cmake-2.8.11-Darwin64-universal.tar.gz&lt;br /&gt;
&amp;lt;!-- Waiting for the official release, get the release candidate rc1 [http://www.cmake.org/files/v2.8/cmake-2.8.11-rc1-Darwin64-universal.tar.gz here]. For explanation, see [[Documentation/{{documentation/version}}/Developers/Build_Instructions#ld:_framework_not_found_QtWebKit|here]] and [[Documentation/{{documentation/version}}/Developers/Build_Instructions#On_MacOSX_10.8.2C_CMake_hangs_forever|here]]. These versions are also known to work: exact version 20130121-g92bd8 [http://www.cmake.org/files/dev/cmake-2.8.10.20130121-g92bd8-Darwin-universal.tar.gz here] (or version &amp;gt;= 2.8.10.20130220 [http://www.cmake.org/files/dev/?C=M;O=D here]).&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 $ curl -O http://www.cmake.org/files/v2.8/cmake-2.8.11-Darwin64-universal.tar.gz&lt;br /&gt;
 $ tar -xzvf cmake-2.8.11-Darwin64-universal.tar.gz --strip-components=1&lt;br /&gt;
&lt;br /&gt;
 $ CMake\ 2.8-11.app/Contents/bin/cmake --version&lt;br /&gt;
 cmake version 2.8.11&lt;br /&gt;
&lt;br /&gt;
* [{{tool|download|git}} Git] &amp;gt;= 1.7.10&lt;br /&gt;
* [{{tool|download|svn}} Svn] &amp;gt;= 1.7&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
*[[{{tool|logo|cmake}}|x16px]] [{{tool|download|cmake}} CMake] &amp;gt;= 2.8.9&lt;br /&gt;
*[[{{tool|logo|git}}|x16px]] [{{tool|download|git}} Git] &amp;gt;= 1.6.5&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* XCode (for the SDK libs)&lt;br /&gt;
** After installing XCode, install XCode command line developer tools: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
xcode-select --install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* XQuartz - For Mac Os X &amp;gt;= 10.8 ([http://en.wikipedia.org/wiki/OS_X_Mountain_Lion Mountain Lion]) install XQuartz (http://xquartz.macosforge.org) to get X11 (no longer a default in OS X).&lt;br /&gt;
* Qt 4 &amp;gt;= 4.8.5. We recommend you install the following two packages:&lt;br /&gt;
** Download and install [http://download.qt-project.org/official_releases/qt/4.8/4.8.6/qt-opensource-mac-4.8.6-1.dmg qt-opensource-mac-4.8.6-1.dmg]&lt;br /&gt;
** Download and install [http://download.qt-project.org/official_releases/qt/4.8/4.8.6/qt-opensource-mac-4.8.6-1-debug-libs.dmg qt-opensource-mac-4.8.6-1-debug-libs.dmg]&lt;br /&gt;
** For more details [[Documentation/{{documentation/version}}/Developers/Build_Instructions/Prerequisites/Qt#Mac|here]]&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
** Newer Xcode versions (e.g. 4.3.2) use clang as the default compiler and '''clang is not compatible with ITK version 3'''.  You should use ITK version 4 with recent versions of Xcode.&lt;br /&gt;
** Xcode with gcc should ork with either version of ITK.&lt;br /&gt;
** OS X Mountain Lion: In Xcode 4.5 you now need to install command line tools (no longer included by default). Install within Xcode under the Xcode-&amp;gt;Preferences-&amp;gt;Downloads tab (otherwise git svn will give errors). Then you will need to install XQuartz (http://xquartz.macosforge.org) to get X11 (no longer a default in OS X).&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Mac OSX 10.11 (El Capitan)====&lt;br /&gt;
&lt;br /&gt;
XCode up to version 7 is known to work for Slicer compilation. XCode 8 breaks things on several levels for now. &lt;br /&gt;
Remember to install XCode command line tools (see above) if a reinstall for XCode is needed. &lt;br /&gt;
&lt;br /&gt;
The standard Qt4 installers fail on this version and the 4.8.6 source code won't build.  But [http://slicer-devel.65872.n3.nabble.com/incompatible-qt-4-8-6-with-OS-X-El-Capitan-td4035551.html as described on the slicer-devel mailing list] it is possible to install the [https://github.com/Homebrew/formula-patches/blob/master/qt/el-capitan.patch homebrew version of qt4 which patches it to work on El Capitan] (see below).&lt;br /&gt;
&lt;br /&gt;
* Install the '''OS''', '''Xcode''', and '''XQuartz''' (see MacOSX 10.10 above)&lt;br /&gt;
* Install '''Qt4''' by running the following two commands:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
brew install qt4&lt;br /&gt;
xcode-select --install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* TCL does not build correctly on El Capitan as of 2015-12-03, so when building Slicer turn `Slicer_USE_PYTHONQT_WITH_TCL` off.&lt;br /&gt;
&lt;br /&gt;
==== Mac OSX 10.12 (Sierra) ====&lt;br /&gt;
&lt;br /&gt;
Similar to 10.11 (El Capitan), there are new issues with Qt4 (caused by Phonon).&lt;br /&gt;
The GitHub user Cartr [https://github.com/Homebrew/homebrew-core/pull/5216 offered a patch to the brew team], and even though it was not integrated (the homebrew team decided to stop patching their recipe to encourage people to use Qt5), he [https://github.com/cartr/homebrew-qt4 turned his formula into a tap] that can be installed (see below).&lt;br /&gt;
&lt;br /&gt;
Follow instructions for 10.11 ''(Installing Xcode, XQuartz, run without TCL)'' but install '''Qt4''' like shown below instead:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
brew install cartr/qt4/qt&lt;br /&gt;
xcode-select --install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirmed with Xcode: &lt;br /&gt;
* Version 8.1 (8B62) and cmake version 3.4.20151021-g8fbc8e&lt;br /&gt;
* Version 8.3.3 and cmake 3.5.2&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.9 -DSlicer_USE_PYTHONQT_WITH_TCL:BOOL=OFF ../Slicer&lt;br /&gt;
make -j `sysctl -n hw.ncpu`&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Windows ===&lt;br /&gt;
&lt;br /&gt;
==== Common Prerequisites ====&lt;br /&gt;
* [{{tool|download|cmake}} CMake] &amp;gt;= 3.0 (3.7.1 recommended)&lt;br /&gt;
* [{{tool|download|git}} Git] &amp;gt;= 1.7.10&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
*[[{{tool|logo|cmake}}|x16px]]  [{{tool|download|cmake}}  CMake] &amp;gt;= 2.8.10&lt;br /&gt;
*[[{{tool|logo|git}}|x16px]]  [{{tool|download|git}}  Git] &amp;gt;= 1.7.10&lt;br /&gt;
* [https://code.google.com/p/msysgit/downloads/list?can=3 ''Git-X.X.X-preview2013XXXX.exe''] recommended.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
** Use of [http://code.google.com/p/tortoisegit/ TortoiseGit] is optional.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
** {{note}}CMake must be able to find ''git.exe'' and ''patch.exe''. If git is installed in the default location then they may be found there, but if they are not found then either add the folder that contains them to PATH environment variable; or set GIT_EXECUTABLE and Patch_EXECUTABLE as environment variables or as CMake variables at configure time.&lt;br /&gt;
&lt;br /&gt;
* Subversion (SVN) client: any SVN client that has command line tools&lt;br /&gt;
** [http://www.sliksvn.com/en/download SlikSvn] &amp;lt;!-- or [http://www.cygwin.com cygwin's svn client]--&amp;gt;, or&lt;br /&gt;
** [https://tortoisesvn.net/downloads.html TortoiseSVN] - make sure you install ''Command line client tools'' component (disabled by default)&lt;br /&gt;
&lt;br /&gt;
* NSIS (optional): Needed if packaging Slicer - Click [http://nsis.sourceforge.net/Download here] to download. Make sure you install the language packs.&lt;br /&gt;
&lt;br /&gt;
* Qt:&lt;br /&gt;
** Qt5 &amp;lt;b&amp;gt;recommended and officially supported&amp;lt;/b&amp;gt;. Download [https://download.qt.io/official_releases/online_installers/qt-unified-windows-x86-online.exe qt-unified-windows-x86-online.exe] and install Qt along with &amp;lt;tt&amp;gt;qtscript&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;qtwebengine&amp;lt;/tt&amp;gt; components. For building with VS2015, Qt version 5.10.x or older is required. For more details, read [[Documentation/Nightly/Developers/Build Instructions/Prerequisites/Qt5|step-by-step]] guide.&lt;br /&gt;
** Qt 4: will still work until Slicer-4.10 but not officially supported. See details [[Documentation/{{documentation/version}}/Developers/Build_Instructions/Prerequisites/Qt#Windows|here]].&lt;br /&gt;
&lt;br /&gt;
==== Tested and recommended build environment ====&lt;br /&gt;
&lt;br /&gt;
* VS2015&lt;br /&gt;
** Make sure you enable installation of component ''Programming languages / Visual C++ / Common Tools for Visual C++ 2015'' (in some distributions, this option is not enabled by default)&lt;br /&gt;
** Installation of [https://msdn.microsoft.com/en-us/library/mt752379.aspx Cumulative Servicing Release for Microsoft Visual Studio 2015 Update 3 (KB3165756)] is required on some older VS2015 distributions&lt;br /&gt;
* Qt 5.10&lt;br /&gt;
* CMake &amp;gt;= 3.3.1&lt;br /&gt;
&lt;br /&gt;
==== Experimental/deprecated build environments ====&lt;br /&gt;
* [https://visualstudio.microsoft.com/vs/community/ Visual Studio 2017 (Community or any other edition)] with VS2015 build tools (tested, works well)&lt;br /&gt;
** When configuring Visual Studio installer, enable installation of component ''VC++ 2015.3 v14.00 (v140) toolset for desktop''&lt;br /&gt;
** Visual Studio 2015 toolset must be set in CMake: ''Optional toolset to use (argument to -T)'' need to be set to ''v140''&lt;br /&gt;
* [https://www.visualstudio.com/en-us/news/vs2013-community-vs.aspx Visual Studio 2013] with Update 5 (deprecated, should still work)&lt;br /&gt;
** As of [https://github.com/Slicer/Slicer/commit/71602609ce2ae5e473ece392500825ca96213371 commit 7160260]: Slicer compilation is successful, with some caveats.&lt;br /&gt;
** Build Qt 4.8.7 with SSL support using [https://github.com/jcfr/qt-easy-build/tree/4.8.7 qt-easy-build].&lt;br /&gt;
** '''Note: be sure to pick the version of qmake that you built in the earlier steps if applicable (CMake may pick a different qmake, for example if installed with anaconda)'''&lt;br /&gt;
* VS2012 (untested, may work)&lt;br /&gt;
** Use a desktop version such as [http://www.microsoft.com/visualstudio/eng/downloads#d-express-windows-desktop Visual Studio 2012 Express &amp;lt;b&amp;gt;for Windows Desktop&amp;lt;/b&amp;gt;] and remember [http://www.microsoft.com/en-us/download/details.aspx?id=38188 Visual Studio 2012 Update 2]). Do &amp;lt;b&amp;gt;not&amp;lt;/b&amp;gt; use Visual Studio Express 2012 &amp;lt;em&amp;gt;for Windows 8&amp;lt;/em&amp;gt;. You must install [http://msdn.microsoft.com/en-us/library/ms717422.aspx Windows SDK], otherwise CMake will not even find the C compiler during configure. In CMake, choose &amp;lt;tt&amp;gt;Visual Studio 11 Win64&amp;lt;/tt&amp;gt; as generator.&lt;br /&gt;
* VS2010 (untested, probably does not work)&lt;br /&gt;
** [https://www.microsoft.com/visualstudio/en-us/products/2010-editions Microsoft Visual Studio 2010] (Any edition)&lt;br /&gt;
** Make sure to build or install:&lt;br /&gt;
*** Qt 4.8 &lt;br /&gt;
** Make sure to install:&lt;br /&gt;
*** SP1. Click [http://www.microsoft.com/download/en/details.aspx?id=23691 here] to download SP1 and click [http://developer.qt.nokia.com/faq/answer/why_do_all_qt_4.7_applications_crash_when_using_windows_7_x64_w_vs_2010 here] to understand the motivation.&lt;br /&gt;
*** SP1 Compiler update. Click [https://www.microsoft.com/download/en/details.aspx?id=4422 here] to download and [http://slicer-devel.65872.n3.nabble.com/Windows-7-64Bits-Slicer-4-Build-with-VC-2010-problem-tt3730524.html#a3731661 here] to understand the motivation.&lt;br /&gt;
* VS2008 (untested, probably does not work)&lt;br /&gt;
** [https://www.microsoft.com/visualstudio/en-us/products/2008-editions Microsoft Visual Studio 9 2008] (Any edition). [http://go.microsoft.com/?linkid=7729279 VS Express 2008 with SP1 direct link] (functional as of Jan 11, 2014)&lt;br /&gt;
** Make sure to install SP1: Click [http://www.microsoft.com/download/en/details.aspx?id=10986 here] to download SP1 and click [http://massmail.spl.harvard.edu/public-archives/slicer-devel/2012/008206.html here] to understand the motivation.&lt;br /&gt;
*** Make sure to patch VS2008 using the script [https://gist.github.com/jcfr/3c7bef3f8b32f9f6ad4b fix-vc9-redist-manifests.ps1]&lt;br /&gt;
* Cygwin (untested, probably does not work)&lt;br /&gt;
** Cygwin suite (building with cygwin gcc not supported, but the cygwin shell environment can be used to run git, svn, etc).&lt;/div&gt;</summary>
		<author><name>Phcerdan</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Build_Instructions/Prerequisites&amp;diff=60836</id>
		<title>Documentation/Nightly/Developers/Build Instructions/Prerequisites</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Build_Instructions/Prerequisites&amp;diff=60836"/>
		<updated>2019-03-08T18:20:52Z</updated>

		<summary type="html">&lt;p&gt;Phcerdan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{documentation/versioncheck}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== PREREQUISITES ==&lt;br /&gt;
&lt;br /&gt;
For all systems be sure git-lfs is properly installed for use with VTKv9 (required for VTKm checkout)&lt;br /&gt;
&lt;br /&gt;
As of early 2018, Slicer migrated to Qt5. Qt4 support was removed in version 4.11. See instructions at this labs page for the new requirements: https://www.slicer.org/wiki/Documentation/Labs/Qt5-and-VTK8&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Please check that the following tools are installed on your machine.&lt;br /&gt;
&lt;br /&gt;
We try to keep current with the most recent releases of these prerequisites, but sometimes it's critical to use the exact versions specified here.  If you run into issues please do whatever you can to find a combination that works or contact the developer mailing list for suggestions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{mbox&lt;br /&gt;
| type = protection&lt;br /&gt;
| text = Qt libraries are '''required'''. Consider reading [[Documentation/{{documentation/version}}/Developers/Build_Instructions/Prerequisites/Qt|Qt requirements]].&lt;br /&gt;
| image= [[{{tool|logo|qt}}|x40px]]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{mbox&lt;br /&gt;
| type = protection&lt;br /&gt;
| text = CMake is '''required'''.&lt;br /&gt;
| image= [[{{tool|logo|cmake}}|x40px]]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{mbox&lt;br /&gt;
| type = protection&lt;br /&gt;
| text = &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;Git is '''required'''.&lt;br /&gt;
| image= [[{{tool|logo|git}}|x40px]]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{mbox&lt;br /&gt;
| type = protection&lt;br /&gt;
| text = SVN is '''required'''.&lt;br /&gt;
| image= [[{{tool|logo|svn}}|x40px]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
The prerequisites listed below are required to be able to configure/build/package/test Slicer.&lt;br /&gt;
&lt;br /&gt;
=== Linux  ===&lt;br /&gt;
* [{{tool|download|cmake}} CMake] &amp;gt;= 3.13.4&lt;br /&gt;
* [{{tool|download|git}} Git] &amp;gt;= 1.7.10&lt;br /&gt;
* [{{tool|download|svn}} Svn] &amp;gt;= 1.7&lt;br /&gt;
* Qt 5.11: &amp;lt;b&amp;gt;tested and recommended&amp;lt;/b&amp;gt;&lt;br /&gt;
** To build Slicer: install Qt using the distribution package manager.&lt;br /&gt;
** To package and redistribute Slicer: download and execute [https://download.qt.io/official_releases/online_installers/qt-unified-linux-x64-online.run qt-unified-linux-x64-online.run], install Qt, make sure to select &amp;lt;tt&amp;gt;qtscript&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;qtwebengine&amp;lt;/tt&amp;gt; components.&lt;br /&gt;
* GCC suite&lt;br /&gt;
&lt;br /&gt;
==== Debian ====&lt;br /&gt;
&lt;br /&gt;
* Debian squeeze/wheezy/testing(jessie) users, start by pasting the following lines in a terminal&lt;br /&gt;
 sudo apt-get install subversion git-core git-svn&lt;br /&gt;
 sudo apt-get install build-essential libx11-dev libxt-dev libgl1-mesa-dev libosmesa6-dev libglu1-mesa-dev libfontconfig-dev libxrender-dev libncurses5-dev&lt;br /&gt;
 sudo apt-get install cmake&lt;br /&gt;
 sudo apt-get install qt-sdk&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Ubuntu ====&lt;br /&gt;
&lt;br /&gt;
===== Common Prerequisites =====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install subversion git-core git-svn&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install make gcc g++ libx11-dev libxt-dev libgl1-mesa-dev libglu1-mesa-dev libfontconfig-dev libxrender-dev libncurses5-dev&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install libosmesa6-dev  # Only for Ubuntu &amp;lt; 14.04.3&lt;br /&gt;
&lt;br /&gt;
{{remark|red|On Ubuntu 14.04.3 LTS, attempting to install &amp;lt;tt&amp;gt;libosmesa6-dev&amp;lt;/tt&amp;gt; results in an error.&amp;lt;pre&amp;gt;&lt;br /&gt;
The following packages have unmet dependencies:&lt;br /&gt;
 libosmesa6-dev : Depends: libosmesa6 (= 10.1.3-0ubuntu0.4) but it is not going to be installed&lt;br /&gt;
 E: Unable to correct problems, you have held broken packages.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
For more details, see [https://bugs.launchpad.net/ubuntu/+source/mesa-lts-utopic/+bug/1424059 Bug 1424059].}}&lt;br /&gt;
&lt;br /&gt;
{{remark|green|Slicer compiles successfully without that package, but &amp;lt;tt&amp;gt;VTK_OPENGL_HAS_OSMESA&amp;lt;/tt&amp;gt; is disabled.}}&lt;br /&gt;
&lt;br /&gt;
* For Qt5.5 on Ubuntu 16.04&lt;br /&gt;
 sudo apt-get install libgstreamer-plugins-base0.10-dev&lt;br /&gt;
&lt;br /&gt;
===== CMake =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open a terminal and copy the command reported below&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Download stable version of CMake and extract the archive:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install curl&lt;br /&gt;
mkdir ~/Support &amp;amp;&amp;amp; cd ~/Support&lt;br /&gt;
curl -O https://cmake.org/files/v3.13/cmake-3.13.4-Linux-x86_64.tar.gz&lt;br /&gt;
tar -xzvf cmake-3.13.4-Linux-x86_64.tar.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Create symbolic links into &amp;lt;code&amp;gt;~/bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir -p ~/bin&lt;br /&gt;
for name in cmake ctest cpack ccmake cmake-gui; do&lt;br /&gt;
  ln -s ~/Support/cmake-3.13.4-Linux-x86_64/bin/$name ~/bin/$name&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{remark|red|You &amp;lt;b&amp;gt;MUST&amp;lt;/b&amp;gt; download the standard CMake binary because the distributed version of CMake cannot be used to build slicer.&amp;lt;br&amp;gt;&lt;br /&gt;
See [[Documentation/{{documentation/version}}/Developers/FAQ/Building#Why_distributed_CMake_can_not_be_used_on_Ubuntu_12.04_and_above_.3F|here]] for more details.}}&lt;br /&gt;
&lt;br /&gt;
==== CentOS ====&lt;br /&gt;
&lt;br /&gt;
See instructions reported in [https://github.com/Slicer/SlicerBuildEnvironment/blob/master/Docker/qt5-centos7/Dockerfile qt5-centos7/Dockerfile]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
*CentOS user type:&lt;br /&gt;
 yum install make gcc-c++ libX11-devel libXt-devel libXrender-devel libXext-devel libGLU-devel mesa-libOSMesa-devel mesa-libGL-devel mesa-libGLU-devel ncurses&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Todo: This will have to be added in FAQ: Troubleshoot section&lt;br /&gt;
''glx-utils'' provides ''glxgears'' that can be used to test rendering&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== MacOSX ===&lt;br /&gt;
* XCode command line tools must be installed:&lt;br /&gt;
  xcode-select --install&lt;br /&gt;
* El Capitan is what most developers use.&lt;br /&gt;
* CMake 3.12.2 is recommended. Check the minimum required CMake version [https://github.com/Slicer/Slicer/blob/master/CMakeLists.txt#L1 here]&lt;br /&gt;
* Qt 5: &amp;lt;b&amp;gt;tested and recommended&amp;lt;/b&amp;gt;.&lt;br /&gt;
** For building Slicer: download and execute [https://download.qt.io/official_releases/online_installers/qt-unified-mac-x64-online.dmg qt-unified-mac-x64-online.dmg], install Qt 5.10, make sure to select &amp;lt;tt&amp;gt;qtscript&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;qtwebengine&amp;lt;/tt&amp;gt; components.&lt;br /&gt;
** For packaging and redistributing Slicer: build Qt using [https://github.com/jcfr/qt-easy-build#readme qt-easy-build]&lt;br /&gt;
&lt;br /&gt;
====MacOSX 10.9.4 (Mavericks)====&lt;br /&gt;
&lt;br /&gt;
''' (1) Make sure to install this update: http://support.apple.com/kb/DL1754'''&lt;br /&gt;
&lt;br /&gt;
''' (2) Use CMake 3.12.2 - it is known to be working and is supported''' (if you want to use CMake already installed on your system, 2.8.12.2 is known to work on Mac OS X 10.9.5)&lt;br /&gt;
&lt;br /&gt;
* Mac Os X &amp;gt;= 10.5 (Leopard)&lt;br /&gt;
* [{{tool|download|cmake}} CMake] &amp;gt;= 2.8.9&lt;br /&gt;
** For Mac Os X &amp;gt;= 10.8 ([http://en.wikipedia.org/wiki/OS_X_Mountain_Lion Mountain Lion]) and/or recent XCode &amp;gt;= 4.5.X - [{{tool|download|cmake}} CMake] &amp;gt;= 2.8.11 is required. See http://www.cmake.org/files/v2.8/cmake-2.8.11-Darwin64-universal.tar.gz&lt;br /&gt;
&amp;lt;!-- Waiting for the official release, get the release candidate rc1 [http://www.cmake.org/files/v2.8/cmake-2.8.11-rc1-Darwin64-universal.tar.gz here]. For explanation, see [[Documentation/{{documentation/version}}/Developers/Build_Instructions#ld:_framework_not_found_QtWebKit|here]] and [[Documentation/{{documentation/version}}/Developers/Build_Instructions#On_MacOSX_10.8.2C_CMake_hangs_forever|here]]. These versions are also known to work: exact version 20130121-g92bd8 [http://www.cmake.org/files/dev/cmake-2.8.10.20130121-g92bd8-Darwin-universal.tar.gz here] (or version &amp;gt;= 2.8.10.20130220 [http://www.cmake.org/files/dev/?C=M;O=D here]).&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 $ curl -O http://www.cmake.org/files/v2.8/cmake-2.8.11-Darwin64-universal.tar.gz&lt;br /&gt;
 $ tar -xzvf cmake-2.8.11-Darwin64-universal.tar.gz --strip-components=1&lt;br /&gt;
&lt;br /&gt;
 $ CMake\ 2.8-11.app/Contents/bin/cmake --version&lt;br /&gt;
 cmake version 2.8.11&lt;br /&gt;
&lt;br /&gt;
* [{{tool|download|git}} Git] &amp;gt;= 1.7.10&lt;br /&gt;
* [{{tool|download|svn}} Svn] &amp;gt;= 1.7&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
*[[{{tool|logo|cmake}}|x16px]] [{{tool|download|cmake}} CMake] &amp;gt;= 2.8.9&lt;br /&gt;
*[[{{tool|logo|git}}|x16px]] [{{tool|download|git}} Git] &amp;gt;= 1.6.5&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* XCode (for the SDK libs)&lt;br /&gt;
** After installing XCode, install XCode command line developer tools: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
xcode-select --install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* XQuartz - For Mac Os X &amp;gt;= 10.8 ([http://en.wikipedia.org/wiki/OS_X_Mountain_Lion Mountain Lion]) install XQuartz (http://xquartz.macosforge.org) to get X11 (no longer a default in OS X).&lt;br /&gt;
* Qt 4 &amp;gt;= 4.8.5. We recommend you install the following two packages:&lt;br /&gt;
** Download and install [http://download.qt-project.org/official_releases/qt/4.8/4.8.6/qt-opensource-mac-4.8.6-1.dmg qt-opensource-mac-4.8.6-1.dmg]&lt;br /&gt;
** Download and install [http://download.qt-project.org/official_releases/qt/4.8/4.8.6/qt-opensource-mac-4.8.6-1-debug-libs.dmg qt-opensource-mac-4.8.6-1-debug-libs.dmg]&lt;br /&gt;
** For more details [[Documentation/{{documentation/version}}/Developers/Build_Instructions/Prerequisites/Qt#Mac|here]]&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
** Newer Xcode versions (e.g. 4.3.2) use clang as the default compiler and '''clang is not compatible with ITK version 3'''.  You should use ITK version 4 with recent versions of Xcode.&lt;br /&gt;
** Xcode with gcc should ork with either version of ITK.&lt;br /&gt;
** OS X Mountain Lion: In Xcode 4.5 you now need to install command line tools (no longer included by default). Install within Xcode under the Xcode-&amp;gt;Preferences-&amp;gt;Downloads tab (otherwise git svn will give errors). Then you will need to install XQuartz (http://xquartz.macosforge.org) to get X11 (no longer a default in OS X).&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Mac OSX 10.11 (El Capitan)====&lt;br /&gt;
&lt;br /&gt;
XCode up to version 7 is known to work for Slicer compilation. XCode 8 breaks things on several levels for now. &lt;br /&gt;
Remember to install XCode command line tools (see above) if a reinstall for XCode is needed. &lt;br /&gt;
&lt;br /&gt;
The standard Qt4 installers fail on this version and the 4.8.6 source code won't build.  But [http://slicer-devel.65872.n3.nabble.com/incompatible-qt-4-8-6-with-OS-X-El-Capitan-td4035551.html as described on the slicer-devel mailing list] it is possible to install the [https://github.com/Homebrew/formula-patches/blob/master/qt/el-capitan.patch homebrew version of qt4 which patches it to work on El Capitan] (see below).&lt;br /&gt;
&lt;br /&gt;
* Install the '''OS''', '''Xcode''', and '''XQuartz''' (see MacOSX 10.10 above)&lt;br /&gt;
* Install '''Qt4''' by running the following two commands:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
brew install qt4&lt;br /&gt;
xcode-select --install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* TCL does not build correctly on El Capitan as of 2015-12-03, so when building Slicer turn `Slicer_USE_PYTHONQT_WITH_TCL` off.&lt;br /&gt;
&lt;br /&gt;
==== Mac OSX 10.12 (Sierra) ====&lt;br /&gt;
&lt;br /&gt;
Similar to 10.11 (El Capitan), there are new issues with Qt4 (caused by Phonon).&lt;br /&gt;
The GitHub user Cartr [https://github.com/Homebrew/homebrew-core/pull/5216 offered a patch to the brew team], and even though it was not integrated (the homebrew team decided to stop patching their recipe to encourage people to use Qt5), he [https://github.com/cartr/homebrew-qt4 turned his formula into a tap] that can be installed (see below).&lt;br /&gt;
&lt;br /&gt;
Follow instructions for 10.11 ''(Installing Xcode, XQuartz, run without TCL)'' but install '''Qt4''' like shown below instead:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
brew install cartr/qt4/qt&lt;br /&gt;
xcode-select --install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirmed with Xcode: &lt;br /&gt;
* Version 8.1 (8B62) and cmake version 3.4.20151021-g8fbc8e&lt;br /&gt;
* Version 8.3.3 and cmake 3.5.2&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.9 -DSlicer_USE_PYTHONQT_WITH_TCL:BOOL=OFF ../Slicer&lt;br /&gt;
make -j `sysctl -n hw.ncpu`&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Windows ===&lt;br /&gt;
&lt;br /&gt;
==== Common Prerequisites ====&lt;br /&gt;
* [{{tool|download|cmake}} CMake] &amp;gt;= 3.0 (3.7.1 recommended)&lt;br /&gt;
* [{{tool|download|git}} Git] &amp;gt;= 1.7.10&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
*[[{{tool|logo|cmake}}|x16px]]  [{{tool|download|cmake}}  CMake] &amp;gt;= 2.8.10&lt;br /&gt;
*[[{{tool|logo|git}}|x16px]]  [{{tool|download|git}}  Git] &amp;gt;= 1.7.10&lt;br /&gt;
* [https://code.google.com/p/msysgit/downloads/list?can=3 ''Git-X.X.X-preview2013XXXX.exe''] recommended.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
** Use of [http://code.google.com/p/tortoisegit/ TortoiseGit] is optional.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
** {{note}}CMake must be able to find ''git.exe'' and ''patch.exe''. If git is installed in the default location then they may be found there, but if they are not found then either add the folder that contains them to PATH environment variable; or set GIT_EXECUTABLE and Patch_EXECUTABLE as environment variables or as CMake variables at configure time.&lt;br /&gt;
&lt;br /&gt;
* Subversion (SVN) client: any SVN client that has command line tools&lt;br /&gt;
** [http://www.sliksvn.com/en/download SlikSvn] &amp;lt;!-- or [http://www.cygwin.com cygwin's svn client]--&amp;gt;, or&lt;br /&gt;
** [https://tortoisesvn.net/downloads.html TortoiseSVN] - make sure you install ''Command line client tools'' component (disabled by default)&lt;br /&gt;
&lt;br /&gt;
* NSIS (optional): Needed if packaging Slicer - Click [http://nsis.sourceforge.net/Download here] to download. Make sure you install the language packs.&lt;br /&gt;
&lt;br /&gt;
* Qt:&lt;br /&gt;
** Qt5 &amp;lt;b&amp;gt;recommended and officially supported&amp;lt;/b&amp;gt;. Download [https://download.qt.io/official_releases/online_installers/qt-unified-windows-x86-online.exe qt-unified-windows-x86-online.exe] and install Qt along with &amp;lt;tt&amp;gt;qtscript&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;qtwebengine&amp;lt;/tt&amp;gt; components. For building with VS2015, Qt version 5.10.x or older is required. For more details, read [[Documentation/Nightly/Developers/Build Instructions/Prerequisites/Qt5|step-by-step]] guide.&lt;br /&gt;
** Qt 4: will still work until Slicer-4.10 but not officially supported. See details [[Documentation/{{documentation/version}}/Developers/Build_Instructions/Prerequisites/Qt#Windows|here]].&lt;br /&gt;
&lt;br /&gt;
==== Tested and recommended build environment ====&lt;br /&gt;
&lt;br /&gt;
* VS2015&lt;br /&gt;
** Make sure you enable installation of component ''Programming languages / Visual C++ / Common Tools for Visual C++ 2015'' (in some distributions, this option is not enabled by default)&lt;br /&gt;
** Installation of [https://msdn.microsoft.com/en-us/library/mt752379.aspx Cumulative Servicing Release for Microsoft Visual Studio 2015 Update 3 (KB3165756)] is required on some older VS2015 distributions&lt;br /&gt;
* Qt 5.10&lt;br /&gt;
* CMake &amp;gt;= 3.3.1&lt;br /&gt;
&lt;br /&gt;
==== Experimental/deprecated build environments ====&lt;br /&gt;
* [https://visualstudio.microsoft.com/vs/community/ Visual Studio 2017 (Community or any other edition)] with VS2015 build tools (tested, works well)&lt;br /&gt;
** When configuring Visual Studio installer, enable installation of component ''VC++ 2015.3 v14.00 (v140) toolset for desktop''&lt;br /&gt;
** Visual Studio 2015 toolset must be set in CMake: ''Optional toolset to use (argument to -T)'' need to be set to ''v140''&lt;br /&gt;
* [https://www.visualstudio.com/en-us/news/vs2013-community-vs.aspx Visual Studio 2013] with Update 5 (deprecated, should still work)&lt;br /&gt;
** As of [https://github.com/Slicer/Slicer/commit/71602609ce2ae5e473ece392500825ca96213371 commit 7160260]: Slicer compilation is successful, with some caveats.&lt;br /&gt;
** Build Qt 4.8.7 with SSL support using [https://github.com/jcfr/qt-easy-build/tree/4.8.7 qt-easy-build].&lt;br /&gt;
** '''Note: be sure to pick the version of qmake that you built in the earlier steps if applicable (CMake may pick a different qmake, for example if installed with anaconda)'''&lt;br /&gt;
* VS2012 (untested, may work)&lt;br /&gt;
** Use a desktop version such as [http://www.microsoft.com/visualstudio/eng/downloads#d-express-windows-desktop Visual Studio 2012 Express &amp;lt;b&amp;gt;for Windows Desktop&amp;lt;/b&amp;gt;] and remember [http://www.microsoft.com/en-us/download/details.aspx?id=38188 Visual Studio 2012 Update 2]). Do &amp;lt;b&amp;gt;not&amp;lt;/b&amp;gt; use Visual Studio Express 2012 &amp;lt;em&amp;gt;for Windows 8&amp;lt;/em&amp;gt;. You must install [http://msdn.microsoft.com/en-us/library/ms717422.aspx Windows SDK], otherwise CMake will not even find the C compiler during configure. In CMake, choose &amp;lt;tt&amp;gt;Visual Studio 11 Win64&amp;lt;/tt&amp;gt; as generator.&lt;br /&gt;
* VS2010 (untested, probably does not work)&lt;br /&gt;
** [https://www.microsoft.com/visualstudio/en-us/products/2010-editions Microsoft Visual Studio 2010] (Any edition)&lt;br /&gt;
** Make sure to build or install:&lt;br /&gt;
*** Qt 4.8 &lt;br /&gt;
** Make sure to install:&lt;br /&gt;
*** SP1. Click [http://www.microsoft.com/download/en/details.aspx?id=23691 here] to download SP1 and click [http://developer.qt.nokia.com/faq/answer/why_do_all_qt_4.7_applications_crash_when_using_windows_7_x64_w_vs_2010 here] to understand the motivation.&lt;br /&gt;
*** SP1 Compiler update. Click [https://www.microsoft.com/download/en/details.aspx?id=4422 here] to download and [http://slicer-devel.65872.n3.nabble.com/Windows-7-64Bits-Slicer-4-Build-with-VC-2010-problem-tt3730524.html#a3731661 here] to understand the motivation.&lt;br /&gt;
* VS2008 (untested, probably does not work)&lt;br /&gt;
** [https://www.microsoft.com/visualstudio/en-us/products/2008-editions Microsoft Visual Studio 9 2008] (Any edition). [http://go.microsoft.com/?linkid=7729279 VS Express 2008 with SP1 direct link] (functional as of Jan 11, 2014)&lt;br /&gt;
** Make sure to install SP1: Click [http://www.microsoft.com/download/en/details.aspx?id=10986 here] to download SP1 and click [http://massmail.spl.harvard.edu/public-archives/slicer-devel/2012/008206.html here] to understand the motivation.&lt;br /&gt;
*** Make sure to patch VS2008 using the script [https://gist.github.com/jcfr/3c7bef3f8b32f9f6ad4b fix-vc9-redist-manifests.ps1]&lt;br /&gt;
* Cygwin (untested, probably does not work)&lt;br /&gt;
** Cygwin suite (building with cygwin gcc not supported, but the cygwin shell environment can be used to run git, svn, etc).&lt;/div&gt;</summary>
		<author><name>Phcerdan</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Build_Instructions/Prerequisites&amp;diff=60835</id>
		<title>Documentation/Nightly/Developers/Build Instructions/Prerequisites</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Build_Instructions/Prerequisites&amp;diff=60835"/>
		<updated>2019-03-08T18:19:26Z</updated>

		<summary type="html">&lt;p&gt;Phcerdan: Update CMake, remove Qt4&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{documentation/versioncheck}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== PREREQUISITES ==&lt;br /&gt;
&lt;br /&gt;
For all systems be sure git-lfs is properly installed for use with VTKv9 (required for VTKm checkout)&lt;br /&gt;
&lt;br /&gt;
As of early 2018, Slicer migrated to Qt5. See instructions at this labs page for the new requirements: https://www.slicer.org/wiki/Documentation/Labs/Qt5-and-VTK8&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Please check that the following tools are installed on your machine.&lt;br /&gt;
&lt;br /&gt;
We try to keep current with the most recent releases of these prerequisites, but sometimes it's critical to use the exact versions specified here.  If you run into issues please do whatever you can to find a combination that works or contact the developer mailing list for suggestions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
{{mbox&lt;br /&gt;
| type = protection&lt;br /&gt;
| text = Qt libraries are '''required'''. Consider reading [[Documentation/{{documentation/version}}/Developers/Build_Instructions/Prerequisites/Qt|Qt requirements]].&lt;br /&gt;
| image= [[{{tool|logo|qt}}|x40px]]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{mbox&lt;br /&gt;
| type = protection&lt;br /&gt;
| text = CMake is '''required'''.&lt;br /&gt;
| image= [[{{tool|logo|cmake}}|x40px]]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{mbox&lt;br /&gt;
| type = protection&lt;br /&gt;
| text = &amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;Git is '''required'''.&lt;br /&gt;
| image= [[{{tool|logo|git}}|x40px]]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{mbox&lt;br /&gt;
| type = protection&lt;br /&gt;
| text = SVN is '''required'''.&lt;br /&gt;
| image= [[{{tool|logo|svn}}|x40px]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
The prerequisites listed below are required to be able to configure/build/package/test Slicer.&lt;br /&gt;
&lt;br /&gt;
=== Linux  ===&lt;br /&gt;
* [{{tool|download|cmake}} CMake] &amp;gt;= 3.13.4&lt;br /&gt;
* [{{tool|download|git}} Git] &amp;gt;= 1.7.10&lt;br /&gt;
* [{{tool|download|svn}} Svn] &amp;gt;= 1.7&lt;br /&gt;
* Qt 5.11: &amp;lt;b&amp;gt;tested and recommended&amp;lt;/b&amp;gt;&lt;br /&gt;
** To build Slicer: install Qt using the distribution package manager.&lt;br /&gt;
** To package and redistribute Slicer: download and execute [https://download.qt.io/official_releases/online_installers/qt-unified-linux-x64-online.run qt-unified-linux-x64-online.run], install Qt, make sure to select &amp;lt;tt&amp;gt;qtscript&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;qtwebengine&amp;lt;/tt&amp;gt; components.&lt;br /&gt;
* GCC suite&lt;br /&gt;
&lt;br /&gt;
==== Debian ====&lt;br /&gt;
&lt;br /&gt;
* Debian squeeze/wheezy/testing(jessie) users, start by pasting the following lines in a terminal&lt;br /&gt;
 sudo apt-get install subversion git-core git-svn&lt;br /&gt;
 sudo apt-get install build-essential libx11-dev libxt-dev libgl1-mesa-dev libosmesa6-dev libglu1-mesa-dev libfontconfig-dev libxrender-dev libncurses5-dev&lt;br /&gt;
 sudo apt-get install cmake&lt;br /&gt;
 sudo apt-get install qt-sdk&lt;br /&gt;
&lt;br /&gt;
&amp;lt;hr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Ubuntu ====&lt;br /&gt;
&lt;br /&gt;
===== Common Prerequisites =====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install subversion git-core git-svn&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install make gcc g++ libx11-dev libxt-dev libgl1-mesa-dev libglu1-mesa-dev libfontconfig-dev libxrender-dev libncurses5-dev&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install libosmesa6-dev  # Only for Ubuntu &amp;lt; 14.04.3&lt;br /&gt;
&lt;br /&gt;
{{remark|red|On Ubuntu 14.04.3 LTS, attempting to install &amp;lt;tt&amp;gt;libosmesa6-dev&amp;lt;/tt&amp;gt; results in an error.&amp;lt;pre&amp;gt;&lt;br /&gt;
The following packages have unmet dependencies:&lt;br /&gt;
 libosmesa6-dev : Depends: libosmesa6 (= 10.1.3-0ubuntu0.4) but it is not going to be installed&lt;br /&gt;
 E: Unable to correct problems, you have held broken packages.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
For more details, see [https://bugs.launchpad.net/ubuntu/+source/mesa-lts-utopic/+bug/1424059 Bug 1424059].}}&lt;br /&gt;
&lt;br /&gt;
{{remark|green|Slicer compiles successfully without that package, but &amp;lt;tt&amp;gt;VTK_OPENGL_HAS_OSMESA&amp;lt;/tt&amp;gt; is disabled.}}&lt;br /&gt;
&lt;br /&gt;
* For Qt5.5 on Ubuntu 16.04&lt;br /&gt;
 sudo apt-get install libgstreamer-plugins-base0.10-dev&lt;br /&gt;
&lt;br /&gt;
===== CMake =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open a terminal and copy the command reported below&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Download stable version of CMake and extract the archive:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudo apt-get install curl&lt;br /&gt;
mkdir ~/Support &amp;amp;&amp;amp; cd ~/Support&lt;br /&gt;
curl -O https://cmake.org/files/v3.13/cmake-3.13.4-Linux-x86_64.tar.gz&lt;br /&gt;
tar -xzvf cmake-3.13.4-Linux-x86_64.tar.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Create symbolic links into &amp;lt;code&amp;gt;~/bin&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mkdir -p ~/bin&lt;br /&gt;
for name in cmake ctest cpack ccmake cmake-gui; do&lt;br /&gt;
  ln -s ~/Support/cmake-3.13.4-Linux-x86_64/bin/$name ~/bin/$name&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{remark|red|You &amp;lt;b&amp;gt;MUST&amp;lt;/b&amp;gt; download the standard CMake binary because the distributed version of CMake cannot be used to build slicer.&amp;lt;br&amp;gt;&lt;br /&gt;
See [[Documentation/{{documentation/version}}/Developers/FAQ/Building#Why_distributed_CMake_can_not_be_used_on_Ubuntu_12.04_and_above_.3F|here]] for more details.}}&lt;br /&gt;
&lt;br /&gt;
==== CentOS ====&lt;br /&gt;
&lt;br /&gt;
See instructions reported in [https://github.com/Slicer/SlicerBuildEnvironment/blob/master/Docker/qt5-centos7/Dockerfile qt5-centos7/Dockerfile]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
*CentOS user type:&lt;br /&gt;
 yum install make gcc-c++ libX11-devel libXt-devel libXrender-devel libXext-devel libGLU-devel mesa-libOSMesa-devel mesa-libGL-devel mesa-libGLU-devel ncurses&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
Todo: This will have to be added in FAQ: Troubleshoot section&lt;br /&gt;
''glx-utils'' provides ''glxgears'' that can be used to test rendering&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== MacOSX ===&lt;br /&gt;
* XCode command line tools must be installed:&lt;br /&gt;
  xcode-select --install&lt;br /&gt;
* El Capitan is what most developers use.&lt;br /&gt;
* CMake 3.12.2 is recommended. Check the minimum required CMake version [https://github.com/Slicer/Slicer/blob/master/CMakeLists.txt#L1 here]&lt;br /&gt;
* Qt 5: &amp;lt;b&amp;gt;tested and recommended&amp;lt;/b&amp;gt;.&lt;br /&gt;
** For building Slicer: download and execute [https://download.qt.io/official_releases/online_installers/qt-unified-mac-x64-online.dmg qt-unified-mac-x64-online.dmg], install Qt 5.10, make sure to select &amp;lt;tt&amp;gt;qtscript&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;qtwebengine&amp;lt;/tt&amp;gt; components.&lt;br /&gt;
** For packaging and redistributing Slicer: build Qt using [https://github.com/jcfr/qt-easy-build#readme qt-easy-build]&lt;br /&gt;
&lt;br /&gt;
====MacOSX 10.9.4 (Mavericks)====&lt;br /&gt;
&lt;br /&gt;
''' (1) Make sure to install this update: http://support.apple.com/kb/DL1754'''&lt;br /&gt;
&lt;br /&gt;
''' (2) Use CMake 3.12.2 - it is known to be working and is supported''' (if you want to use CMake already installed on your system, 2.8.12.2 is known to work on Mac OS X 10.9.5)&lt;br /&gt;
&lt;br /&gt;
* Mac Os X &amp;gt;= 10.5 (Leopard)&lt;br /&gt;
* [{{tool|download|cmake}} CMake] &amp;gt;= 2.8.9&lt;br /&gt;
** For Mac Os X &amp;gt;= 10.8 ([http://en.wikipedia.org/wiki/OS_X_Mountain_Lion Mountain Lion]) and/or recent XCode &amp;gt;= 4.5.X - [{{tool|download|cmake}} CMake] &amp;gt;= 2.8.11 is required. See http://www.cmake.org/files/v2.8/cmake-2.8.11-Darwin64-universal.tar.gz&lt;br /&gt;
&amp;lt;!-- Waiting for the official release, get the release candidate rc1 [http://www.cmake.org/files/v2.8/cmake-2.8.11-rc1-Darwin64-universal.tar.gz here]. For explanation, see [[Documentation/{{documentation/version}}/Developers/Build_Instructions#ld:_framework_not_found_QtWebKit|here]] and [[Documentation/{{documentation/version}}/Developers/Build_Instructions#On_MacOSX_10.8.2C_CMake_hangs_forever|here]]. These versions are also known to work: exact version 20130121-g92bd8 [http://www.cmake.org/files/dev/cmake-2.8.10.20130121-g92bd8-Darwin-universal.tar.gz here] (or version &amp;gt;= 2.8.10.20130220 [http://www.cmake.org/files/dev/?C=M;O=D here]).&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 $ curl -O http://www.cmake.org/files/v2.8/cmake-2.8.11-Darwin64-universal.tar.gz&lt;br /&gt;
 $ tar -xzvf cmake-2.8.11-Darwin64-universal.tar.gz --strip-components=1&lt;br /&gt;
&lt;br /&gt;
 $ CMake\ 2.8-11.app/Contents/bin/cmake --version&lt;br /&gt;
 cmake version 2.8.11&lt;br /&gt;
&lt;br /&gt;
* [{{tool|download|git}} Git] &amp;gt;= 1.7.10&lt;br /&gt;
* [{{tool|download|svn}} Svn] &amp;gt;= 1.7&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
*[[{{tool|logo|cmake}}|x16px]] [{{tool|download|cmake}} CMake] &amp;gt;= 2.8.9&lt;br /&gt;
*[[{{tool|logo|git}}|x16px]] [{{tool|download|git}} Git] &amp;gt;= 1.6.5&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
* XCode (for the SDK libs)&lt;br /&gt;
** After installing XCode, install XCode command line developer tools: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
xcode-select --install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* XQuartz - For Mac Os X &amp;gt;= 10.8 ([http://en.wikipedia.org/wiki/OS_X_Mountain_Lion Mountain Lion]) install XQuartz (http://xquartz.macosforge.org) to get X11 (no longer a default in OS X).&lt;br /&gt;
* Qt 4 &amp;gt;= 4.8.5. We recommend you install the following two packages:&lt;br /&gt;
** Download and install [http://download.qt-project.org/official_releases/qt/4.8/4.8.6/qt-opensource-mac-4.8.6-1.dmg qt-opensource-mac-4.8.6-1.dmg]&lt;br /&gt;
** Download and install [http://download.qt-project.org/official_releases/qt/4.8/4.8.6/qt-opensource-mac-4.8.6-1-debug-libs.dmg qt-opensource-mac-4.8.6-1-debug-libs.dmg]&lt;br /&gt;
** For more details [[Documentation/{{documentation/version}}/Developers/Build_Instructions/Prerequisites/Qt#Mac|here]]&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
** Newer Xcode versions (e.g. 4.3.2) use clang as the default compiler and '''clang is not compatible with ITK version 3'''.  You should use ITK version 4 with recent versions of Xcode.&lt;br /&gt;
** Xcode with gcc should ork with either version of ITK.&lt;br /&gt;
** OS X Mountain Lion: In Xcode 4.5 you now need to install command line tools (no longer included by default). Install within Xcode under the Xcode-&amp;gt;Preferences-&amp;gt;Downloads tab (otherwise git svn will give errors). Then you will need to install XQuartz (http://xquartz.macosforge.org) to get X11 (no longer a default in OS X).&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Mac OSX 10.11 (El Capitan)====&lt;br /&gt;
&lt;br /&gt;
XCode up to version 7 is known to work for Slicer compilation. XCode 8 breaks things on several levels for now. &lt;br /&gt;
Remember to install XCode command line tools (see above) if a reinstall for XCode is needed. &lt;br /&gt;
&lt;br /&gt;
The standard Qt4 installers fail on this version and the 4.8.6 source code won't build.  But [http://slicer-devel.65872.n3.nabble.com/incompatible-qt-4-8-6-with-OS-X-El-Capitan-td4035551.html as described on the slicer-devel mailing list] it is possible to install the [https://github.com/Homebrew/formula-patches/blob/master/qt/el-capitan.patch homebrew version of qt4 which patches it to work on El Capitan] (see below).&lt;br /&gt;
&lt;br /&gt;
* Install the '''OS''', '''Xcode''', and '''XQuartz''' (see MacOSX 10.10 above)&lt;br /&gt;
* Install '''Qt4''' by running the following two commands:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
brew install qt4&lt;br /&gt;
xcode-select --install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* TCL does not build correctly on El Capitan as of 2015-12-03, so when building Slicer turn `Slicer_USE_PYTHONQT_WITH_TCL` off.&lt;br /&gt;
&lt;br /&gt;
==== Mac OSX 10.12 (Sierra) ====&lt;br /&gt;
&lt;br /&gt;
Similar to 10.11 (El Capitan), there are new issues with Qt4 (caused by Phonon).&lt;br /&gt;
The GitHub user Cartr [https://github.com/Homebrew/homebrew-core/pull/5216 offered a patch to the brew team], and even though it was not integrated (the homebrew team decided to stop patching their recipe to encourage people to use Qt5), he [https://github.com/cartr/homebrew-qt4 turned his formula into a tap] that can be installed (see below).&lt;br /&gt;
&lt;br /&gt;
Follow instructions for 10.11 ''(Installing Xcode, XQuartz, run without TCL)'' but install '''Qt4''' like shown below instead:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
brew install cartr/qt4/qt&lt;br /&gt;
xcode-select --install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Confirmed with Xcode: &lt;br /&gt;
* Version 8.1 (8B62) and cmake version 3.4.20151021-g8fbc8e&lt;br /&gt;
* Version 8.3.3 and cmake 3.5.2&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.9 -DSlicer_USE_PYTHONQT_WITH_TCL:BOOL=OFF ../Slicer&lt;br /&gt;
make -j `sysctl -n hw.ncpu`&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Windows ===&lt;br /&gt;
&lt;br /&gt;
==== Common Prerequisites ====&lt;br /&gt;
* [{{tool|download|cmake}} CMake] &amp;gt;= 3.0 (3.7.1 recommended)&lt;br /&gt;
* [{{tool|download|git}} Git] &amp;gt;= 1.7.10&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
*[[{{tool|logo|cmake}}|x16px]]  [{{tool|download|cmake}}  CMake] &amp;gt;= 2.8.10&lt;br /&gt;
*[[{{tool|logo|git}}|x16px]]  [{{tool|download|git}}  Git] &amp;gt;= 1.7.10&lt;br /&gt;
* [https://code.google.com/p/msysgit/downloads/list?can=3 ''Git-X.X.X-preview2013XXXX.exe''] recommended.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
** Use of [http://code.google.com/p/tortoisegit/ TortoiseGit] is optional.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
** {{note}}CMake must be able to find ''git.exe'' and ''patch.exe''. If git is installed in the default location then they may be found there, but if they are not found then either add the folder that contains them to PATH environment variable; or set GIT_EXECUTABLE and Patch_EXECUTABLE as environment variables or as CMake variables at configure time.&lt;br /&gt;
&lt;br /&gt;
* Subversion (SVN) client: any SVN client that has command line tools&lt;br /&gt;
** [http://www.sliksvn.com/en/download SlikSvn] &amp;lt;!-- or [http://www.cygwin.com cygwin's svn client]--&amp;gt;, or&lt;br /&gt;
** [https://tortoisesvn.net/downloads.html TortoiseSVN] - make sure you install ''Command line client tools'' component (disabled by default)&lt;br /&gt;
&lt;br /&gt;
* NSIS (optional): Needed if packaging Slicer - Click [http://nsis.sourceforge.net/Download here] to download. Make sure you install the language packs.&lt;br /&gt;
&lt;br /&gt;
* Qt:&lt;br /&gt;
** Qt5 &amp;lt;b&amp;gt;recommended and officially supported&amp;lt;/b&amp;gt;. Download [https://download.qt.io/official_releases/online_installers/qt-unified-windows-x86-online.exe qt-unified-windows-x86-online.exe] and install Qt along with &amp;lt;tt&amp;gt;qtscript&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;qtwebengine&amp;lt;/tt&amp;gt; components. For building with VS2015, Qt version 5.10.x or older is required. For more details, read [[Documentation/Nightly/Developers/Build Instructions/Prerequisites/Qt5|step-by-step]] guide.&lt;br /&gt;
** Qt 4: will still work until Slicer-4.10 but not officially supported. See details [[Documentation/{{documentation/version}}/Developers/Build_Instructions/Prerequisites/Qt#Windows|here]].&lt;br /&gt;
&lt;br /&gt;
==== Tested and recommended build environment ====&lt;br /&gt;
&lt;br /&gt;
* VS2015&lt;br /&gt;
** Make sure you enable installation of component ''Programming languages / Visual C++ / Common Tools for Visual C++ 2015'' (in some distributions, this option is not enabled by default)&lt;br /&gt;
** Installation of [https://msdn.microsoft.com/en-us/library/mt752379.aspx Cumulative Servicing Release for Microsoft Visual Studio 2015 Update 3 (KB3165756)] is required on some older VS2015 distributions&lt;br /&gt;
* Qt 5.10&lt;br /&gt;
* CMake &amp;gt;= 3.3.1&lt;br /&gt;
&lt;br /&gt;
==== Experimental/deprecated build environments ====&lt;br /&gt;
* [https://visualstudio.microsoft.com/vs/community/ Visual Studio 2017 (Community or any other edition)] with VS2015 build tools (tested, works well)&lt;br /&gt;
** When configuring Visual Studio installer, enable installation of component ''VC++ 2015.3 v14.00 (v140) toolset for desktop''&lt;br /&gt;
** Visual Studio 2015 toolset must be set in CMake: ''Optional toolset to use (argument to -T)'' need to be set to ''v140''&lt;br /&gt;
* [https://www.visualstudio.com/en-us/news/vs2013-community-vs.aspx Visual Studio 2013] with Update 5 (deprecated, should still work)&lt;br /&gt;
** As of [https://github.com/Slicer/Slicer/commit/71602609ce2ae5e473ece392500825ca96213371 commit 7160260]: Slicer compilation is successful, with some caveats.&lt;br /&gt;
** Build Qt 4.8.7 with SSL support using [https://github.com/jcfr/qt-easy-build/tree/4.8.7 qt-easy-build].&lt;br /&gt;
** '''Note: be sure to pick the version of qmake that you built in the earlier steps if applicable (CMake may pick a different qmake, for example if installed with anaconda)'''&lt;br /&gt;
* VS2012 (untested, may work)&lt;br /&gt;
** Use a desktop version such as [http://www.microsoft.com/visualstudio/eng/downloads#d-express-windows-desktop Visual Studio 2012 Express &amp;lt;b&amp;gt;for Windows Desktop&amp;lt;/b&amp;gt;] and remember [http://www.microsoft.com/en-us/download/details.aspx?id=38188 Visual Studio 2012 Update 2]). Do &amp;lt;b&amp;gt;not&amp;lt;/b&amp;gt; use Visual Studio Express 2012 &amp;lt;em&amp;gt;for Windows 8&amp;lt;/em&amp;gt;. You must install [http://msdn.microsoft.com/en-us/library/ms717422.aspx Windows SDK], otherwise CMake will not even find the C compiler during configure. In CMake, choose &amp;lt;tt&amp;gt;Visual Studio 11 Win64&amp;lt;/tt&amp;gt; as generator.&lt;br /&gt;
* VS2010 (untested, probably does not work)&lt;br /&gt;
** [https://www.microsoft.com/visualstudio/en-us/products/2010-editions Microsoft Visual Studio 2010] (Any edition)&lt;br /&gt;
** Make sure to build or install:&lt;br /&gt;
*** Qt 4.8 &lt;br /&gt;
** Make sure to install:&lt;br /&gt;
*** SP1. Click [http://www.microsoft.com/download/en/details.aspx?id=23691 here] to download SP1 and click [http://developer.qt.nokia.com/faq/answer/why_do_all_qt_4.7_applications_crash_when_using_windows_7_x64_w_vs_2010 here] to understand the motivation.&lt;br /&gt;
*** SP1 Compiler update. Click [https://www.microsoft.com/download/en/details.aspx?id=4422 here] to download and [http://slicer-devel.65872.n3.nabble.com/Windows-7-64Bits-Slicer-4-Build-with-VC-2010-problem-tt3730524.html#a3731661 here] to understand the motivation.&lt;br /&gt;
* VS2008 (untested, probably does not work)&lt;br /&gt;
** [https://www.microsoft.com/visualstudio/en-us/products/2008-editions Microsoft Visual Studio 9 2008] (Any edition). [http://go.microsoft.com/?linkid=7729279 VS Express 2008 with SP1 direct link] (functional as of Jan 11, 2014)&lt;br /&gt;
** Make sure to install SP1: Click [http://www.microsoft.com/download/en/details.aspx?id=10986 here] to download SP1 and click [http://massmail.spl.harvard.edu/public-archives/slicer-devel/2012/008206.html here] to understand the motivation.&lt;br /&gt;
*** Make sure to patch VS2008 using the script [https://gist.github.com/jcfr/3c7bef3f8b32f9f6ad4b fix-vc9-redist-manifests.ps1]&lt;br /&gt;
* Cygwin (untested, probably does not work)&lt;br /&gt;
** Cygwin suite (building with cygwin gcc not supported, but the cygwin shell environment can be used to run git, svn, etc).&lt;/div&gt;</summary>
		<author><name>Phcerdan</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/ITK4-to-ITK5&amp;diff=60834</id>
		<title>Documentation/Nightly/Developers/Tutorials/MigrationGuide/ITK4-to-ITK5</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/ITK4-to-ITK5&amp;diff=60834"/>
		<updated>2019-03-08T00:11:18Z</updated>

		<summary type="html">&lt;p&gt;Phcerdan: /* Dead code after update to Qt &amp;gt;= 5.6.0 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Transition from ITK4 to ITK5==&lt;br /&gt;
This section lists categories of code changes necessary to build Slicer with ITK 5. Each category has a short description, an example error message, a suggested upgrade path, and references to relevant commits.&lt;br /&gt;
&lt;br /&gt;
Referencing this list might be helpful if Slicer extensions require updates to be compatible with ITK 5.&lt;br /&gt;
&lt;br /&gt;
Also check the ITK migration guide if more info is needed:&lt;br /&gt;
 * https://github.com/InsightSoftwareConsortium/ITK/blob/master/Documentation/ITK5MigrationGuide.md (ITKv5 Migration Guide)&lt;br /&gt;
&lt;br /&gt;
===itkMultiThreader refactor===&lt;br /&gt;
&lt;br /&gt;
Replace lines like:&lt;br /&gt;
  #include &amp;lt;itkMultiThreader.h&amp;gt;&lt;br /&gt;
  itk::MultiThreader::Pointer ProcessingThreader;&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
  #include &amp;lt;itkPlatformMultiThreader.h&amp;gt;&lt;br /&gt;
  itk::PlatformMultiThreader::Pointer ProcessingThreader;&lt;br /&gt;
&lt;br /&gt;
===SimpleFastMutexLock, FastMutexLock and MutexLock are deprecated===&lt;br /&gt;
&lt;br /&gt;
Instead use &amp;lt;tt&amp;gt;std::mutex&amp;lt;/tt&amp;gt; available in C++11&lt;br /&gt;
&lt;br /&gt;
Replace:&lt;br /&gt;
  #include &amp;quot;itkSimpleFastMutexLock.h&amp;quot;&lt;br /&gt;
  #include &amp;quot;itkFastMutexLock.h&amp;quot;&lt;br /&gt;
  #include &amp;quot;itkMutexLock.h&amp;quot;&lt;br /&gt;
  SimpleFastMutexLock&lt;br /&gt;
  FastMutexLock&lt;br /&gt;
  MutexLock&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
  #include &amp;lt;mutex&amp;gt;&lt;br /&gt;
  std::mutex&lt;br /&gt;
&lt;br /&gt;
===Dead code after update to Qt &amp;gt;= 5.6.0===&lt;br /&gt;
&lt;br /&gt;
Remove any branch checking of QT_VERSION lesser than 5.6.0&lt;br /&gt;
  #if(QT_VERSION &amp;lt; QT_VERSION_CHECKS(5, 6, 0))&lt;br /&gt;
  // Modern Qt code&lt;br /&gt;
  #include &amp;lt;QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
  #else&lt;br /&gt;
  // Dead code&lt;br /&gt;
  #include &amp;lt;QtUiPlugin/QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
  class Q_SLICER_MODULE_SEGMENTATIONS_WIDGETS_PLUGINS_EXPORT qSlicerSegmentationsModuleWidgetsAbstractPlugin&lt;br /&gt;
      : public QDesignerCustomWidgetInterface&lt;br /&gt;
  {&lt;br /&gt;
  #if (QT_VERSION &amp;gt;= QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
    Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetInterface&amp;quot;)&lt;br /&gt;
  #endif&lt;br /&gt;
    Q_INTERFACES(QDesignerCustomWidgetInterface);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
After cleaning:&lt;br /&gt;
  #include &amp;lt;QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
  class Q_SLICER_MODULE_SEGMENTATIONS_WIDGETS_PLUGINS_EXPORT qSlicerSegmentationsModuleWidgetsAbstractPlugin&lt;br /&gt;
      : public QDesignerCustomWidgetInterface&lt;br /&gt;
  {&lt;br /&gt;
    Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetInterface&amp;quot;)&lt;br /&gt;
    Q_INTERFACES(QDesignerCustomWidgetInterface);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
====Python====&lt;br /&gt;
&lt;br /&gt;
This migration guide points becomes obsolete:&lt;br /&gt;
https://www.slicer.org/wiki/Documentation/Nightly/Developers/Tutorials/MigrationGuide#Qt5:_Fix_error:_.E2.80.98class_QHeaderView.E2.80.99_has_no_member_named_.E2.80.98setResizeMode.E2.80.99&lt;br /&gt;
&lt;br /&gt;
Only Qt5 needs to be supported, so the following code can be simplified:&lt;br /&gt;
&lt;br /&gt;
Before:&lt;br /&gt;
  _setSectionResizeMode(self.horizontalHeader(), 0, qt.QHeaderView.Stretch)&lt;br /&gt;
  def _setSectionResizeMode(header, *args, **kwargs):&lt;br /&gt;
    if version.parse(qt.Qt.qVersion()) &amp;lt; version.parse(&amp;quot;5.0.0&amp;quot;):&lt;br /&gt;
      header.setResizeMode(*args, **kwargs)&lt;br /&gt;
    else:&lt;br /&gt;
      header.setSectionResizeMode(*args, **kwargs)&lt;br /&gt;
&lt;br /&gt;
After:&lt;br /&gt;
  self.horizontalHeader(0, qt.QHeaderView.Stretch)&lt;/div&gt;</summary>
		<author><name>Phcerdan</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/ITK4-to-ITK5&amp;diff=60833</id>
		<title>Documentation/Nightly/Developers/Tutorials/MigrationGuide/ITK4-to-ITK5</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/ITK4-to-ITK5&amp;diff=60833"/>
		<updated>2019-03-08T00:02:47Z</updated>

		<summary type="html">&lt;p&gt;Phcerdan: /* Dead code after update to Qt &amp;gt;= 5.6.0 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Transition from ITK4 to ITK5==&lt;br /&gt;
This section lists categories of code changes necessary to build Slicer with ITK 5. Each category has a short description, an example error message, a suggested upgrade path, and references to relevant commits.&lt;br /&gt;
&lt;br /&gt;
Referencing this list might be helpful if Slicer extensions require updates to be compatible with ITK 5.&lt;br /&gt;
&lt;br /&gt;
Also check the ITK migration guide if more info is needed:&lt;br /&gt;
 * https://github.com/InsightSoftwareConsortium/ITK/blob/master/Documentation/ITK5MigrationGuide.md (ITKv5 Migration Guide)&lt;br /&gt;
&lt;br /&gt;
===itkMultiThreader refactor===&lt;br /&gt;
&lt;br /&gt;
Replace lines like:&lt;br /&gt;
  #include &amp;lt;itkMultiThreader.h&amp;gt;&lt;br /&gt;
  itk::MultiThreader::Pointer ProcessingThreader;&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
  #include &amp;lt;itkPlatformMultiThreader.h&amp;gt;&lt;br /&gt;
  itk::PlatformMultiThreader::Pointer ProcessingThreader;&lt;br /&gt;
&lt;br /&gt;
===SimpleFastMutexLock, FastMutexLock and MutexLock are deprecated===&lt;br /&gt;
&lt;br /&gt;
Instead use &amp;lt;tt&amp;gt;std::mutex&amp;lt;/tt&amp;gt; available in C++11&lt;br /&gt;
&lt;br /&gt;
Replace:&lt;br /&gt;
  #include &amp;quot;itkSimpleFastMutexLock.h&amp;quot;&lt;br /&gt;
  #include &amp;quot;itkFastMutexLock.h&amp;quot;&lt;br /&gt;
  #include &amp;quot;itkMutexLock.h&amp;quot;&lt;br /&gt;
  SimpleFastMutexLock&lt;br /&gt;
  FastMutexLock&lt;br /&gt;
  MutexLock&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
  #include &amp;lt;mutex&amp;gt;&lt;br /&gt;
  std::mutex&lt;br /&gt;
&lt;br /&gt;
===Dead code after update to Qt &amp;gt;= 5.6.0===&lt;br /&gt;
&lt;br /&gt;
Remove any branch checking of QT_VERSION lesser than 5.6.0&lt;br /&gt;
  #if(QT_VERSION &amp;lt; QT_VERSION_CHECKS(5, 6, 0))&lt;br /&gt;
  // Modern Qt code&lt;br /&gt;
  #include &amp;lt;QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
  #else&lt;br /&gt;
  // Dead code&lt;br /&gt;
  #include &amp;lt;QtUiPlugin/QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
  class Q_SLICER_MODULE_SEGMENTATIONS_WIDGETS_PLUGINS_EXPORT qSlicerSegmentationsModuleWidgetsAbstractPlugin&lt;br /&gt;
      : public QDesignerCustomWidgetInterface&lt;br /&gt;
  {&lt;br /&gt;
  #if (QT_VERSION &amp;gt;= QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
    Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetInterface&amp;quot;)&lt;br /&gt;
  #endif&lt;br /&gt;
    Q_INTERFACES(QDesignerCustomWidgetInterface);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
After cleaning:&lt;br /&gt;
  #include &amp;lt;QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
  class Q_SLICER_MODULE_SEGMENTATIONS_WIDGETS_PLUGINS_EXPORT qSlicerSegmentationsModuleWidgetsAbstractPlugin&lt;br /&gt;
      : public QDesignerCustomWidgetInterface&lt;br /&gt;
  {&lt;br /&gt;
    Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetInterface&amp;quot;)&lt;br /&gt;
    Q_INTERFACES(QDesignerCustomWidgetInterface);&lt;br /&gt;
  }&lt;/div&gt;</summary>
		<author><name>Phcerdan</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/ITK4-to-ITK5&amp;diff=60832</id>
		<title>Documentation/Nightly/Developers/Tutorials/MigrationGuide/ITK4-to-ITK5</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/ITK4-to-ITK5&amp;diff=60832"/>
		<updated>2019-03-07T23:53:33Z</updated>

		<summary type="html">&lt;p&gt;Phcerdan: Dead code after update to Qt &amp;gt; 5.6.0&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Transition from ITK4 to ITK5==&lt;br /&gt;
This section lists categories of code changes necessary to build Slicer with ITK 5. Each category has a short description, an example error message, a suggested upgrade path, and references to relevant commits.&lt;br /&gt;
&lt;br /&gt;
Referencing this list might be helpful if Slicer extensions require updates to be compatible with ITK 5.&lt;br /&gt;
&lt;br /&gt;
Also check the ITK migration guide if more info is needed:&lt;br /&gt;
 * https://github.com/InsightSoftwareConsortium/ITK/blob/master/Documentation/ITK5MigrationGuide.md (ITKv5 Migration Guide)&lt;br /&gt;
&lt;br /&gt;
===itkMultiThreader refactor===&lt;br /&gt;
&lt;br /&gt;
Replace lines like:&lt;br /&gt;
  #include &amp;lt;itkMultiThreader.h&amp;gt;&lt;br /&gt;
  itk::MultiThreader::Pointer ProcessingThreader;&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
  #include &amp;lt;itkPlatformMultiThreader.h&amp;gt;&lt;br /&gt;
  itk::PlatformMultiThreader::Pointer ProcessingThreader;&lt;br /&gt;
&lt;br /&gt;
===SimpleFastMutexLock, FastMutexLock and MutexLock are deprecated===&lt;br /&gt;
&lt;br /&gt;
Instead use &amp;lt;tt&amp;gt;std::mutex&amp;lt;/tt&amp;gt; available in C++11&lt;br /&gt;
&lt;br /&gt;
Replace:&lt;br /&gt;
  #include &amp;quot;itkSimpleFastMutexLock.h&amp;quot;&lt;br /&gt;
  #include &amp;quot;itkFastMutexLock.h&amp;quot;&lt;br /&gt;
  #include &amp;quot;itkMutexLock.h&amp;quot;&lt;br /&gt;
  SimpleFastMutexLock&lt;br /&gt;
  FastMutexLock&lt;br /&gt;
  MutexLock&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
  #include &amp;lt;mutex&amp;gt;&lt;br /&gt;
  std::mutex&lt;br /&gt;
&lt;br /&gt;
===Dead code after update to Qt &amp;gt;= 5.6.0===&lt;br /&gt;
&lt;br /&gt;
Remove any branch checking of QT_VERSION lesser than 5.6.0&lt;br /&gt;
  #if(QT_VERSION &amp;lt; QT_VERSION_CHECKS(5, 6, 0))&lt;br /&gt;
  // Modern Qt code&lt;br /&gt;
  #include &amp;lt;QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
  #else&lt;br /&gt;
  // Dead code&lt;br /&gt;
  #include &amp;lt;QtUiPlugin/QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
  #endif&lt;br /&gt;
After cleaning:&lt;br /&gt;
  #include &amp;lt;QDesignerCustomWidgetInterface&amp;gt;&lt;/div&gt;</summary>
		<author><name>Phcerdan</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/ITK4-to-ITK5&amp;diff=60829</id>
		<title>Documentation/Nightly/Developers/Tutorials/MigrationGuide/ITK4-to-ITK5</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/ITK4-to-ITK5&amp;diff=60829"/>
		<updated>2019-03-06T00:50:57Z</updated>

		<summary type="html">&lt;p&gt;Phcerdan: Created page with &amp;quot;==Transition from ITK4 to ITK5== This section lists categories of code changes necessary to build Slicer with ITK 5. Each category has a short description, an example error me...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Transition from ITK4 to ITK5==&lt;br /&gt;
This section lists categories of code changes necessary to build Slicer with ITK 5. Each category has a short description, an example error message, a suggested upgrade path, and references to relevant commits.&lt;br /&gt;
&lt;br /&gt;
Referencing this list might be helpful if Slicer extensions require updates to be compatible with ITK 5.&lt;br /&gt;
&lt;br /&gt;
Also check the ITK migration guide if more info is needed:&lt;br /&gt;
 * https://github.com/InsightSoftwareConsortium/ITK/blob/master/Documentation/ITK5MigrationGuide.md (ITKv5 Migration Guide)&lt;br /&gt;
&lt;br /&gt;
===itkMultiThreader refactor===&lt;br /&gt;
&lt;br /&gt;
Replace lines like:&lt;br /&gt;
  #include &amp;lt;itkMultiThreader.h&amp;gt;&lt;br /&gt;
  itk::MultiThreader::Pointer ProcessingThreader;&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
  #include &amp;lt;itkPlatformMultiThreader.h&amp;gt;&lt;br /&gt;
  itk::PlatformMultiThreader::Pointer ProcessingThreader;&lt;br /&gt;
&lt;br /&gt;
===SimpleFastMutexLock, FastMutexLock and MutexLock are deprecated===&lt;br /&gt;
&lt;br /&gt;
Instead use &amp;lt;tt&amp;gt;std::mutex&amp;lt;/tt&amp;gt; available in C++11&lt;br /&gt;
&lt;br /&gt;
Replace:&lt;br /&gt;
  #include &amp;quot;itkSimpleFastMutexLock.h&amp;quot;&lt;br /&gt;
  #include &amp;quot;itkFastMutexLock.h&amp;quot;&lt;br /&gt;
  #include &amp;quot;itkMutexLock.h&amp;quot;&lt;br /&gt;
  SimpleFastMutexLock&lt;br /&gt;
  FastMutexLock&lt;br /&gt;
  MutexLock&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
  #include &amp;lt;mutex&amp;gt;&lt;br /&gt;
  std::mutex&lt;/div&gt;</summary>
		<author><name>Phcerdan</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide&amp;diff=60828</id>
		<title>Documentation/Nightly/Developers/Tutorials/MigrationGuide</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide&amp;diff=60828"/>
		<updated>2019-03-05T23:40:13Z</updated>

		<summary type="html">&lt;p&gt;Phcerdan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{documentation/versioncheck}}&amp;lt;/noinclude&amp;gt;&amp;lt;includeonly&amp;gt;[[Documentation/{{documentation/version}}/Developers/Tutorials/MigrationGuide|Migration Guide]]&amp;lt;br&amp;gt;&lt;br /&gt;
: How to update Slicer extension code following breaking changes in Slicer or dependent toolkits (VTK, ITK, Qt, ...)&lt;br /&gt;
&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&amp;lt;span style=&amp;quot;color: #555555; font-size: 18px; font-weight: bold;&amp;quot; id=&amp;quot;Source&amp;quot;&amp;gt;Migration Guide&amp;lt;/span&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
* [[Documentation/Nightly/Developers/Tutorials/MigrationGuide/Slicer50|Work-in-progress: Transition plans for Slicer 4.10, and major changes in Slicer 5.0]]&lt;br /&gt;
&lt;br /&gt;
{{:Documentation/Nightly/Developers/Tutorials/MigrationGuide/Slicer}}&lt;br /&gt;
{{:Documentation/Nightly/Developers/Tutorials/MigrationGuide/SlicerExtension}}&lt;br /&gt;
{{:Documentation/Nightly/Developers/Tutorials/MigrationGuide/VTK7-Qt4-to-VTK8-Qt5}}&lt;br /&gt;
{{:Documentation/Nightly/Developers/Tutorials/MigrationGuide/VTK6-to-VTK7}}&lt;br /&gt;
{{:Documentation/Nightly/Developers/Tutorials/MigrationGuide/VTK5-to-VTK6}}&lt;br /&gt;
{{:Documentation/Nightly/Developers/Tutorials/MigrationGuide/ITK4-to-ITK5}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Phcerdan</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Fortran&amp;diff=59454</id>
		<title>Documentation/Nightly/Developers/Fortran</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Fortran&amp;diff=59454"/>
		<updated>2018-09-19T22:35:37Z</updated>

		<summary type="html">&lt;p&gt;Phcerdan: /* macOS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Linux ===&lt;br /&gt;
Install a fortran compiler with the package manager, like ''gfortran''.&lt;br /&gt;
&lt;br /&gt;
=== macOS ===&lt;br /&gt;
&lt;br /&gt;
- Install Miniconda - See https://conda.io/miniconda.html&lt;br /&gt;
  ./Miniconda3-latest-MacOSX-x86_64.sh -p /Volumes/Dashboards/Support/miniconda3/&lt;br /&gt;
  Do you wish the installer to prepend the Miniconda3 install location&lt;br /&gt;
  Answered NO&lt;br /&gt;
- To activate of base env.&lt;br /&gt;
  source /Volumes/Dashboards/Support/miniconda3/bin/activate&lt;br /&gt;
&lt;br /&gt;
- Add conda-forge&lt;br /&gt;
  conda config --add channels conda-forge&lt;br /&gt;
&lt;br /&gt;
-Then create gfortran-env and install gfortran&lt;br /&gt;
  conda create -n gfortran-env&lt;br /&gt;
  conda activate gfortran-env&lt;br /&gt;
  conda install gfortran_osx-64&lt;br /&gt;
&lt;br /&gt;
Before packaging, we have to fix the installed gfortran libraries with the following script: [https://gist.github.com/phcerdan/146de9398052335d8a76c5b0070715a6 fix_gfortran_lib_rpath.sh].&lt;br /&gt;
&lt;br /&gt;
The script substitutes ''@rpath'' with the needed full paths. Requires ''atool'' and ''install_name_tool''.&lt;br /&gt;
&lt;br /&gt;
=== Windows ===&lt;br /&gt;
&lt;br /&gt;
Install Flang, a fortran compiler targeting llvm: [https://scikit-ci-addons.readthedocs.io/en/latest/addons.html#install-flang-ps1 scikit-ci-addons]&lt;/div&gt;</summary>
		<author><name>Phcerdan</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Fortran&amp;diff=59422</id>
		<title>Documentation/Nightly/Developers/Fortran</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Fortran&amp;diff=59422"/>
		<updated>2018-09-13T18:07:37Z</updated>

		<summary type="html">&lt;p&gt;Phcerdan: /* MacOS */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== MacOS ===&lt;br /&gt;
&lt;br /&gt;
Script to clean gfortran libraries. It substitutes @rpath with full paths.&lt;br /&gt;
[https://gist.github.com/phcerdan/146de9398052335d8a76c5b0070715a6 fix_gfortran_lib_rpath.sh]&lt;/div&gt;</summary>
		<author><name>Phcerdan</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Fortran&amp;diff=59421</id>
		<title>Documentation/Nightly/Developers/Fortran</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Fortran&amp;diff=59421"/>
		<updated>2018-09-13T18:06:27Z</updated>

		<summary type="html">&lt;p&gt;Phcerdan: /* Overview */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== MacOS ===&lt;br /&gt;
&lt;br /&gt;
Script to clean gfortran libraries. It substitutes @rpath with full paths.&lt;br /&gt;
&lt;br /&gt;
https://gist.github.com/phcerdan/146de9398052335d8a76c5b0070715a6&lt;/div&gt;</summary>
		<author><name>Phcerdan</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Fortran&amp;diff=59420</id>
		<title>Documentation/Nightly/Developers/Fortran</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Fortran&amp;diff=59420"/>
		<updated>2018-09-13T18:01:53Z</updated>

		<summary type="html">&lt;p&gt;Phcerdan: Add fortran gist&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
&lt;br /&gt;
Script to clean gfortran libraries. It substitutes @rpath with full paths.&lt;br /&gt;
&lt;br /&gt;
https://gist.github.com/phcerdan/146de9398052335d8a76c5b0070715a6&lt;/div&gt;</summary>
		<author><name>Phcerdan</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Build_system&amp;diff=59419</id>
		<title>Documentation/Nightly/Developers/Build system</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Build_system&amp;diff=59419"/>
		<updated>2018-09-13T18:00:09Z</updated>

		<summary type="html">&lt;p&gt;Phcerdan: Add fortran&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{documentation/versioncheck}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
Leveraging the [http://www.cmake.org/cmake/help/v2.8.8/cmake.html#module:ExternalProject ExternalProject] module provided by [[{{tool|logo|cmake}}|x16px]] [{{tool|homepage|cmake}} CMake], Slicer SuperBuild system allows developers to quickly install and configure the multiple open-source packages and libraries it depends on.&lt;br /&gt;
&lt;br /&gt;
;[[Documentation/{{documentation/version}}/Developers/Versioning|Versioning]]&lt;br /&gt;
: Convention to name Slicer packages.&lt;br /&gt;
&lt;br /&gt;
;[[Documentation/{{documentation/version}}/Developers/ReleaseProcess|Release Process]]&lt;br /&gt;
: Step-by-step guide to create Slicer release&lt;br /&gt;
 &lt;br /&gt;
;[[Documentation/{{documentation/version}}/Developers/Factory|Factory description]]&lt;br /&gt;
: Current configuration of Slicer's factory machines.&lt;br /&gt;
&lt;br /&gt;
;[[Documentation/{{documentation/version}}/Developers/Build_ExtensionsIndex|Build ExtensionsIndex]]&lt;br /&gt;
: How to build an ExtensionsIndex (collection of extension description files) ?&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
;[[Documentation/{{documentation/version}}/Developers/FactoryDashboardSetup |Factory Dashboard setup]]&lt;br /&gt;
: Provide a general overview of the slicer application and extensions dashboard script organization&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
;[[Documentation/{{documentation/version}}/Developers/Build system/Qt resource files|Qt resource files]]&lt;br /&gt;
: Describes the &amp;lt;code&amp;gt;genqrc.py&amp;lt;/code&amp;gt; tool for automatic generation/updating of Qt resource scripts.&lt;br /&gt;
&lt;br /&gt;
;[[Documentation/{{documentation/version}}/Developers/Build system/SlicerBot|SlicerBot]]&lt;br /&gt;
: Describes the SlicerBot and how a machine can be become a SlicerBot.&lt;br /&gt;
&lt;br /&gt;
;[[Documentation/Nightly/Developers/Tutorials/DashboardSetup| Dashboard Setup]]&lt;br /&gt;
: Describes how to setup a Slicer dashboard.&lt;br /&gt;
&lt;br /&gt;
;[[Documentation/Nightly/Developers/ProjectForks| Project Forks]]&lt;br /&gt;
: Guidelines on how to manage Slicer specific forks&lt;br /&gt;
&lt;br /&gt;
;[[Documentation/Nightly/Developers/Fortran| Fortran]]&lt;br /&gt;
: How to package applications which depends on Fortran&lt;/div&gt;</summary>
		<author><name>Phcerdan</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/VTK7-Qt4-to-VTK8-Qt5&amp;diff=59397</id>
		<title>Documentation/Nightly/Developers/Tutorials/MigrationGuide/VTK7-Qt4-to-VTK8-Qt5</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/VTK7-Qt4-to-VTK8-Qt5&amp;diff=59397"/>
		<updated>2018-08-30T23:06:11Z</updated>

		<summary type="html">&lt;p&gt;Phcerdan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;__TOC__&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
==Transition from VTK7-Qt4 to VTK9-Qt5==&lt;br /&gt;
&lt;br /&gt;
This section lists categories of code changes necessary to build and run Slicer with VTK 8.0 and Qt5. Each category has a short description, a suggested upgrade path, and references to relevant commits (TBD once merged).&lt;br /&gt;
&lt;br /&gt;
===Slicer SuperBuild Extension: Enable C++11 in external projects===&lt;br /&gt;
&lt;br /&gt;
SuperBuild extensions may have to enable C++11 for their external projects. Add the following lines to &amp;lt;tt&amp;gt;CMAKE_CACHE_ARGS&amp;lt;/tt&amp;gt; in &amp;lt;tt&amp;gt;ExternalProject_Add&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
    -DCMAKE_CXX_STANDARD:STRING=${CMAKE_CXX_STANDARD}&lt;br /&gt;
    -DCMAKE_CXX_STANDARD_REQUIRED:BOOL=${CMAKE_CXX_STANDARD_REQUIRED}&lt;br /&gt;
    -DCMAKE_CXX_EXTENSIONS:BOOL=${CMAKE_CXX_EXTENSIONS}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Suggested commit message:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
COMP: Enable C++11 in external projects&lt;br /&gt;
&lt;br /&gt;
See https://www.slicer.org/wiki/Documentation/Nightly/Developers/Tutorials/MigrationGuide/VTK7-Qt4-to-VTK8-Qt5#Slicer_SuperBuild_Extension:_Enable_C.2B.2B11_in_external_projects&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Error message similar to:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/path/to/Slicer-build/ITKv4-build/Modules/Core/Common/itkConfigure.h:59:6: warning: #warning &amp;quot;WARNING:  The current project is configured to use a C++ standard version older than the C++ standard used for this build of ITK&amp;quot; [-Wcpp]&lt;br /&gt;
     #warning &amp;quot;WARNING:  The current project is configured to use a C++ standard version older than the C++ standard used for this build of ITK&amp;quot;&lt;br /&gt;
      ^&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Qt5: Update loadable modules to use new plugin macros===&lt;br /&gt;
&lt;br /&gt;
In Qt5, the &amp;lt;code&amp;gt;Q_EXPORT_PLUGIN&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Q_EXPORT_PLUGIN2&amp;lt;/code&amp;gt; macros have been deprecated in favor of the new &amp;lt;code&amp;gt;Q_PLUGIN_METADATA&amp;lt;/code&amp;gt; macro.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Error message similar to:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
error: static assertion failed: Old plugin system used&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Suggested commit message:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
COMP: Qt5: Fix error: static assertion failed: Old plugin system used&lt;br /&gt;
&lt;br /&gt;
See https://www.slicer.org/wiki/Documentation/Nightly/Developers/Tutorials/MigrationGuide/VTK7-Qt4-to-VTK8-Qt5#Qt5:_Update_loadable_modules_to_use_new_plugin_macros&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution (part 1):&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;tt&amp;gt;qSlicer&amp;lt;NameOfModule&amp;gt;Module.h&amp;lt;/tt&amp;gt;, replace lines like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
  Q_INTERFACES(qSlicerLoadableModule);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.slicer.modules.loadable.qSlicerLoadableModule/1.0&amp;quot;);&lt;br /&gt;
#endif&lt;br /&gt;
  Q_INTERFACES(qSlicerLoadableModule);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution (part 2):&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;tt&amp;gt;qSlicer&amp;lt;NameOfModule&amp;gt;Module.cxx&amp;lt;/tt&amp;gt;, Replace lines like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Q_EXPORT_PLUGIN2(qSlicer&amp;lt;NameOfModule&amp;gt;Module, qSlicer&amp;lt;NameOfModule&amp;gt;Module);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#if (QT_VERSION &amp;lt; QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
#include &amp;lt;QtPlugin&amp;gt;&lt;br /&gt;
Q_EXPORT_PLUGIN2(qSlicer&amp;lt;NameOfModule&amp;gt;Module, qSlicer&amp;lt;NameOfModule&amp;gt;Module);&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;References:&amp;lt;/b&amp;gt;&lt;br /&gt;
* https://wiki.qt.io/Transition_from_Qt_4.x_to_Qt5#Plugin_loading&lt;br /&gt;
&lt;br /&gt;
===Qt5: Update DesignerPlugin to use QtUiPlugin/QDesignerCustomWidgetInterface ===&lt;br /&gt;
&lt;br /&gt;
In Qt5, the &amp;lt;code&amp;gt;QtDesigner/QDesignerCustomWidgetInterface&amp;lt;/code&amp;gt; header have been deprecated in favor of the new &amp;lt;code&amp;gt;QtUiPlugin/QDesignerCustomWidgetInterface&amp;lt;/code&amp;gt; header.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Error message similar to:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/path/to/include/QtDesigner/QDesignerCustomWidgetInterface:4:4: warning: #warning Header &amp;lt;QtDesigner/QDesignerCustomWidgetInterface&amp;gt; is deprecated. Please include &amp;lt;QtUiPlugin/QDesignerCustomWidgetInterface&amp;gt; instead. [-Wcpp]&lt;br /&gt;
 #  warning Header &amp;lt;QtDesigner/QDesignerCustomWidgetInterface&amp;gt; is deprecated. Please include &amp;lt;QtUiPlugin/QDesignerCustomWidgetInterface&amp;gt; instead.&lt;br /&gt;
    ^&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Suggested commit message:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
COMP: Update designer plugin to support Qt5&lt;br /&gt;
&lt;br /&gt;
See https://www.slicer.org/wiki/Documentation/Nightly/Developers/Tutorials/MigrationGuide/VTK7-Qt4-to-VTK8-Qt5#Qt5:_Update_DesignerPlugin_to_use_QtUiPlugin.2FQDesignerCustomWidgetInterface&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution (part 1):&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;tt&amp;gt;Widgets/DesignerPlugins/qSlicer&amp;lt;NameOfModule&amp;gt;ModuleWidgetsAbstractPlugin.h&amp;lt;/tt&amp;gt;, replace lines like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;QtGlobal&amp;gt;&lt;br /&gt;
#if (QT_VERSION &amp;lt; QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
#include &amp;lt;QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
#else&lt;br /&gt;
#include &amp;lt;QtUiPlugin/QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution (part 2):&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;tt&amp;gt;Widgets/DesignerPlugins/qSlicer&amp;lt;NameOfModule&amp;gt;ModuleWidgetsAbstractPlugin.h&amp;lt;/tt&amp;gt;, replace lines like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Q_INTERFACES(QDesignerCustomWidgetInterface);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#if (QT_VERSION &amp;gt;= QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetInterface&amp;quot;)&lt;br /&gt;
#endif&lt;br /&gt;
  Q_INTERFACES(QDesignerCustomWidgetInterface);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Qt5: Update DesignerPlugin to use QtUiPlugin/QDesignerCustomWidgetCollectionInterface ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Error message similar to:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/path/to/5.9.1/gcc_64/include/QtDesigner/QDesignerCustomWidgetCollectionInterface:4:4: warning: #warning Header &amp;lt;QtDesigner/QDesignerCustomWidgetCollectionInterface&amp;gt; is deprecated. Please include &amp;lt;QtUiPlugin/QDesignerCustomWidgetCollectionInterface&amp;gt; instead. [-Wcpp]&lt;br /&gt;
 #  warning Header &amp;lt;QtDesigner/QDesignerCustomWidgetCollectionInterface&amp;gt; is deprecated. Please include &amp;lt;QtUiPlugin/QDesignerCustomWidgetCollectionInterface&amp;gt; instead.&lt;br /&gt;
    ^&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution (part 1):&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;tt&amp;gt;Widgets/DesignerPlugins/qSlicer&amp;lt;NameOfModule&amp;gt;ModuleWidgetsPlugin.h&amp;lt;/tt&amp;gt;, replace lines like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;quot;vtkSlicerConfigure.h&amp;quot; // For Slicer_HAVE_QT5&lt;br /&gt;
&lt;br /&gt;
 // Qt includes&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
#include &amp;lt;QtUiPlugin/QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
#else&lt;br /&gt;
#include &amp;lt;QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution (part 2):&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;tt&amp;gt;Widgets/DesignerPlugins/qSlicer&amp;lt;NameOfModule&amp;gt;ModuleWidgetsPlugin.h&amp;lt;/tt&amp;gt;, replace lines like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Q_INTERFACES(QDesignerCustomWidgetCollectionInterface);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#if (QT_VERSION &amp;gt;= QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetInterface&amp;quot;)&lt;br /&gt;
#endif&lt;br /&gt;
   Q_INTERFACES(QDesignerCustomWidgetCollectionInterface);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Qt5: any use of QWebKit needs to switch to QWebEngine===&lt;br /&gt;
&lt;br /&gt;
TBD&lt;br /&gt;
&lt;br /&gt;
===Qt5: QVTKOpenGLWidget===&lt;br /&gt;
&lt;br /&gt;
When using Qt5, [https://github.com/Kitware/VTK/blob/9393774ff9b3d735a40eb445ff6c045e55c90eae/GUISupport/Qt/QVTKOpenGLWidget.h QVTKOpenGLWidget] should be used in place of QVTKGLWidget.&lt;br /&gt;
&lt;br /&gt;
To ensure that QVTKOpenGLWidget receives a properly configured OpenGL context it's necessary to call QSurfaceFormat::setDefaultFormat() before constructing the QApplication instance. QVTKOpenGLWidget::defaultFormat() supplies a suitable format, although it's recommended to disable multisampling for full compatibility with advanced rendering techniques. See http://doc.qt.io/qt-5/qopenglwidget.html.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Error message similar to:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  error: no matching function for call to ‘QVTKWidget::QVTKWidget(QWidget*&amp;amp;)’&lt;br /&gt;
         scalarsToColorsView = new QVTKWidget(ctkVTKDiscretizableColorTransferWidget);&lt;br /&gt;
                                                                                    ^&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution (part 1):&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;tt&amp;gt;NameOfClass.h&amp;lt;/tt&amp;gt; file, replace lines like:&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;QVTKWidget.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
&lt;br /&gt;
  #if CTK_USE_QVTKOPENGLWIDGET&lt;br /&gt;
  #include &amp;lt;QVTKOpenGLWidget.h&amp;gt;&lt;br /&gt;
  #else&lt;br /&gt;
  #include &amp;lt;QVTKWidget.h&amp;gt;&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution (part 2):&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;tt&amp;gt;NameOfClass.h&amp;lt;/tt&amp;gt; file, replace lines like:&lt;br /&gt;
&lt;br /&gt;
  QVTKWidget* View;&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
&lt;br /&gt;
  #if CTK_USE_QVTKOPENGLWIDGET&lt;br /&gt;
    QVTKOpenGLWidget* View;&lt;br /&gt;
  #else&lt;br /&gt;
    QVTKWidget* View;&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution (part 3):&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;tt&amp;gt;NameOfClass.cpp&amp;lt;/tt&amp;gt; file, replace lines like:&lt;br /&gt;
&lt;br /&gt;
  this-&amp;gt;View = new QVTKWidget;&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
&lt;br /&gt;
  #if CTK_USE_QVTKOPENGLWIDGET&lt;br /&gt;
    this-&amp;gt;View = new QVTKOpenGLWidget;&lt;br /&gt;
  #else&lt;br /&gt;
    this-&amp;gt;View = new QVTKWidget;&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
===Qt5: Fix error: 'class QString' has no member named 'toAscii'===&lt;br /&gt;
&lt;br /&gt;
Replace call to &amp;lt;code&amp;gt;toAscii().data()&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;toLatin1().data()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;References:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* https://wiki.qt.io/Transition_from_Qt_4.x_to_Qt5#toAscii.28.29_and_fromAscii.28.29_Methods_are_deprecated&lt;br /&gt;
&lt;br /&gt;
===Qt5: Fix error: ‘class QHeaderView’ has no member named ‘setResizeMode’===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Error message similar to:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  error: ‘class QHeaderView’ has no member named ‘setResizeMode’&lt;br /&gt;
     headerView-&amp;gt;setResizeMode(FileColumn, QHeaderView::Stretch);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Replace lines like:&lt;br /&gt;
&lt;br /&gt;
  headerView-&amp;gt;setResizeMode(FileColumn, QHeaderView::Stretch);&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
&lt;br /&gt;
  #if (QT_VERSION &amp;lt; QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
    headerView-&amp;gt;setResizeMode(FileColumn, QHeaderView::Stretch);&lt;br /&gt;
  #else&lt;br /&gt;
    headerView-&amp;gt;setSectionResizeMode(FileColumn, QHeaderView::Stretch);&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution for Python:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  from packaging import version&lt;br /&gt;
  ...&lt;br /&gt;
  def _setSectionResizeMode(header, *args, **kwargs):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot; To be compatible with Qt4 and Qt5 &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    if version.parse(qt.Qt.qVersion()) &amp;lt; version.parse(&amp;quot;5.0.0&amp;quot;):&lt;br /&gt;
      header.setResizeMode(*args, **kwargs)&lt;br /&gt;
    else:&lt;br /&gt;
      header.setSectionResizeMode(*args, **kwargs)&lt;br /&gt;
  ...&lt;br /&gt;
  _setSectionResizeMode(horizontalHeader, 1, qt.QHeaderView.ResizeToContents)&lt;br /&gt;
&lt;br /&gt;
===VTK8: Use hierarchy files for VTK Python wrapping===&lt;br /&gt;
&lt;br /&gt;
In VTK8 it's necessary to generate hierarchy files for proper wrapping VTK classes in Python. Without the information provided by the hierarchy files, the Python wrapping tool lacks complete information about classes and types. In this case, the generated classes contain methods that shouldn't be wrapped and fail to compile, and include references to types such as &amp;lt;tt&amp;gt;vtkTypeBool&amp;lt;/tt&amp;gt;. Once the hierarchy files are generated and provided to the Python wrapping tool, the generated classes compile and typedefs like &amp;lt;tt&amp;gt;vtkTypeBool&amp;lt;/tt&amp;gt; are correctly resolved.&lt;br /&gt;
&lt;br /&gt;
Once the VTK8 changes are merged, generating hierarchy files is handled by https://github.com/Slicer/Slicer/blob/master/CMake/vtkMacroKitPythonWrap.cmake.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;References:&amp;lt;/b&amp;gt;&lt;br /&gt;
* http://www.vtk.org/Wiki/VTK/WrapHierarchy&lt;br /&gt;
&lt;br /&gt;
===VTK8: Use of vtkTypeMacro requires to use the correct base class===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Error message similar to:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
error: expected unqualified-id before 'protected'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This error is usually a symptom of an incorrect base class when using &amp;lt;tt&amp;gt;vtkTypeMacro&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Assuming the class &amp;lt;tt&amp;gt;vtkIGTLToMRMLPoint&amp;lt;/tt&amp;gt; derives from &amp;lt;tt&amp;gt;vtkIGTLToMRMLBase&amp;lt;/tt&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
Replace lines like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vtkTypeMacro(vtkIGTLToMRMLPoint,vtkObject);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vtkTypeMacro(vtkIGTLToMRMLPoint,vtkIGTLToMRMLBase);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;References:&amp;lt;/b&amp;gt;&lt;br /&gt;
* [[#VTK8:_Use_hierarchy_files_for_VTK_Python_wrapping|VTK8: Use hierarchy files for VTK Python wrapping]]&lt;br /&gt;
&lt;br /&gt;
===VTK8: Copy constructor and equal operator should be disabled===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Error message similar to:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
error: use of deleted function 'vtkMyClass::vtkMyClass(const vtkMyClass&amp;amp;)'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This error is usually a symptom of not disabling the copy constructor and equal operator.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Replace lines like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
protected:&lt;br /&gt;
  vtkMyClass();&lt;br /&gt;
  ~vtkMyClass();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
protected:&lt;br /&gt;
  vtkMyClass();&lt;br /&gt;
  ~vtkMyClass();&lt;br /&gt;
  vtkMyClass(const vtkMyClass&amp;amp;);&lt;br /&gt;
  void operator=(const vtkMyClass&amp;amp;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===VTK8: Call InitializeObjectBase() in vtkObject New() methods===&lt;br /&gt;
&lt;br /&gt;
In VTK8 it's necessary for &amp;lt;tt&amp;gt;vtkObject&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;New()&amp;lt;/tt&amp;gt; methods to call &amp;lt;tt&amp;gt;InitializeObjectBase()&amp;lt;/tt&amp;gt; on the new object for proper tracking with &amp;lt;tt&amp;gt;vtkDebugLeaks&amp;lt;/tt&amp;gt;. The standard macros (&amp;lt;tt&amp;gt;vtkStandardNewMacro&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;vtkObjectFactoryNewMacro&amp;lt;/tt&amp;gt;) handle this. For those classes that don't use the macros, add a call to &amp;lt;tt&amp;gt;InitializeObjectBase()&amp;lt;/tt&amp;gt; immediately after constructing the object by &amp;lt;tt&amp;gt;new vtkXXX()&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Additionally, &amp;lt;tt&amp;gt;vtkObjectFactory::CreateInstance()&amp;lt;/tt&amp;gt; now doesn't register the class name with vtkDebugLeaks if the factory fails to create the object. Therefore, it's no longer necessary to unregister the class name with vtkDebugLeaks. Remove calls to &amp;lt;tt&amp;gt;vtkDebugLeaks::DestructClass(className)&amp;lt;/tt&amp;gt; following &amp;lt;tt&amp;gt;vtkObjectFactory::CreateInstance()&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To support both VTK8 and earlier versions of VTK, wrap these changes in preprocessor checks for whether &amp;lt;tt&amp;gt;VTK_HAS_INITIALIZE_OBJECT_BASE&amp;lt;/tt&amp;gt; is defined.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;References:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* https://github.com/Kitware/VTK/commit/e5c793dbdf87e838bb2b60c6a5905ced0e5548f9&lt;br /&gt;
* http://public.kitware.com/pipermail/vtk-developers/2016-September/034332.html&lt;br /&gt;
&lt;br /&gt;
===VTK8: Add C++11 keywords===&lt;br /&gt;
&lt;br /&gt;
VTK8 requires C++11. Subclasses of VTK classes must mark overridden methods with &amp;lt;tt&amp;gt;VTK_OVERRIDE&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===VTK8: vtkWindowToImageFilter::SetMagnification() is deprecated===&lt;br /&gt;
&lt;br /&gt;
VTK8.1 deprecated vtkWindowToImageFilter::SetMagnification() and vtkWindowToImageFilter::GetMagnification(). Replace calls to those methods with SetScale() and GetScale(). See https://github.com/Kitware/VTK/commit/af0a95fa7dd4e25ef869a0bc6077e547f18baa29.&lt;br /&gt;
&lt;br /&gt;
===VTK8: vtkInstantiator is deprecated===&lt;br /&gt;
&lt;br /&gt;
VTK8.1 deprecated vtkInstantiator. See https://github.com/Kitware/VTK/commit/11bb6a4d395e877847355a63de2e2e8f8d9e1d91&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Error message similar to:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/path/to/SlicerIGT-Release/ToolWatchdog/MRMLDM/WatchdogInstantiator.cxx:10:1: error: expected constructor, destructor, or type conversion before ‘void’&lt;br /&gt;
 void WatchdogInstantiator::ClassInitialize()&lt;br /&gt;
 ^&lt;br /&gt;
/path/to/SlicerIGT-Release/ToolWatchdog/MRMLDM/WatchdogInstantiator.cxx: In static member function ‘static void WatchdogInstantiator::ClassFinalize()’:&lt;br /&gt;
/path/to/SlicerIGT-Release/ToolWatchdog/MRMLDM/WatchdogInstantiator.cxx:21:3: error: ‘vtkInstantiator’ has not been declared&lt;br /&gt;
	 vtkInstantiator::UnRegisterInstantiator(&amp;quot;vtkMRMLWatchdogDisplayableManager&amp;quot;, vtkInstantiatorvtkMRMLWatchdogDisplayableManagerNew);&lt;br /&gt;
	 ^&lt;br /&gt;
/path/to/SlicerIGT-Release/ToolWatchdog/MRMLDM/WatchdogInstantiator.cxx:21:80: error: ‘vtkInstantiatorvtkMRMLWatchdogDisplayableManagerNew’ was not declared in this scope&lt;br /&gt;
	 vtkInstantiator::UnRegisterInstantiator(&amp;quot;vtkMRMLWatchdogDisplayableManager&amp;quot;, vtkInstantiatorvtkMRMLWatchdogDisplayableManagerNew);&lt;br /&gt;
	                                                                              ^&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution (part 1):&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Update associated &amp;lt;tt&amp;gt;CMakeLists.txt&amp;lt;/tt&amp;gt; replacing lines like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set(VTK_USE_INSTANTIATOR_NEW 1)&lt;br /&gt;
if(${VTK_VERSION_MAJOR} GREATER 5)&lt;br /&gt;
  include(${VTK_CMAKE_DIR}/vtkMakeInstantiator.cmake)&lt;br /&gt;
endif()&lt;br /&gt;
VTK_MAKE_INSTANTIATOR3(&amp;quot;${MODULE_NAME}Instantiator&amp;quot;&lt;br /&gt;
  displayable_manager_instantiator_SRCS&lt;br /&gt;
  &amp;quot;${displayable_manager_SRCS}&amp;quot;&lt;br /&gt;
  &amp;quot;${${KIT}_EXPORT_DIRECTIVE}&amp;quot;&lt;br /&gt;
  ${CMAKE_CURRENT_BINARY_DIR}&lt;br /&gt;
  &amp;quot;${KIT}Export.h&amp;quot;&lt;br /&gt;
  )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SlicerConfigureDisplayableManagerObjectFactory(&lt;br /&gt;
  TARGET_NAME ${KIT}&lt;br /&gt;
  SRCS &amp;quot;${displayable_manager_SRCS}&amp;quot;&lt;br /&gt;
  EXPORT_MACRO &amp;quot;${${KIT}_EXPORT_DIRECTIVE}&amp;quot;&lt;br /&gt;
  EXPORT_HEADER &amp;quot;${KIT}Export.h&amp;quot;&lt;br /&gt;
  OUTPUT_SRCS_VAR displayable_manager_instantiator_SRCS&lt;br /&gt;
  )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution (part 2):&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Update associated &amp;lt;tt&amp;gt;qSlicer&amp;lt;NameOfModule&amp;gt;Module.h&amp;lt;/tt&amp;gt; (or any test requiring displayable manager) adding lines like:&lt;br /&gt;
&lt;br /&gt;
  // DisplayableManager initialization&lt;br /&gt;
  #include &amp;lt;vtkAutoInit.h&amp;gt;&lt;br /&gt;
  VTK_MODULE_INIT(vtkSlicer&amp;lt;NameOfModule&amp;gt;ModuleMRMLDisplayableManager)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution (part 2 - maintaining backward compatibility with Slicer 4.8):&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;vtkSlicerVersionConfigure.h&amp;gt; // For Slicer_VERSION_MAJOR, Slicer_VERSION_MINOR&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
  [...]&lt;br /&gt;
  &lt;br /&gt;
  // DisplayableManager initialization&lt;br /&gt;
  #if Slicer_VERSION_MAJOR == 4 &amp;amp;&amp;amp; Slicer_VERSION_MINOR &amp;gt;= 9&lt;br /&gt;
  #include &amp;lt;vtkAutoInit.h&amp;gt;&lt;br /&gt;
  VTK_MODULE_INIT(vtkSlicer&amp;lt;NameOfModule&amp;gt;ModuleMRMLDisplayableManager)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
For example, see https://github.com/SlicerIGT/SlicerIGT/pull/155/commits/2f866ea8872435b9a3a7382dd0549231da00406f&lt;br /&gt;
&lt;br /&gt;
===VTK9: Signature of vtkFSLookupTable::MapValue updated ===&lt;br /&gt;
&lt;br /&gt;
The signature of the function was updated in [https://github.com/Kitware/VTK/commit/43f6ee3 Kitware/VTK@43f6ee3]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Error message similar to:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  error: invalid conversion from ‘const unsigned char*’ to ‘unsigned char*’ [-fpermissive]&lt;br /&gt;
&lt;br /&gt;
  overriding virtual function return type differs and is not covariant from 'vtkLookupTable::MapValue'&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Update code to use `const` keyword. For example, see [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=26708 r26708]&lt;br /&gt;
&lt;br /&gt;
===Slicer scripted module initialization steps after application startup===&lt;br /&gt;
&lt;br /&gt;
In Slicer 4.8 and earlier versions, those module initialization steps that required application startup completed, often were called using a singleshot timer, because timer events were only processed after the application startup was completed. In Slicer 4.9, some event processing is performed before the application startup is completed, therefore instead of relying on a timer, the application's ''startupCompleted()'' signal must be used.&lt;br /&gt;
&lt;br /&gt;
Replace line like:&lt;br /&gt;
&lt;br /&gt;
    qt.QTimer.singleShot(0, self.myAdditionalInitializationSteps)&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
&lt;br /&gt;
    slicer.app.connect(&amp;quot;startupCompleted()&amp;quot;, self.myAdditionalInitializationSteps)&lt;/div&gt;</summary>
		<author><name>Phcerdan</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/VTK7-Qt4-to-VTK8-Qt5&amp;diff=59396</id>
		<title>Documentation/Nightly/Developers/Tutorials/MigrationGuide/VTK7-Qt4-to-VTK8-Qt5</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/VTK7-Qt4-to-VTK8-Qt5&amp;diff=59396"/>
		<updated>2018-08-30T22:58:46Z</updated>

		<summary type="html">&lt;p&gt;Phcerdan: Add python version on how to workaround setResizeMode error in qt5&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;__TOC__&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
==Transition from VTK7-Qt4 to VTK9-Qt5==&lt;br /&gt;
&lt;br /&gt;
This section lists categories of code changes necessary to build and run Slicer with VTK 8.0 and Qt5. Each category has a short description, a suggested upgrade path, and references to relevant commits (TBD once merged).&lt;br /&gt;
&lt;br /&gt;
===Slicer SuperBuild Extension: Enable C++11 in external projects===&lt;br /&gt;
&lt;br /&gt;
SuperBuild extensions may have to enable C++11 for their external projects. Add the following lines to &amp;lt;tt&amp;gt;CMAKE_CACHE_ARGS&amp;lt;/tt&amp;gt; in &amp;lt;tt&amp;gt;ExternalProject_Add&amp;lt;/tt&amp;gt; &lt;br /&gt;
&lt;br /&gt;
    -DCMAKE_CXX_STANDARD:STRING=${CMAKE_CXX_STANDARD}&lt;br /&gt;
    -DCMAKE_CXX_STANDARD_REQUIRED:BOOL=${CMAKE_CXX_STANDARD_REQUIRED}&lt;br /&gt;
    -DCMAKE_CXX_EXTENSIONS:BOOL=${CMAKE_CXX_EXTENSIONS}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Suggested commit message:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
COMP: Enable C++11 in external projects&lt;br /&gt;
&lt;br /&gt;
See https://www.slicer.org/wiki/Documentation/Nightly/Developers/Tutorials/MigrationGuide/VTK7-Qt4-to-VTK8-Qt5#Slicer_SuperBuild_Extension:_Enable_C.2B.2B11_in_external_projects&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Error message similar to:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/path/to/Slicer-build/ITKv4-build/Modules/Core/Common/itkConfigure.h:59:6: warning: #warning &amp;quot;WARNING:  The current project is configured to use a C++ standard version older than the C++ standard used for this build of ITK&amp;quot; [-Wcpp]&lt;br /&gt;
     #warning &amp;quot;WARNING:  The current project is configured to use a C++ standard version older than the C++ standard used for this build of ITK&amp;quot;&lt;br /&gt;
      ^&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Qt5: Update loadable modules to use new plugin macros===&lt;br /&gt;
&lt;br /&gt;
In Qt5, the &amp;lt;code&amp;gt;Q_EXPORT_PLUGIN&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Q_EXPORT_PLUGIN2&amp;lt;/code&amp;gt; macros have been deprecated in favor of the new &amp;lt;code&amp;gt;Q_PLUGIN_METADATA&amp;lt;/code&amp;gt; macro.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Error message similar to:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
error: static assertion failed: Old plugin system used&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Suggested commit message:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
COMP: Qt5: Fix error: static assertion failed: Old plugin system used&lt;br /&gt;
&lt;br /&gt;
See https://www.slicer.org/wiki/Documentation/Nightly/Developers/Tutorials/MigrationGuide/VTK7-Qt4-to-VTK8-Qt5#Qt5:_Update_loadable_modules_to_use_new_plugin_macros&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution (part 1):&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;tt&amp;gt;qSlicer&amp;lt;NameOfModule&amp;gt;Module.h&amp;lt;/tt&amp;gt;, replace lines like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
  Q_INTERFACES(qSlicerLoadableModule);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.slicer.modules.loadable.qSlicerLoadableModule/1.0&amp;quot;);&lt;br /&gt;
#endif&lt;br /&gt;
  Q_INTERFACES(qSlicerLoadableModule);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution (part 2):&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;tt&amp;gt;qSlicer&amp;lt;NameOfModule&amp;gt;Module.cxx&amp;lt;/tt&amp;gt;, Replace lines like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Q_EXPORT_PLUGIN2(qSlicer&amp;lt;NameOfModule&amp;gt;Module, qSlicer&amp;lt;NameOfModule&amp;gt;Module);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#if (QT_VERSION &amp;lt; QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
#include &amp;lt;QtPlugin&amp;gt;&lt;br /&gt;
Q_EXPORT_PLUGIN2(qSlicer&amp;lt;NameOfModule&amp;gt;Module, qSlicer&amp;lt;NameOfModule&amp;gt;Module);&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;References:&amp;lt;/b&amp;gt;&lt;br /&gt;
* https://wiki.qt.io/Transition_from_Qt_4.x_to_Qt5#Plugin_loading&lt;br /&gt;
&lt;br /&gt;
===Qt5: Update DesignerPlugin to use QtUiPlugin/QDesignerCustomWidgetInterface ===&lt;br /&gt;
&lt;br /&gt;
In Qt5, the &amp;lt;code&amp;gt;QtDesigner/QDesignerCustomWidgetInterface&amp;lt;/code&amp;gt; header have been deprecated in favor of the new &amp;lt;code&amp;gt;QtUiPlugin/QDesignerCustomWidgetInterface&amp;lt;/code&amp;gt; header.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Error message similar to:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/path/to/include/QtDesigner/QDesignerCustomWidgetInterface:4:4: warning: #warning Header &amp;lt;QtDesigner/QDesignerCustomWidgetInterface&amp;gt; is deprecated. Please include &amp;lt;QtUiPlugin/QDesignerCustomWidgetInterface&amp;gt; instead. [-Wcpp]&lt;br /&gt;
 #  warning Header &amp;lt;QtDesigner/QDesignerCustomWidgetInterface&amp;gt; is deprecated. Please include &amp;lt;QtUiPlugin/QDesignerCustomWidgetInterface&amp;gt; instead.&lt;br /&gt;
    ^&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Suggested commit message:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
COMP: Update designer plugin to support Qt5&lt;br /&gt;
&lt;br /&gt;
See https://www.slicer.org/wiki/Documentation/Nightly/Developers/Tutorials/MigrationGuide/VTK7-Qt4-to-VTK8-Qt5#Qt5:_Update_DesignerPlugin_to_use_QtUiPlugin.2FQDesignerCustomWidgetInterface&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution (part 1):&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;tt&amp;gt;Widgets/DesignerPlugins/qSlicer&amp;lt;NameOfModule&amp;gt;ModuleWidgetsAbstractPlugin.h&amp;lt;/tt&amp;gt;, replace lines like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;QtGlobal&amp;gt;&lt;br /&gt;
#if (QT_VERSION &amp;lt; QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
#include &amp;lt;QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
#else&lt;br /&gt;
#include &amp;lt;QtUiPlugin/QDesignerCustomWidgetInterface&amp;gt;&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution (part 2):&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;tt&amp;gt;Widgets/DesignerPlugins/qSlicer&amp;lt;NameOfModule&amp;gt;ModuleWidgetsAbstractPlugin.h&amp;lt;/tt&amp;gt;, replace lines like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Q_INTERFACES(QDesignerCustomWidgetInterface);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#if (QT_VERSION &amp;gt;= QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetInterface&amp;quot;)&lt;br /&gt;
#endif&lt;br /&gt;
  Q_INTERFACES(QDesignerCustomWidgetInterface);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Qt5: Update DesignerPlugin to use QtUiPlugin/QDesignerCustomWidgetCollectionInterface ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Error message similar to:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/path/to/5.9.1/gcc_64/include/QtDesigner/QDesignerCustomWidgetCollectionInterface:4:4: warning: #warning Header &amp;lt;QtDesigner/QDesignerCustomWidgetCollectionInterface&amp;gt; is deprecated. Please include &amp;lt;QtUiPlugin/QDesignerCustomWidgetCollectionInterface&amp;gt; instead. [-Wcpp]&lt;br /&gt;
 #  warning Header &amp;lt;QtDesigner/QDesignerCustomWidgetCollectionInterface&amp;gt; is deprecated. Please include &amp;lt;QtUiPlugin/QDesignerCustomWidgetCollectionInterface&amp;gt; instead.&lt;br /&gt;
    ^&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution (part 1):&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;tt&amp;gt;Widgets/DesignerPlugins/qSlicer&amp;lt;NameOfModule&amp;gt;ModuleWidgetsPlugin.h&amp;lt;/tt&amp;gt;, replace lines like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;quot;vtkSlicerConfigure.h&amp;quot; // For Slicer_HAVE_QT5&lt;br /&gt;
&lt;br /&gt;
 // Qt includes&lt;br /&gt;
#ifdef Slicer_HAVE_QT5&lt;br /&gt;
#include &amp;lt;QtUiPlugin/QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
#else&lt;br /&gt;
#include &amp;lt;QDesignerCustomWidgetCollectionInterface&amp;gt;&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution (part 2):&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;tt&amp;gt;Widgets/DesignerPlugins/qSlicer&amp;lt;NameOfModule&amp;gt;ModuleWidgetsPlugin.h&amp;lt;/tt&amp;gt;, replace lines like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Q_INTERFACES(QDesignerCustomWidgetCollectionInterface);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#if (QT_VERSION &amp;gt;= QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
  Q_PLUGIN_METADATA(IID &amp;quot;org.qt-project.Qt.QDesignerCustomWidgetInterface&amp;quot;)&lt;br /&gt;
#endif&lt;br /&gt;
   Q_INTERFACES(QDesignerCustomWidgetCollectionInterface);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Qt5: any use of QWebKit needs to switch to QWebEngine===&lt;br /&gt;
&lt;br /&gt;
TBD&lt;br /&gt;
&lt;br /&gt;
===Qt5: QVTKOpenGLWidget===&lt;br /&gt;
&lt;br /&gt;
When using Qt5, [https://github.com/Kitware/VTK/blob/9393774ff9b3d735a40eb445ff6c045e55c90eae/GUISupport/Qt/QVTKOpenGLWidget.h QVTKOpenGLWidget] should be used in place of QVTKGLWidget.&lt;br /&gt;
&lt;br /&gt;
To ensure that QVTKOpenGLWidget receives a properly configured OpenGL context it's necessary to call QSurfaceFormat::setDefaultFormat() before constructing the QApplication instance. QVTKOpenGLWidget::defaultFormat() supplies a suitable format, although it's recommended to disable multisampling for full compatibility with advanced rendering techniques. See http://doc.qt.io/qt-5/qopenglwidget.html.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Error message similar to:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  error: no matching function for call to ‘QVTKWidget::QVTKWidget(QWidget*&amp;amp;)’&lt;br /&gt;
         scalarsToColorsView = new QVTKWidget(ctkVTKDiscretizableColorTransferWidget);&lt;br /&gt;
                                                                                    ^&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution (part 1):&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;tt&amp;gt;NameOfClass.h&amp;lt;/tt&amp;gt; file, replace lines like:&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;QVTKWidget.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
&lt;br /&gt;
  #if CTK_USE_QVTKOPENGLWIDGET&lt;br /&gt;
  #include &amp;lt;QVTKOpenGLWidget.h&amp;gt;&lt;br /&gt;
  #else&lt;br /&gt;
  #include &amp;lt;QVTKWidget.h&amp;gt;&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution (part 2):&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;tt&amp;gt;NameOfClass.h&amp;lt;/tt&amp;gt; file, replace lines like:&lt;br /&gt;
&lt;br /&gt;
  QVTKWidget* View;&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
&lt;br /&gt;
  #if CTK_USE_QVTKOPENGLWIDGET&lt;br /&gt;
    QVTKOpenGLWidget* View;&lt;br /&gt;
  #else&lt;br /&gt;
    QVTKWidget* View;&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution (part 3):&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;tt&amp;gt;NameOfClass.cpp&amp;lt;/tt&amp;gt; file, replace lines like:&lt;br /&gt;
&lt;br /&gt;
  this-&amp;gt;View = new QVTKWidget;&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
&lt;br /&gt;
  #if CTK_USE_QVTKOPENGLWIDGET&lt;br /&gt;
    this-&amp;gt;View = new QVTKOpenGLWidget;&lt;br /&gt;
  #else&lt;br /&gt;
    this-&amp;gt;View = new QVTKWidget;&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
===Qt5: Fix error: 'class QString' has no member named 'toAscii'===&lt;br /&gt;
&lt;br /&gt;
Replace call to &amp;lt;code&amp;gt;toAscii().data()&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;toLatin1().data()&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;References:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* https://wiki.qt.io/Transition_from_Qt_4.x_to_Qt5#toAscii.28.29_and_fromAscii.28.29_Methods_are_deprecated&lt;br /&gt;
&lt;br /&gt;
===Qt5: Fix error: ‘class QHeaderView’ has no member named ‘setResizeMode’===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Error message similar to:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  error: ‘class QHeaderView’ has no member named ‘setResizeMode’&lt;br /&gt;
     headerView-&amp;gt;setResizeMode(FileColumn, QHeaderView::Stretch);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Replace lines like:&lt;br /&gt;
&lt;br /&gt;
  headerView-&amp;gt;setResizeMode(FileColumn, QHeaderView::Stretch);&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
&lt;br /&gt;
  #if (QT_VERSION &amp;lt; QT_VERSION_CHECK(5, 0, 0))&lt;br /&gt;
    headerView-&amp;gt;setResizeMode(FileColumn, QHeaderView::Stretch);&lt;br /&gt;
  #else&lt;br /&gt;
    headerView-&amp;gt;setSectionResizeMode(FileColumn, QHeaderView::Stretch);&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution for Python:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  from packaging import version&lt;br /&gt;
  def _setSectionResizeMode(header, *args, **kwargs):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot; To be compatible with Qt4 and Qt5 &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    if version.parse(qt.Qt.qVersion()) &amp;lt; version.parse(&amp;quot;5.0.0&amp;quot;):&lt;br /&gt;
      header.setResizeMode(*args, **kwargs)&lt;br /&gt;
    else:&lt;br /&gt;
      header.setSectionResizeMode(*args, **kwargs)&lt;br /&gt;
&lt;br /&gt;
===VTK8: Use hierarchy files for VTK Python wrapping===&lt;br /&gt;
&lt;br /&gt;
In VTK8 it's necessary to generate hierarchy files for proper wrapping VTK classes in Python. Without the information provided by the hierarchy files, the Python wrapping tool lacks complete information about classes and types. In this case, the generated classes contain methods that shouldn't be wrapped and fail to compile, and include references to types such as &amp;lt;tt&amp;gt;vtkTypeBool&amp;lt;/tt&amp;gt;. Once the hierarchy files are generated and provided to the Python wrapping tool, the generated classes compile and typedefs like &amp;lt;tt&amp;gt;vtkTypeBool&amp;lt;/tt&amp;gt; are correctly resolved.&lt;br /&gt;
&lt;br /&gt;
Once the VTK8 changes are merged, generating hierarchy files is handled by https://github.com/Slicer/Slicer/blob/master/CMake/vtkMacroKitPythonWrap.cmake.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;References:&amp;lt;/b&amp;gt;&lt;br /&gt;
* http://www.vtk.org/Wiki/VTK/WrapHierarchy&lt;br /&gt;
&lt;br /&gt;
===VTK8: Use of vtkTypeMacro requires to use the correct base class===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Error message similar to:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
error: expected unqualified-id before 'protected'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This error is usually a symptom of an incorrect base class when using &amp;lt;tt&amp;gt;vtkTypeMacro&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Assuming the class &amp;lt;tt&amp;gt;vtkIGTLToMRMLPoint&amp;lt;/tt&amp;gt; derives from &amp;lt;tt&amp;gt;vtkIGTLToMRMLBase&amp;lt;/tt&amp;gt;,&lt;br /&gt;
&lt;br /&gt;
Replace lines like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vtkTypeMacro(vtkIGTLToMRMLPoint,vtkObject);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vtkTypeMacro(vtkIGTLToMRMLPoint,vtkIGTLToMRMLBase);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;References:&amp;lt;/b&amp;gt;&lt;br /&gt;
* [[#VTK8:_Use_hierarchy_files_for_VTK_Python_wrapping|VTK8: Use hierarchy files for VTK Python wrapping]]&lt;br /&gt;
&lt;br /&gt;
===VTK8: Copy constructor and equal operator should be disabled===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Error message similar to:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
error: use of deleted function 'vtkMyClass::vtkMyClass(const vtkMyClass&amp;amp;)'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This error is usually a symptom of not disabling the copy constructor and equal operator.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Replace lines like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
protected:&lt;br /&gt;
  vtkMyClass();&lt;br /&gt;
  ~vtkMyClass();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
protected:&lt;br /&gt;
  vtkMyClass();&lt;br /&gt;
  ~vtkMyClass();&lt;br /&gt;
  vtkMyClass(const vtkMyClass&amp;amp;);&lt;br /&gt;
  void operator=(const vtkMyClass&amp;amp;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===VTK8: Call InitializeObjectBase() in vtkObject New() methods===&lt;br /&gt;
&lt;br /&gt;
In VTK8 it's necessary for &amp;lt;tt&amp;gt;vtkObject&amp;lt;/tt&amp;gt; &amp;lt;tt&amp;gt;New()&amp;lt;/tt&amp;gt; methods to call &amp;lt;tt&amp;gt;InitializeObjectBase()&amp;lt;/tt&amp;gt; on the new object for proper tracking with &amp;lt;tt&amp;gt;vtkDebugLeaks&amp;lt;/tt&amp;gt;. The standard macros (&amp;lt;tt&amp;gt;vtkStandardNewMacro&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;vtkObjectFactoryNewMacro&amp;lt;/tt&amp;gt;) handle this. For those classes that don't use the macros, add a call to &amp;lt;tt&amp;gt;InitializeObjectBase()&amp;lt;/tt&amp;gt; immediately after constructing the object by &amp;lt;tt&amp;gt;new vtkXXX()&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Additionally, &amp;lt;tt&amp;gt;vtkObjectFactory::CreateInstance()&amp;lt;/tt&amp;gt; now doesn't register the class name with vtkDebugLeaks if the factory fails to create the object. Therefore, it's no longer necessary to unregister the class name with vtkDebugLeaks. Remove calls to &amp;lt;tt&amp;gt;vtkDebugLeaks::DestructClass(className)&amp;lt;/tt&amp;gt; following &amp;lt;tt&amp;gt;vtkObjectFactory::CreateInstance()&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To support both VTK8 and earlier versions of VTK, wrap these changes in preprocessor checks for whether &amp;lt;tt&amp;gt;VTK_HAS_INITIALIZE_OBJECT_BASE&amp;lt;/tt&amp;gt; is defined.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;References:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* https://github.com/Kitware/VTK/commit/e5c793dbdf87e838bb2b60c6a5905ced0e5548f9&lt;br /&gt;
* http://public.kitware.com/pipermail/vtk-developers/2016-September/034332.html&lt;br /&gt;
&lt;br /&gt;
===VTK8: Add C++11 keywords===&lt;br /&gt;
&lt;br /&gt;
VTK8 requires C++11. Subclasses of VTK classes must mark overridden methods with &amp;lt;tt&amp;gt;VTK_OVERRIDE&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===VTK8: vtkWindowToImageFilter::SetMagnification() is deprecated===&lt;br /&gt;
&lt;br /&gt;
VTK8.1 deprecated vtkWindowToImageFilter::SetMagnification() and vtkWindowToImageFilter::GetMagnification(). Replace calls to those methods with SetScale() and GetScale(). See https://github.com/Kitware/VTK/commit/af0a95fa7dd4e25ef869a0bc6077e547f18baa29.&lt;br /&gt;
&lt;br /&gt;
===VTK8: vtkInstantiator is deprecated===&lt;br /&gt;
&lt;br /&gt;
VTK8.1 deprecated vtkInstantiator. See https://github.com/Kitware/VTK/commit/11bb6a4d395e877847355a63de2e2e8f8d9e1d91&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Error message similar to:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/path/to/SlicerIGT-Release/ToolWatchdog/MRMLDM/WatchdogInstantiator.cxx:10:1: error: expected constructor, destructor, or type conversion before ‘void’&lt;br /&gt;
 void WatchdogInstantiator::ClassInitialize()&lt;br /&gt;
 ^&lt;br /&gt;
/path/to/SlicerIGT-Release/ToolWatchdog/MRMLDM/WatchdogInstantiator.cxx: In static member function ‘static void WatchdogInstantiator::ClassFinalize()’:&lt;br /&gt;
/path/to/SlicerIGT-Release/ToolWatchdog/MRMLDM/WatchdogInstantiator.cxx:21:3: error: ‘vtkInstantiator’ has not been declared&lt;br /&gt;
	 vtkInstantiator::UnRegisterInstantiator(&amp;quot;vtkMRMLWatchdogDisplayableManager&amp;quot;, vtkInstantiatorvtkMRMLWatchdogDisplayableManagerNew);&lt;br /&gt;
	 ^&lt;br /&gt;
/path/to/SlicerIGT-Release/ToolWatchdog/MRMLDM/WatchdogInstantiator.cxx:21:80: error: ‘vtkInstantiatorvtkMRMLWatchdogDisplayableManagerNew’ was not declared in this scope&lt;br /&gt;
	 vtkInstantiator::UnRegisterInstantiator(&amp;quot;vtkMRMLWatchdogDisplayableManager&amp;quot;, vtkInstantiatorvtkMRMLWatchdogDisplayableManagerNew);&lt;br /&gt;
	                                                                              ^&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution (part 1):&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Update associated &amp;lt;tt&amp;gt;CMakeLists.txt&amp;lt;/tt&amp;gt; replacing lines like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set(VTK_USE_INSTANTIATOR_NEW 1)&lt;br /&gt;
if(${VTK_VERSION_MAJOR} GREATER 5)&lt;br /&gt;
  include(${VTK_CMAKE_DIR}/vtkMakeInstantiator.cmake)&lt;br /&gt;
endif()&lt;br /&gt;
VTK_MAKE_INSTANTIATOR3(&amp;quot;${MODULE_NAME}Instantiator&amp;quot;&lt;br /&gt;
  displayable_manager_instantiator_SRCS&lt;br /&gt;
  &amp;quot;${displayable_manager_SRCS}&amp;quot;&lt;br /&gt;
  &amp;quot;${${KIT}_EXPORT_DIRECTIVE}&amp;quot;&lt;br /&gt;
  ${CMAKE_CURRENT_BINARY_DIR}&lt;br /&gt;
  &amp;quot;${KIT}Export.h&amp;quot;&lt;br /&gt;
  )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SlicerConfigureDisplayableManagerObjectFactory(&lt;br /&gt;
  TARGET_NAME ${KIT}&lt;br /&gt;
  SRCS &amp;quot;${displayable_manager_SRCS}&amp;quot;&lt;br /&gt;
  EXPORT_MACRO &amp;quot;${${KIT}_EXPORT_DIRECTIVE}&amp;quot;&lt;br /&gt;
  EXPORT_HEADER &amp;quot;${KIT}Export.h&amp;quot;&lt;br /&gt;
  OUTPUT_SRCS_VAR displayable_manager_instantiator_SRCS&lt;br /&gt;
  )&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution (part 2):&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Update associated &amp;lt;tt&amp;gt;qSlicer&amp;lt;NameOfModule&amp;gt;Module.h&amp;lt;/tt&amp;gt; (or any test requiring displayable manager) adding lines like:&lt;br /&gt;
&lt;br /&gt;
  // DisplayableManager initialization&lt;br /&gt;
  #include &amp;lt;vtkAutoInit.h&amp;gt;&lt;br /&gt;
  VTK_MODULE_INIT(vtkSlicer&amp;lt;NameOfModule&amp;gt;ModuleMRMLDisplayableManager)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution (part 2 - maintaining backward compatibility with Slicer 4.8):&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;vtkSlicerVersionConfigure.h&amp;gt; // For Slicer_VERSION_MAJOR, Slicer_VERSION_MINOR&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
  [...]&lt;br /&gt;
  &lt;br /&gt;
  // DisplayableManager initialization&lt;br /&gt;
  #if Slicer_VERSION_MAJOR == 4 &amp;amp;&amp;amp; Slicer_VERSION_MINOR &amp;gt;= 9&lt;br /&gt;
  #include &amp;lt;vtkAutoInit.h&amp;gt;&lt;br /&gt;
  VTK_MODULE_INIT(vtkSlicer&amp;lt;NameOfModule&amp;gt;ModuleMRMLDisplayableManager)&lt;br /&gt;
  #endif&lt;br /&gt;
&lt;br /&gt;
For example, see https://github.com/SlicerIGT/SlicerIGT/pull/155/commits/2f866ea8872435b9a3a7382dd0549231da00406f&lt;br /&gt;
&lt;br /&gt;
===VTK9: Signature of vtkFSLookupTable::MapValue updated ===&lt;br /&gt;
&lt;br /&gt;
The signature of the function was updated in [https://github.com/Kitware/VTK/commit/43f6ee3 Kitware/VTK@43f6ee3]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Error message similar to:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  error: invalid conversion from ‘const unsigned char*’ to ‘unsigned char*’ [-fpermissive]&lt;br /&gt;
&lt;br /&gt;
  overriding virtual function return type differs and is not covariant from 'vtkLookupTable::MapValue'&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Update code to use `const` keyword. For example, see [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=26708 r26708]&lt;br /&gt;
&lt;br /&gt;
===Slicer scripted module initialization steps after application startup===&lt;br /&gt;
&lt;br /&gt;
In Slicer 4.8 and earlier versions, those module initialization steps that required application startup completed, often were called using a singleshot timer, because timer events were only processed after the application startup was completed. In Slicer 4.9, some event processing is performed before the application startup is completed, therefore instead of relying on a timer, the application's ''startupCompleted()'' signal must be used.&lt;br /&gt;
&lt;br /&gt;
Replace line like:&lt;br /&gt;
&lt;br /&gt;
    qt.QTimer.singleShot(0, self.myAdditionalInitializationSteps)&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
&lt;br /&gt;
    slicer.app.connect(&amp;quot;startupCompleted()&amp;quot;, self.myAdditionalInitializationSteps)&lt;/div&gt;</summary>
		<author><name>Phcerdan</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/Slicer&amp;diff=59382</id>
		<title>Documentation/Nightly/Developers/Tutorials/MigrationGuide/Slicer</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/MigrationGuide/Slicer&amp;diff=59382"/>
		<updated>2018-08-30T20:35:09Z</updated>

		<summary type="html">&lt;p&gt;Phcerdan: Add change from PlotData to PlotSeries&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Migration Guide ==&lt;br /&gt;
&lt;br /&gt;
=== Slicer 4.9: vtkMRMLPlotDataNode renamed to vtkMRMLPlotSeriesNode ===&lt;br /&gt;
Plotting was improved in [https://github.com/Slicer/Slicer/commit/082edc40c this commit]&lt;br /&gt;
&lt;br /&gt;
'''Replace this:'''&lt;br /&gt;
&lt;br /&gt;
  vtkMRMLPlotDataNode&lt;br /&gt;
&lt;br /&gt;
'''By this:'''&lt;br /&gt;
  vtkMRMLPlotSeriesNode&lt;br /&gt;
&lt;br /&gt;
=== Slicer 4.9: CMake: Module MIDAS not available  ===&lt;br /&gt;
&lt;br /&gt;
The test infrastructure of your project should be updated to use [https://cmake.org/cmake/help/latest/module/ExternalData.html ExternalData] built-in CMake module&lt;br /&gt;
instead of the specific &amp;lt;tt&amp;gt;MIDAS&amp;lt;/tt&amp;gt; module.&lt;br /&gt;
&lt;br /&gt;
See EMSegment commit [http://viewvc.slicer.org/viewvc.cgi/Slicer3?view=revision&amp;amp;revision=17150 r17150] for an example of transition.&lt;br /&gt;
&lt;br /&gt;
This means that instead of using &amp;lt;tt&amp;gt;midas_add_test&amp;lt;/tt&amp;gt; with the &amp;lt;tt&amp;gt;MIDAS{path/to/file.ext.md5}&amp;lt;/tt&amp;gt;&lt;br /&gt;
syntax for addressing the test data, the function [https://cmake.org/cmake/help/latest/module/ExternalData.html#command:externaldata_add_test ExternalData_add_target] is used by&lt;br /&gt;
specifying both &amp;lt;tt&amp;gt;DATA{path/to/file.ext}&amp;lt;/tt&amp;gt; and a download target name.&lt;br /&gt;
&lt;br /&gt;
'''Replace this:'''&lt;br /&gt;
&lt;br /&gt;
  midas_add_test(NAME test1 COMMAND ...)&lt;br /&gt;
  midas_add_test(NAME test2 COMMAND ...)&lt;br /&gt;
&lt;br /&gt;
'''By this:'''&lt;br /&gt;
&lt;br /&gt;
  ExternalData_add_test(EMSegmentData NAME test1 COMMAND ...)&lt;br /&gt;
  ExternalData_add_test(EMSegmentData NAME test2 COMMAND ...)&lt;br /&gt;
  &lt;br /&gt;
  [...]&lt;br /&gt;
  &lt;br /&gt;
  ExternalData_add_target(EMSegmentData)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A key difference with the former approaches is that instead of adding two tests (one named&lt;br /&gt;
&amp;lt;tt&amp;gt;&amp;lt;testName&amp;gt;_fetchData&amp;lt;/tt&amp;gt; to downoad the data and one running the test command), only one&lt;br /&gt;
test is added but a common download target is added at the end using [https://cmake.org/cmake/help/latest/module/ExternalData.html#command:externaldata_add_target ExternalData_add_target]&lt;br /&gt;
function.&lt;br /&gt;
&lt;br /&gt;
This means that test data can now be downloaded in parallel (and cached) at build time instead&lt;br /&gt;
of testing time.&lt;br /&gt;
&lt;br /&gt;
=== Slicer 4.9: CMake: Module SlicerMacroCheckExternalProjectDependency not available ===&lt;br /&gt;
&lt;br /&gt;
Since the module was removed in [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=26992 r26992], consider updating&lt;br /&gt;
your build system to use CMake module &amp;lt;code&amp;gt;ExternalProjectDependency&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Slicer 4.9: CMake: Module SlicerMacroEmptyExternalProject not available ===&lt;br /&gt;
&lt;br /&gt;
Since the module was removed in [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=26991 r26991]&lt;br /&gt;
&lt;br /&gt;
'''Replace this:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include(SlicerMacroEmptyExternalProject)&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
SlicerMacroEmptyExternalProject(&amp;quot;${proj}&amp;quot; &amp;quot;${${proj}_DEPENDENCIES}&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''By this:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include(ExternalProjectDependency)&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&lt;br /&gt;
ExternalProject_Add_Empty(${proj} DEPENDS ${${proj}_DEPENDENCIES})&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Slicer 4.9: CMake: Module SlicerBlockSetCMakeOSXVariables not available ===&lt;br /&gt;
&lt;br /&gt;
Since it was renamed to &amp;lt;tt&amp;gt;SlicerInitializeOSXVariables&amp;lt;/tt&amp;gt; in [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=26982 r26982]&lt;br /&gt;
&lt;br /&gt;
'''Replace this:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include(SlicerBlockSetCMakeOSXVariables)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''By this:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include(SlicerInitializeOSXVariables)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Slicer 4.9: Application: isRelease() function not available ===&lt;br /&gt;
&lt;br /&gt;
See [[#Slicer_4.8:_Application:_isRelease.28.29_function_not_available_or_deprecated]]&lt;br /&gt;
&lt;br /&gt;
=== Slicer 4.9: slicer.util.getNode() raises exception if node not found ===&lt;br /&gt;
&lt;br /&gt;
If slicer.util.getNode() is called and the node is not found then instead of just returning None (Slicer 4.8 behavior), the method now raises a MRMLNodeNotFoundException. This makes code debugging easier (the error is reported when it happens), and in general more consistent with Python conventions.&lt;br /&gt;
&lt;br /&gt;
How to update existing code:&lt;br /&gt;
&lt;br /&gt;
It is advisable to only use slicer.util.getNode in tests, or interactively in the Python console, as its behavior is somewhat unpredictable (it may either found a node by name or ID, and result of wildcard search is even less deterministic). In general, it is recommended to use the MRML scene's GetFirstNodeByName and GetNodeByID methods instead.&lt;br /&gt;
&lt;br /&gt;
'''Replace this:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
n = slicer.util.getNode(nodeNameOrID)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''By one of these:'''&lt;br /&gt;
&lt;br /&gt;
If node is to be found by name:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  n = slicer.mrmlScene.GetFirstNodeByName(nodeName)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If node is to be found by ID:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  n = slicer.mrmlScene.GetNodeByID(nodeID)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If node is to be found by name or ID (slower, less predictable, recommended for testing only):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
try:&lt;br /&gt;
  n = slicer.util.getNode(nodeNameOrID)&lt;br /&gt;
except slicer.util.MRMLNodeNotFoundException:&lt;br /&gt;
  n = None&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More information: https://github.com/Slicer/Slicer/commit/b63484af1b1b413f35396f8f7efb73e870448bd4&lt;br /&gt;
&lt;br /&gt;
===Slicer 4.8: Application: isRelease() function not available or deprecated===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Error message similar to:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    Missing/deprecated qSlicerCoreApplication::isRelease()&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
    Missing/deprecated slicer.app.isRelease()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;tt&amp;gt;qSlicerCoreApplication::releaseType() == &amp;quot;Stable&amp;quot;&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Summary:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Prior to r26420, the variable &amp;lt;tt&amp;gt;Slicer_VERSION_TWEAK&amp;lt;/tt&amp;gt; was used to check if a &amp;quot;stable release&amp;quot; was built. The variable value&lt;br /&gt;
was set by updating the sources and defining the variable to an integer greater or equal to 0. In other word, if the variable&lt;br /&gt;
evaluated to an empty string, a nighty or experimental build was being done, if it evaluated to an integer, a stable release build&lt;br /&gt;
was being done.&lt;br /&gt;
&lt;br /&gt;
The approach had few issues:&lt;br /&gt;
* the name of the variable was confusing&lt;br /&gt;
* identifying a &amp;quot;stable release&amp;quot; only from a source tree revision was not enough. Indeed the environment defining a &amp;quot;release&amp;quot; is the one found on the build machines used to generate the installer.&lt;br /&gt;
* nightly build are also considered as release&lt;br /&gt;
&lt;br /&gt;
To address this, the CMake variable &amp;lt;tt&amp;gt;Slicer_RELEASE_TYPE&amp;lt;/tt&amp;gt; was introduced. As of 2017-10-04, it can be set to &amp;lt;tt&amp;gt;Experimental&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;Nightly&amp;lt;/tt&amp;gt;&lt;br /&gt;
or &amp;lt;tt&amp;gt;Stable&amp;lt;/tt&amp;gt; with &amp;lt;tt&amp;gt;Experimental&amp;lt;/tt&amp;gt; being the value hard-coded in the source.&lt;br /&gt;
&lt;br /&gt;
Identifying a build as &amp;quot;stable&amp;quot; is now explicitly done by setting &amp;lt;tt&amp;gt;Slicer_RELEASE_TYPE&amp;lt;/tt&amp;gt; to &amp;lt;tt&amp;gt;Stable&amp;lt;/tt&amp;gt; at configure time.&lt;br /&gt;
&lt;br /&gt;
Also, since the concept of release types was introduced, the function &amp;lt;tt&amp;gt;isRelease()&amp;lt;/tt&amp;gt; has been removed in favor of &amp;lt;tt&amp;gt;releaseType()&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;References:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
https://github.com/Slicer/Slicer/pull/354&lt;br /&gt;
&lt;br /&gt;
===Slicer Python Module: modulewidget and others removed.===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; Summary&amp;lt;/b&amp;gt;&lt;br /&gt;
Python classes formerly in &amp;quot;slicer.moduledm&amp;quot;, &amp;quot;slicer.modulelogic&amp;quot;,  &amp;quot;slicer.modulemrml&amp;quot;&lt;br /&gt;
and &amp;quot;slicer.modulewidget&amp;quot; are now directly available in the slicer module.&lt;br /&gt;
&lt;br /&gt;
See example of change [https://github.com/QIICR/LongitudinalPETCT/pull/11 here].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Rational:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See comments in commit messages referenced blow.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;References:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
https://github.com/Slicer/Slicer/commit/628f83fe7a6f4e0710e306bcaf7c04b9e3e5e6bd&lt;br /&gt;
&lt;br /&gt;
https://github.com/Slicer/Slicer/commit/9cb5668fde1abc8f0430a91ca37fc29277ceeb4e&lt;br /&gt;
&lt;br /&gt;
===MRML: Slicer 4.6: Moved up vtkMRMLStorableNode in the MRML node hierarchy.===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Rational:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
vtkMRMLStorableNode is not a children of vtkMRMLTransformable node anymore,&lt;br /&gt;
but directly a children of vtkMRMLNode.&lt;br /&gt;
    &lt;br /&gt;
This allows making a node storable without requiring it to be also&lt;br /&gt;
transformable. It is important for several node types (color maps, tables,&lt;br /&gt;
etc), which require separate storage node but are not transformable.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;References:&amp;lt;/b&amp;gt;&lt;br /&gt;
* Changed introduced in [http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=24891 r24891]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Error message similar to:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    /tmp/LongitudinalPETCT/MRML/vtkMRMLLongitudinalPETCTStudyNode.cxx: In member function ‘void vtkMRMLLongitudinalPETCTStudyNode::ObserveRegistrationTransform(bool)’:&lt;br /&gt;
    /tmp/LongitudinalPETCT/MRML/vtkMRMLLongitudinalPETCTStudyNode.cxx:478:28: error: ‘class vtkMRMLVolumePropertyNode’ has no member named ‘GetParentTransformNode’&lt;br /&gt;
                   &amp;amp;&amp;amp; propNode-&amp;gt;GetParentTransformNode()&lt;br /&gt;
                                ^&lt;br /&gt;
    /tmp/LongitudinalPETCT/MRML/vtkMRMLLongitudinalPETCTStudyNode.cxx:480:23: error: ‘class vtkMRMLVolumePropertyNode’ has no member named ‘SetAndObserveTransformNodeID’&lt;br /&gt;
                 propNode-&amp;gt;SetAndObserveTransformNodeID(&lt;br /&gt;
                           ^&lt;br /&gt;
    /tmp/LongitudinalPETCT/MRML/vtkMRMLLongitudinalPETCTStudyNode.cxx:503:23: error: ‘class vtkMRMLVolumePropertyNode’ has no member named ‘SetAndObserveTransformNodeID’&lt;br /&gt;
                 propNode-&amp;gt;SetAndObserveTransformNodeID(NULL);&lt;br /&gt;
                           ^&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Removes lines and/or refactor code&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===MRML: Slicer 4.5: Introduction of vtkMRMLLabelMapVolumeNode===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Rational:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before &amp;lt;tt&amp;gt;vtkMRMLScalarVolumeNode&amp;lt;/tt&amp;gt; was used for both scalar and label map&lt;br /&gt;
volumes and the LabelMap custom MRML node attribute was used for&lt;br /&gt;
distinguishing between them (0=scalar; 1=label map volume).&lt;br /&gt;
&lt;br /&gt;
This made conversion between labelmap/scalar volumes very easy but made&lt;br /&gt;
it difficult to customize behavior, display, processing of segmentation&lt;br /&gt;
information.&lt;br /&gt;
&lt;br /&gt;
Now a new &amp;lt;tt&amp;gt;vtkMRMLLabelMapVolumeNode&amp;lt;/tt&amp;gt; class is used for storing segmentation&lt;br /&gt;
information (still using &amp;lt;tt&amp;gt;vtkMRMLScalarVolume&amp;lt;/tt&amp;gt; used as base class for backward&lt;br /&gt;
compatibility; but in the future the base class may be changed to reflect&lt;br /&gt;
that segmentation can be represented in various ways, not just as volumes).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Error message similar to:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  error: ‘class vtkMRMLScalarVolumeNode’ has no member named ‘SetLabelMap’&lt;br /&gt;
     outputVolumeNode-&amp;gt;SetLabelMap(1);&lt;br /&gt;
                       ^&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution (part1: down cast to &amp;lt;tt&amp;gt;vtkMRMLLabelMapVolumeNode&amp;lt;/tt&amp;gt;, remove call to &amp;lt;tt&amp;gt;SetLabelMap&amp;lt;/tt&amp;gt;)&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Replace lines like:&lt;br /&gt;
&lt;br /&gt;
     vtkMRMLNode* outputNode = d-&amp;gt;OutputLabelVolumeMRMLNodeComboBox-&amp;gt;currentNode();&lt;br /&gt;
     vtkMRMLScalarVolumeNode* outputVolumeNode = vtkMRMLScalarVolumeNode::SafeDownCast(outputNode);&lt;br /&gt;
     [...]&lt;br /&gt;
     outputVolumeNode-&amp;gt;SetLabelMap(1);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
&lt;br /&gt;
     vtkMRMLLabelMapVolumeNode* outputVolumeNode =&lt;br /&gt;
       vtkMRMLLabelMapVolumeNode::SafeDownCast(d-&amp;gt;OutputLabelVolumeMRMLNodeComboBox-&amp;gt;currentNode());&lt;br /&gt;
     [...]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution (part2: Update UI file):&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Replace lines like:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;widget class=&amp;quot;qMRMLNodeComboBox&amp;quot; name=&amp;quot;InputLabelVolumeMRMLNodeComboBox&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;property name=&amp;quot;nodeTypes&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;stringlist&amp;gt;&lt;br /&gt;
     &amp;lt;string&amp;gt;vtkMRMLScalarVolumeNode&amp;lt;/string&amp;gt;&lt;br /&gt;
    &amp;lt;/stringlist&amp;gt;&lt;br /&gt;
   &amp;lt;/property&amp;gt;&lt;br /&gt;
   [...]&lt;br /&gt;
  &amp;lt;/widget&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;widget class=&amp;quot;qMRMLNodeComboBox&amp;quot; name=&amp;quot;InputLabelVolumeMRMLNodeComboBox&amp;quot;&amp;gt;&lt;br /&gt;
   &amp;lt;property name=&amp;quot;nodeTypes&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;stringlist&amp;gt;&lt;br /&gt;
     &amp;lt;string&amp;gt;vtkMRMLLabelMapVolumeNode&amp;lt;/string&amp;gt;      &amp;lt;------------- Update Here&lt;br /&gt;
    &amp;lt;/stringlist&amp;gt;&lt;br /&gt;
   &amp;lt;/property&amp;gt;&lt;br /&gt;
   [...]&lt;br /&gt;
  &amp;lt;/widget&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution (part3: Update node selector configuration):&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Replace lines like:&lt;br /&gt;
&lt;br /&gt;
  nodeSelector.setNodeTypes(QStringList(&amp;quot;vtkMRMLScalarVolumeNode&amp;quot;));&lt;br /&gt;
  nodeSelector.addAttribute(&amp;quot;vtkMRMLScalarVolumeNode&amp;quot;, &amp;quot;LabelMap&amp;quot;, &amp;quot;1&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
&lt;br /&gt;
  nodeSelector.setNodeTypes(QStringList(&amp;quot;vtkMRMLLabelMapVolumeNode&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;References:&amp;lt;/b&amp;gt;&lt;br /&gt;
* http://www.slicer.org/slicerWiki/index.php/Documentation/Labs/Segmentations#vtkMRMLLabelMapVolumeNode_integration&lt;br /&gt;
* http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=24291&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===CLI: Slicer 4.3: Add ITKFactoryRegistration library centralizing ITK IO factory registration===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Rational:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  Linking against &amp;lt;tt&amp;gt;ITKFactoryRegistration&amp;lt;/tt&amp;gt; ensures that ITK IO factory are properly registered on all supported platforms.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Error message similar to:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  Undefined symbols for architecture x86_64:&lt;br /&gt;
  &amp;quot;itk::itkFactoryRegistration()&amp;quot;, referenced from:&lt;br /&gt;
  _main in ImageMakerTest.cxx.o&lt;br /&gt;
  ld: symbol(s) not found for architecture x86_64&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Solution:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Replace lines like:&lt;br /&gt;
&lt;br /&gt;
  target_link_libraries(${CLP}Test ${CLP}Lib)&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
&lt;br /&gt;
  target_link_libraries(${CLP}Test ${CLP}Lib ${SlicerExecutionModel_EXTRA_EXECUTABLE_TARGET_LIBRARIES})&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;References:&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&amp;amp;revision=21592&lt;br /&gt;
* https://issues.slicer.org/view.php?id=2813&lt;/div&gt;</summary>
		<author><name>Phcerdan</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/Debug_Instructions&amp;diff=59039</id>
		<title>Documentation/Nightly/Developers/Tutorials/Debug Instructions</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/Nightly/Developers/Tutorials/Debug_Instructions&amp;diff=59039"/>
		<updated>2018-05-28T16:29:46Z</updated>

		<summary type="html">&lt;p&gt;Phcerdan: /* Analyze a segmentation fault */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{documentation/versioncheck}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
==Background==&lt;br /&gt;
The executable Slicer application ''Slicer-Superbuild/Slicer-build/Slicer'' (or Slicer.exe) is the [[Documentation/{{documentation/version}}/Developers/Launcher|launcher]] of the real application binary ''Slicer-Superbuild/Slicer-build/bin/SlicerApp-real''.&lt;br /&gt;
&lt;br /&gt;
==Linux==&lt;br /&gt;
&lt;br /&gt;
===Analyze a segmentation fault===&lt;br /&gt;
 $ ulimit -c unlimited&lt;br /&gt;
 $ ./Slicer&lt;br /&gt;
 ... make it crash&lt;br /&gt;
 $ ./Slicer --gdb ./bin/SlicerApp-real&lt;br /&gt;
 (gdb) core core&lt;br /&gt;
 (gdb) backtrace&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
====With systemd====&lt;br /&gt;
In linux distros with systemd, coredumps are managed by the systemd daemon.&lt;br /&gt;
And stored, in a compressed format (.lz4), in &lt;br /&gt;
  /var/lib/systemd/coredump/core.SlicerApp-real.xxxx.lz4&lt;br /&gt;
&lt;br /&gt;
It can happen that even with ulimit -c unlimited, the coredump files are still truncated.&lt;br /&gt;
You can check latest coredumps, and the correspoding PID with:&lt;br /&gt;
  coredumpctl list&lt;br /&gt;
  Thu 2018-05-24 16:37:46 EDT   22544  1000  1000  11 missing   /usr/lib/firefox/firefox&lt;br /&gt;
  Fri 2018-05-25 15:50:52 EDT   14721  1000  1000   6 truncated /path/Slicer-build/bin/SlicerApp-real&lt;br /&gt;
  Mon 2018-05-28 11:35:43 EDT   17249  1000  1000   6 present   /path/Slicer-build/bin/SlicerApp-real&lt;br /&gt;
&lt;br /&gt;
You can modify systemd coredump to increase the default max file size in:&lt;br /&gt;
  /etc/systemd/coredump.conf&lt;br /&gt;
  [Coredump]&lt;br /&gt;
  #Storage=external&lt;br /&gt;
  #Compress=yes&lt;br /&gt;
  ProcessSizeMax=8G&lt;br /&gt;
  ExternalSizeMax=8G&lt;br /&gt;
  JournalSizeMax=6G&lt;br /&gt;
  #MaxUse=&lt;br /&gt;
  #KeepFree=&lt;br /&gt;
&lt;br /&gt;
After that change, make Slicer crash again, and the core file will be present, instead of truncated.&lt;br /&gt;
&lt;br /&gt;
You can launch gdb with a coredump file with the command:&lt;br /&gt;
  coredumpctl gdb $PID&lt;br /&gt;
If no $PID is provided, the latest coredump is used. PID can be retrieved using `coredumpctl list`.&lt;br /&gt;
&lt;br /&gt;
To decompress the coredump file to use with other IDE or ddd, change the coredump.conf Compress option, or use:&lt;br /&gt;
  coredumpctl dump $PID &amp;gt; /tmp/corefile&lt;br /&gt;
&lt;br /&gt;
===GDB debug with launch arguments===&lt;br /&gt;
The Slicer app launcher provides options to start other programs with the Slicer environment settings. &lt;br /&gt;
&lt;br /&gt;
*&amp;lt;code&amp;gt;--launch &amp;lt;executable&amp;gt; [&amp;lt;parameters&amp;gt;]&amp;lt;/code&amp;gt;: executes an arbitrary program. For example, &amp;lt;code&amp;gt;Slicer --launch /usr/bin/gnome-terminal&amp;lt;/code&amp;gt; starts gnome-terminal (then run GDB directly on SlicerQT-real)&lt;br /&gt;
*&amp;lt;code&amp;gt;--gdb&amp;lt;/code&amp;gt;: runs GDB then executes SlicerQT-real from within the debugger environment.&lt;br /&gt;
&lt;br /&gt;
===GDB debug by attaching to running process [RECOMMENDED] ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol start=&amp;quot;1&amp;quot; style=&amp;quot;list-style-type: decimal;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Starting with Ubuntu 10.10, ptracing of non-child processes by non-root users as been disabled -ie. only a process which is a parent of another process can ptrace it for normal users.&lt;br /&gt;
  &amp;lt;ol style=&amp;quot;list-style-type:none; border-left:thick solid red; padding-left:1em;&amp;quot;&amp;gt;  &lt;br /&gt;
    &amp;lt;li&amp;gt;&lt;br /&gt;
      &amp;lt;p&amp;gt;You can temporarily disable this restriction by:&amp;lt;/p&amp;gt;&lt;br /&gt;
      &amp;lt;pre&amp;gt;$ echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope&amp;lt;/pre&amp;gt;&lt;br /&gt;
    &amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;&lt;br /&gt;
      &amp;lt;p&amp;gt;To permanently allow it to edit &amp;lt;code&amp;gt;/etc/sysctl.d/10-ptrace.conf&amp;lt;/code&amp;gt; and change the line:&amp;lt;/p&amp;gt;&lt;br /&gt;
      &amp;lt;pre&amp;gt;kernel.yama.ptrace_scope = 1&amp;lt;/pre&amp;gt;&lt;br /&gt;
      &amp;lt;p&amp;gt;to read:&amp;lt;/p&amp;gt;&lt;br /&gt;
      &amp;lt;pre&amp;gt;kernel.yama.ptrace_scope = 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
    &amp;lt;/li&amp;gt;&lt;br /&gt;
    &amp;lt;li&amp;gt;For more details: http://askubuntu.com/questions/41629/after-upgrade-gdb-wont-attach-to-process&amp;lt;/li&amp;gt;&lt;br /&gt;
  &amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;Running Slicer with the following command line argument will allow you to easily obtain the associated PID:&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;pre&amp;gt;$ ./Slicer --attach-process&amp;lt;/pre&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;This will bring up a window with the &amp;lt;code&amp;gt;PID&amp;lt;/code&amp;gt; before loading any modules, which is also helpful for debugging the loading process.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;Then, you can attach the process to &amp;lt;code&amp;gt;gdb&amp;lt;/code&amp;gt; using the following command:&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;pre&amp;gt;$ gdb --pid $PIDABOVE&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;Finally type the following gdb command&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;pre&amp;gt;(gdb) continue&amp;lt;/pre&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;If not using the &amp;lt;code&amp;gt;--attach-process&amp;lt;/code&amp;gt;, the &amp;lt;code&amp;gt;PID&amp;lt;/code&amp;gt; could be obtain using the following command:&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;pre&amp;gt;$ ps -Afww | grep SlicerApp-real&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GDB debug by using exec-wrapper===&lt;br /&gt;
An alternative approach is to use a wrapper script to emulate the functionality of the app launcher. This will allow you to use gdb or a gdb-controlling program such as an IDE, in order to interactively debug directly from GDB without attaching.&lt;br /&gt;
&lt;br /&gt;
The general idea of the wrapper is to set all of the appropriate environment variables as they would be set by the app launcher. From SlicerLauncherSettings:&lt;br /&gt;
*[LibraryPath] contents should be in LD_LIBRARY_PATH&lt;br /&gt;
*[Paths] contents should be in PATH&lt;br /&gt;
*[EnvironmentVariables] should each be set&lt;br /&gt;
&lt;br /&gt;
See [[Slicer4:Example_Wrapper_Script|this example script]]&lt;br /&gt;
&lt;br /&gt;
Now, start gdb and do the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
(gdb) set exec-wrapper ./WrapSlicer4 &lt;br /&gt;
(gdb) exec-file ./bin/SlicerQT-real&lt;br /&gt;
(gdb) run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since VTK and ITK include many multithreaded filters, by default you will see lots of messages like the following from gdb during rendering and processing:&lt;br /&gt;
 [New Thread 0x7fff8378f700 (LWP 20510)]&lt;br /&gt;
 [Thread 0x7fff8b0aa700 (LWP 20506) exited]&lt;br /&gt;
&lt;br /&gt;
These can be turned off with this command:&lt;br /&gt;
 set print thread-events off&lt;br /&gt;
&lt;br /&gt;
===GDB debug in CodeLite IDE===&lt;br /&gt;
&lt;br /&gt;
[[{{FULLPAGENAME}}/CodeLite|Linux debugging with CodeLite IDE]]&lt;br /&gt;
&lt;br /&gt;
===Using QtCreator===&lt;br /&gt;
&lt;br /&gt;
See [[Documentation/{{documentation/version}}/Developers/Tutorials/QtCreator|QtCreator page]] for instructions.&lt;br /&gt;
&lt;br /&gt;
== Windows ==&lt;br /&gt;
&lt;br /&gt;
=== Using Visual Studio ===&lt;br /&gt;
&lt;br /&gt;
Note: SimpleITK has to be disabled for building in debug mode. See more information at http://www.na-mic.org/Bug/view.php?id=3816 .&lt;br /&gt;
&lt;br /&gt;
For VisualStudio it's also possible to run the IDE with the correct environment to debug slicer.&lt;br /&gt;
&lt;br /&gt;
* Start VisualStudio by using the launcher. Run: &amp;lt;code&amp;gt;Slicer.exe --VisualStudio&amp;lt;/code&amp;gt;&lt;br /&gt;
** If you use non-supported VisualStudio version (e.g., VS2010, VS2012, ...) then you may have to start the executable of the VisualStudio IDE manually with the --launch option, for example: &amp;lt;code&amp;gt;Slicer.exe --launch &amp;quot;c:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe&amp;quot;&amp;lt;/code&amp;gt;&lt;br /&gt;
* When Visual Studio is started, open the &amp;lt;code&amp;gt;...\Slicer-build\Slicer.sln&amp;lt;/code&amp;gt; solution&lt;br /&gt;
* Set the SlicerApp as StartUp project (right-click on SlicerApp project and select &amp;quot;Set as StartUp Project&amp;quot;)&lt;br /&gt;
* Run Slicer in debug mode by Start Debugging command (in Debug menu).&lt;br /&gt;
&lt;br /&gt;
Note that because CMake re-creates the solution file from within the build process, Visual Studio will sometimes need to stop and reload the project, requiring manual button pressing on your part (just press Yes or OK whenever you are asked).  To avoid this, you can use a script to complete the build process and then re-start the Visual Studio.&lt;br /&gt;
&lt;br /&gt;
===Using QtCreator===&lt;br /&gt;
See [[Documentation/{{documentation/version}}/Developers/Tutorials/QtCreator|QtCreator page]] for instructions.&lt;br /&gt;
&lt;br /&gt;
=== Using shell scripts for building/re-building Slicer ===&lt;br /&gt;
&lt;br /&gt;
==== Using batch (.bat) files ====&lt;br /&gt;
&lt;br /&gt;
Copy-paste the content below into a file called ''BuildSlicer.bat'' and run it to build or re-build Slicer. Check and if necessary update the first few lines with the actual location of source code and tools on your computer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set SLICER_SOURCE_DIR=&amp;quot;c:\D\S4&amp;quot;&lt;br /&gt;
set SLICER_BIN_DIR=&amp;quot;c:\D\S4R&amp;quot;&lt;br /&gt;
set SLICER_QMAKE_EXE=&amp;quot;c:\D\Support\qt-4.8.7-64-vs2013-rel\bin\qmake.exe&amp;quot;&lt;br /&gt;
set CMAKE_EXE=&amp;quot;C:\Program Files (x86)\CMake\bin\cmake.exe&amp;quot;&lt;br /&gt;
set CTEST_EXE=&amp;quot;C:\Program Files (x86)\CMake\bin\ctest.exe&amp;quot;&lt;br /&gt;
&lt;br /&gt;
mkdir %SLICER_BIN_DIR%&lt;br /&gt;
cd /d %SLICER_BIN_DIR%&lt;br /&gt;
%CMAKE_EXE% %SLICER_SOURCE_DIR% -G &amp;quot;Visual Studio 12 2013 Win64&amp;quot; -DQT_QMAKE_EXECUTABLE:PATH=%SLICER_QMAKE_EXE% -DSlicer_USE_PYTHONQT_WITH_OPENSSL:BOOL=OFF -DSlicer_USE_SimpleITK:BOOL=OFF&lt;br /&gt;
%CTEST_EXE% -D Experimental&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Experimental: Using Cygwin ====&lt;br /&gt;
If you use cygwin, you can create simple shell scripts, for example in /usr/local/bin, which these several steps at once when run from the Slicer4-superbuild directory:&lt;br /&gt;
&lt;br /&gt;
* ''s4build'' (slicer4 build)&lt;br /&gt;
 (cd Slicer-build; cmake.exe -VV --debug-output . &amp;amp;&amp;amp; ./Slicer.exe --VisualStudio Slicer.sln /out buildlog.txt /build)&lt;br /&gt;
 (cd Slicer-build; ./Slicer.exe --VisualStudio Slicer.sln)&lt;br /&gt;
* ''s4sbuild'' (slicer4 super build)&lt;br /&gt;
 (cmake.exe -VV --debug-output . &amp;amp;&amp;amp; ./Slicer-build/Slicer.exe --VisualStudio Slicer.sln /out buildlog.txt /build)&lt;br /&gt;
 (cd Slicer-build; ./Slicer.exe --VisualStudio Slicer.sln)&lt;br /&gt;
&lt;br /&gt;
The ''s4build'' command re-runs cmake and then runs the build of Slicer only.  When this completes, it launches visual studio with slicer loaded for debugging.&lt;br /&gt;
&lt;br /&gt;
''s4sbuild'' is similar, but it runs the superbuild process so that all the dependency libraries are updated.  This takes longer, but is sometimes needed when there has been a change to CTK or other tools.&lt;br /&gt;
&lt;br /&gt;
Note the buildlog.txt files for checking if anything went wrong.&lt;br /&gt;
&lt;br /&gt;
== Mac (Xcode) ==&lt;br /&gt;
&lt;br /&gt;
===Using Xcode===&lt;br /&gt;
&lt;br /&gt;
[[image:Xcode-scheme-Screen Shot 2012-10-05 at 10.13.30 AM.png|thumb|right|200px]]&lt;br /&gt;
&lt;br /&gt;
As of slicer 4.2, we do not support building using Xcode, however if you build slicer using traditional unix Makefiles you can still debug using the powerful source debugging features of Xcode.  &lt;br /&gt;
&lt;br /&gt;
''Note: You need to set up a dummy project in Xcode just to enable some of the options.''  This means that Xcode will create a MacOS code template, but you won't use it directly (instead you will point to the code you build with cmake/make).&lt;br /&gt;
&lt;br /&gt;
==== Attaching to a running process ====&lt;br /&gt;
&lt;br /&gt;
You can use the Attach to Process option in the Xcode Product menu for debugging.  This will allow you to get browsable stack traces for crashes.&lt;br /&gt;
&lt;br /&gt;
Steps:&lt;br /&gt;
# Start Slicer&lt;br /&gt;
# Start Xcode&lt;br /&gt;
# Use the Product-&amp;gt;Attach to Process... menu&lt;br /&gt;
&lt;br /&gt;
====Setting Breakpoints====&lt;br /&gt;
To set a breakpoint in code that is not crashing, you can set it via the command line interface.  For the lldb debugger, first attach to the process and break the program.  Then at the (lldb) prompt, stop at a method as follows:&lt;br /&gt;
&lt;br /&gt;
 breakpoint set -M vtkMRMLScene::Clear&lt;br /&gt;
&lt;br /&gt;
then you can single step and/or set other breakpoints in that file.&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can use the Product-&amp;gt;Debug-&amp;gt;Create a Symbolic Breakpoint... option.  This is generally preferable to the lldb level debugging, since it shows up in the Breakpoints pane and can be toggled/deleted with the GUI.&lt;br /&gt;
&lt;br /&gt;
====Debugging the Startup Process====&lt;br /&gt;
&lt;br /&gt;
To debug startup issues you can set up a 'Scheme' and select the Slicer.app in your Slicer-build directory (see screen shot).  You can set up multiple schemes with different command line arguments and executables (for example to debug tests).&lt;br /&gt;
&lt;br /&gt;
Since you are using a dummy project but want to debug the slicer application, you need to do the following:&lt;br /&gt;
# Start Xcode and open dummy project&lt;br /&gt;
# Pick Product-&amp;gt;Edit Scheme...&lt;br /&gt;
# Select the Run section&lt;br /&gt;
# Select the Info tab&lt;br /&gt;
# Pick Slicer.app as the Executable&lt;br /&gt;
# Click OK&lt;br /&gt;
# Now the Run button will start Slicer for debugging&lt;br /&gt;
&lt;br /&gt;
Note that you can create multiple schemes, each various command line options to pass to slicer so you can easily get back to a debugging environment.&lt;br /&gt;
&lt;br /&gt;
===Using QtCreator===&lt;br /&gt;
See [[Documentation/{{documentation/version}}/Developers/Tutorials/QtCreator|QtCreator page]] for instructions.&lt;br /&gt;
&lt;br /&gt;
===Profiling===&lt;br /&gt;
The [http://en.wikipedia.org/wiki/Instruments_%28application%29 Instruments] tool is very useful for profiling.&lt;br /&gt;
&lt;br /&gt;
==Debugging a Test==&lt;br /&gt;
Once VisualStudio is open with the Slicer environment loaded, it is possible to run and debug tests.&lt;br /&gt;
To run all tests, build the ''RUN_TESTS'' project.&lt;br /&gt;
#To debug a test, find its project:&lt;br /&gt;
##Libs/MRML/Core tests are in the ''MRMLCoreCxxTests'' project&lt;br /&gt;
##CLI tests are in ''CLI_NAMETest'' project (e.g. ThresholdScalarVolumeTest) &lt;br /&gt;
##Loadable module tests are in ''qSlicerLOADABLE_NAMECxxTests'' project (e.g. qSlicerVolumeRenderingCxxTests) &lt;br /&gt;
##Module logic tests are in ''MODULE_NAMELogicCxxTests'' project (e.g. VolumeRenderingLogicCxxTests) &lt;br /&gt;
##Module widgets tests are in ''MODULE_NAMEWidgetsCxxTests'' project (e.g. VolumesWidgetsCxxTests)&lt;br /&gt;
#Go to the project debugging properties (right click -&amp;gt; Properties, then Configuration Properties/Debugging)&lt;br /&gt;
#In ''Command Arguments'', type the name of the test (e.g. &amp;lt;code&amp;gt;vtkMRMLSceneImportTest&amp;lt;/code&amp;gt; for project MRMLCoreCxxTests)&lt;br /&gt;
# If the test takes argument(s), enter the argument(s) after the test name in ''Command Arguments'' (e.g. &amp;lt;code&amp;gt;vtkMRMLSceneImportTest C:\Path\To\Slicer4\Libs\MRML\Core\Testing\vol_and_cube.mrml&amp;lt;/code&amp;gt;)&lt;br /&gt;
## You can see what arguments are passed by the dashboards by looking at the test details in [http://slicer.cdash.org/index.php?project=Slicer4 CDash].&lt;br /&gt;
## Most VTK and Qt tests support the &amp;lt;code&amp;gt;-I&amp;lt;/code&amp;gt; argument, it allows the test to be run in &amp;quot;interactive&amp;quot; mode. It doesn't exit at the end of the test.&lt;br /&gt;
# Make the project ''Set As StartUp Project''&lt;br /&gt;
# ''Start Debugging (F5)''&lt;br /&gt;
&lt;br /&gt;
==Debugging Python scripts==&lt;br /&gt;
&lt;br /&gt;
See [[Documentation/{{documentation/version}}/Developers/Python_scripting#How_can_I_use_a_visual_debugger_for_step-by-step_debugging|Python scripting page]].&lt;br /&gt;
&lt;br /&gt;
{{:Documentation/{{documentation/version}}/Developers/FAQ/Debugging|Debugging}}&lt;/div&gt;</summary>
		<author><name>Phcerdan</name></author>
		
	</entry>
</feed>