<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.slicer.org/w/index.php?action=history&amp;feed=atom&amp;title=Documentation%2F4.10%2FDevelopers%2FTutorials%2FMigrationGuide%2FVTK7-Qt4-to-VTK8-Qt5</id>
	<title>Documentation/4.10/Developers/Tutorials/MigrationGuide/VTK7-Qt4-to-VTK8-Qt5 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.slicer.org/w/index.php?action=history&amp;feed=atom&amp;title=Documentation%2F4.10%2FDevelopers%2FTutorials%2FMigrationGuide%2FVTK7-Qt4-to-VTK8-Qt5"/>
	<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/4.10/Developers/Tutorials/MigrationGuide/VTK7-Qt4-to-VTK8-Qt5&amp;action=history"/>
	<updated>2026-04-12T15:20:45Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.33.0</generator>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/4.10/Developers/Tutorials/MigrationGuide/VTK7-Qt4-to-VTK8-Qt5&amp;diff=59812&amp;oldid=prev</id>
		<title>UpdateBot: Nightly -&gt; 4.10</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/4.10/Developers/Tutorials/MigrationGuide/VTK7-Qt4-to-VTK8-Qt5&amp;diff=59812&amp;oldid=prev"/>
		<updated>2018-10-19T00:43:55Z</updated>

		<summary type="html">&lt;p&gt;Nightly -&amp;gt; 4.10&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;noinclude&amp;gt;__TOC__&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
==Transition from VTK7-Qt4 to VTK8-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;
===VTK 8.2: 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>UpdateBot</name></author>
		
	</entry>
</feed>