<?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.1%2FDevelopers%2FTutorials%2FWidgetWriting</id>
	<title>Documentation/4.1/Developers/Tutorials/WidgetWriting - 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.1%2FDevelopers%2FTutorials%2FWidgetWriting"/>
	<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/4.1/Developers/Tutorials/WidgetWriting&amp;action=history"/>
	<updated>2026-05-04T09:00:14Z</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.1/Developers/Tutorials/WidgetWriting&amp;diff=32250&amp;oldid=prev</id>
		<title>UpdateBot: Prepend documentation/versioncheck template. See http://na-mic.org/Mantis/view.php?id=2887</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/4.1/Developers/Tutorials/WidgetWriting&amp;diff=32250&amp;oldid=prev"/>
		<updated>2013-06-14T07:24:11Z</updated>

		<summary type="html">&lt;p&gt;Prepend documentation/versioncheck template. See http://na-mic.org/Mantis/view.php?id=2887&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 07:24, 14 June 2013&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot; &gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;noinclude&amp;gt;{{documentation/versioncheck}}&amp;lt;/noinclude&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=Creating a custom widget in Slicer=&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=Creating a custom widget in Slicer=&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Intro==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Intro==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>UpdateBot</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/4.1/Developers/Tutorials/WidgetWriting&amp;diff=27605&amp;oldid=prev</id>
		<title>Dmwelch: /* Coding style */</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/4.1/Developers/Tutorials/WidgetWriting&amp;diff=27605&amp;oldid=prev"/>
		<updated>2012-07-11T17:47:26Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Coding style&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 17:47, 11 July 2012&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l20&quot; &gt;Line 20:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 20:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The name of the custom widgets must follow the pattern: &amp;lt;code&amp;gt;qMRML[customName][baseQtWidget]&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;[baseQtWidget]&amp;lt;/code&amp;gt; is the name of the qt widget your custom widget inherits from (i.e. &amp;lt;code&amp;gt;ComboBox&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Slider&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Dialog&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Widget&amp;lt;/code&amp;gt;...), and &amp;lt;code&amp;gt;[customName]&amp;lt;/code&amp;gt; is a descriptive name. Examples:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The name of the custom widgets must follow the pattern: &amp;lt;code&amp;gt;qMRML[customName][baseQtWidget]&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;[baseQtWidget]&amp;lt;/code&amp;gt; is the name of the qt widget your custom widget inherits from (i.e. &amp;lt;code&amp;gt;ComboBox&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Slider&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Dialog&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Widget&amp;lt;/code&amp;gt;...), and &amp;lt;code&amp;gt;[customName]&amp;lt;/code&amp;gt; is a descriptive name. Examples:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*&amp;lt;code&amp;gt;qMRMLLinearTransformSlider&amp;lt;/code&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*&amp;lt;code&amp;gt;qMRMLLinearTransformSlider&amp;lt;/code&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*&amp;lt;code&amp;gt;&amp;lt;s&amp;gt;qMRMLMatrix&amp;lt;/s&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;qMRMLMatrixWidget&amp;lt;/code&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*&amp;lt;code&amp;gt;&amp;lt;s&amp;gt;qMRMLMatrix&amp;lt;/s&amp;gt;&amp;lt;/code&amp;gt; &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;vs. &lt;/ins&gt;&amp;lt;code&amp;gt;qMRMLMatrixWidget&amp;lt;/code&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Note==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Note==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Dmwelch</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/4.1/Developers/Tutorials/WidgetWriting&amp;diff=27568&amp;oldid=prev</id>
		<title>Dmwelch: Added link to Qt webpage</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/4.1/Developers/Tutorials/WidgetWriting&amp;diff=27568&amp;oldid=prev"/>
		<updated>2012-06-28T14:30:38Z</updated>

		<summary type="html">&lt;p&gt;Added link to Qt webpage&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 14:30, 28 June 2012&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l125&quot; &gt;Line 125:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 125:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Finally add your widget in the method &amp;lt;code&amp;gt;qMRMLWidgetsPlugins::customWidgets()&amp;lt;/code&amp;gt; of the file &amp;lt;i&amp;gt;Libs/MRML/Widgets/DesignerPlugins/qMRMLWidgetsPlugins.h&amp;lt;/i&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Finally add your widget in the method &amp;lt;code&amp;gt;qMRMLWidgetsPlugins::customWidgets()&amp;lt;/code&amp;gt; of the file &amp;lt;i&amp;gt;Libs/MRML/Widgets/DesignerPlugins/qMRMLWidgetsPlugins.h&amp;lt;/i&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*compile&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*compile&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Congratulations, you just added a custom widget in a plugin that can be read by QDesigner. Read the [[Documentation/4.1/Developers/Tutorials/QtDesigner |&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;next &lt;/del&gt;tutorial]] to learn how you can use the widget &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;into &lt;/del&gt;Qt Designer.&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Congratulations, you just added a custom widget in a plugin that can be read by QDesigner. Read the [[Documentation/4.1/Developers/Tutorials/QtDesigner |&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;QtDesigner &lt;/ins&gt;tutorial]] to learn how you can use the widget &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;in [http://qt.nokia.com/products/developer-tools/ &lt;/ins&gt;Qt Designer&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;]&lt;/ins&gt;.&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''Coding style:'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''Coding style:'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;For a better code readability, make sure you respect the alphabetical order of the files in &amp;lt;i&amp;gt;CMakeLists.txt&amp;lt;/i&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;For a better code readability, make sure you respect the alphabetical order of the files in &amp;lt;i&amp;gt;CMakeLists.txt&amp;lt;/i&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Dmwelch</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/4.1/Developers/Tutorials/WidgetWriting&amp;diff=27567&amp;oldid=prev</id>
		<title>Dmwelch: Fixed QtDesigner tutorial link</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/4.1/Developers/Tutorials/WidgetWriting&amp;diff=27567&amp;oldid=prev"/>
		<updated>2012-06-28T14:27:25Z</updated>

		<summary type="html">&lt;p&gt;Fixed QtDesigner tutorial link&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 14:27, 28 June 2012&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l125&quot; &gt;Line 125:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 125:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Finally add your widget in the method &amp;lt;code&amp;gt;qMRMLWidgetsPlugins::customWidgets()&amp;lt;/code&amp;gt; of the file &amp;lt;i&amp;gt;Libs/MRML/Widgets/DesignerPlugins/qMRMLWidgetsPlugins.h&amp;lt;/i&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Finally add your widget in the method &amp;lt;code&amp;gt;qMRMLWidgetsPlugins::customWidgets()&amp;lt;/code&amp;gt; of the file &amp;lt;i&amp;gt;Libs/MRML/Widgets/DesignerPlugins/qMRMLWidgetsPlugins.h&amp;lt;/i&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*compile&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*compile&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Congratulations, you just added a custom widget in a plugin that can be read by QDesigner. Read the [[&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Slicer3:&lt;/del&gt;Developers&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;:Projects:QtSlicer:&lt;/del&gt;Tutorials&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;:&lt;/del&gt;QtDesigner|next tutorial]] to learn how you can use the widget into Qt Designer.&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Congratulations, you just added a custom widget in a plugin that can be read by QDesigner. Read the [[&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Documentation/4.1/&lt;/ins&gt;Developers&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;/&lt;/ins&gt;Tutorials&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;/&lt;/ins&gt;QtDesigner |next tutorial]] to learn how you can use the widget into Qt Designer.&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''Coding style:'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''Coding style:'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;For a better code readability, make sure you respect the alphabetical order of the files in &amp;lt;i&amp;gt;CMakeLists.txt&amp;lt;/i&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;For a better code readability, make sure you respect the alphabetical order of the files in &amp;lt;i&amp;gt;CMakeLists.txt&amp;lt;/i&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Dmwelch</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/4.1/Developers/Tutorials/WidgetWriting&amp;diff=27566&amp;oldid=prev</id>
		<title>Dmwelch: Updated directories for Slicer4</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/4.1/Developers/Tutorials/WidgetWriting&amp;diff=27566&amp;oldid=prev"/>
		<updated>2012-06-28T14:23:05Z</updated>

		<summary type="html">&lt;p&gt;Updated directories for Slicer4&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 14:23, 28 June 2012&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l12&quot; &gt;Line 12:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 12:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;There are 2 locations where custom widgets can be. You first have to decide where your custom widget should go:&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;There are 2 locations where custom widgets can be. You first have to decide where your custom widget should go:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*&amp;lt;i&amp;gt;CTK&amp;lt;/i&amp;gt;: Qt and/or VTK only&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*&amp;lt;i&amp;gt;CTK&amp;lt;/i&amp;gt;: Qt and/or VTK only&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*&amp;lt;i&amp;gt;Slicer3/Libs/qMRMLWidgets&amp;lt;/i&amp;gt;: MRML-aware widgets&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*&amp;lt;i&amp;gt;Slicer3/Libs/qMRMLWidgets&amp;lt;/i&amp;gt;: MRML-aware widgets &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;(Slicer3)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;*&amp;lt;i&amp;gt;Slicer/Libs/MRML/Widgets&amp;lt;/i&amp;gt;: MRML-aware widgets (Slicer4)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;A good practice is to split (as possible) your custom widget in 2: a QT-only widget and a MRML-aware widget where the MRML-aware widgets inherits from the Qt-only widget. An intermediate level can be added for Qt and VTK widgets.&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;A good practice is to split (as possible) your custom widget in 2: a QT-only widget and a MRML-aware widget where the MRML-aware widgets inherits from the Qt-only widget. An intermediate level can be added for Qt and VTK widgets.&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;It is important to keep the widgets basic. If you think someone else can use your custom widget differently, or if someone would need less features than the custom widget currently have, it is probably a good idea to split the widget in 2 widgets linked with an IS-A relationship.&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;It is important to keep the widgets basic. If you think someone else can use your custom widget differently, or if someone would need less features than the custom widget currently have, it is probably a good idea to split the widget in 2 widgets linked with an IS-A relationship.&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l25&quot; &gt;Line 25:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 26:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Step by step==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Step by step==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Create your widget files (.h and .cxx) in the &amp;lt;i&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Lib&lt;/del&gt;/&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;qMRMLWidgets&lt;/del&gt;&amp;lt;/i&amp;gt; directory.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Create your widget files (.h and .cxx) in the &amp;lt;i&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Libs&lt;/ins&gt;/&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;MRML/Widgets&lt;/ins&gt;&amp;lt;/i&amp;gt; directory.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;**If you use a &amp;lt;i&amp;gt;.ui&amp;lt;/i&amp;gt; file, add it in the &amp;lt;i&amp;gt;Libs/&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;qMRMLWidgets&lt;/del&gt;/Resources/UI&amp;lt;/i&amp;gt; directory&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;**If you use a &amp;lt;i&amp;gt;.ui&amp;lt;/i&amp;gt; file, add it in the &amp;lt;i&amp;gt;Libs/&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;MRML/Widgets&lt;/ins&gt;/Resources/UI&amp;lt;/i&amp;gt; directory&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;**If you use icon files, add them in the &amp;lt;i&amp;gt;Libs/&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;qMRMLWidgets&lt;/del&gt;/Resources/Icons&amp;lt;/i&amp;gt; directory and update the &amp;lt;i&amp;gt;Libs/&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;qMRMLWidgets&lt;/del&gt;/Resources/qMRMLWidgets.qrc&amp;lt;/i&amp;gt; file accordingly&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;**If you use icon files, add them in the &amp;lt;i&amp;gt;Libs/&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;MRML/Widgets&lt;/ins&gt;/Resources/Icons&amp;lt;/i&amp;gt; directory and update the &amp;lt;i&amp;gt;Libs/&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;MRML/Widgets&lt;/ins&gt;/Resources/qMRMLWidgets.qrc&amp;lt;/i&amp;gt; file accordingly&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Update the &amp;lt;i&amp;gt;Libs/&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;qMRMLWidgets&lt;/del&gt;/CMakeLists.txt&amp;lt;/i&amp;gt; file with your widget files.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Update the &amp;lt;i&amp;gt;Libs/&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;MRML/Widgets&lt;/ins&gt;/CMakeLists.txt&amp;lt;/i&amp;gt; file with your widget files.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** add the &amp;lt;i&amp;gt;.h&amp;lt;/i&amp;gt; and &amp;lt;i&amp;gt;.cxx&amp;lt;/i&amp;gt; files in the &amp;lt;code&amp;gt;qMRMLWidgets_SRCS&amp;lt;/code&amp;gt; variable&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** add the &amp;lt;i&amp;gt;.h&amp;lt;/i&amp;gt; and &amp;lt;i&amp;gt;.cxx&amp;lt;/i&amp;gt; files in the &amp;lt;code&amp;gt;qMRMLWidgets_SRCS&amp;lt;/code&amp;gt; variable&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** add the &amp;lt;i&amp;gt;.h&amp;lt;/i&amp;gt; file in the &amp;lt;code&amp;gt;qMRMLWidgets_MOC_SRCS&amp;lt;/code&amp;gt; variable&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** add the &amp;lt;i&amp;gt;.h&amp;lt;/i&amp;gt; file in the &amp;lt;code&amp;gt;qMRMLWidgets_MOC_SRCS&amp;lt;/code&amp;gt; variable&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l39&quot; &gt;Line 39:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 40:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;For a general presentation to create custom widgets for Qt Designer, see http://doc.trolltech.com/designer-creating-custom-widgets.html&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;For a general presentation to create custom widgets for Qt Designer, see http://doc.trolltech.com/designer-creating-custom-widgets.html&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Step by step==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Step by step==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Copy paste this template in the &amp;lt;i&amp;gt;Libs/&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;qMRMLWidgets&lt;/del&gt;/Plugins&amp;lt;/i&amp;gt; directory.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Copy paste this template in the &amp;lt;i&amp;gt;Libs/&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;MRML/Widgets&lt;/ins&gt;/Plugins&amp;lt;/i&amp;gt; directory.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{|&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{|&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l69&quot; &gt;Line 69:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 70:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|}&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Replace &amp;lt;i&amp;gt;CustomWidget&amp;lt;/i&amp;gt; with the name of your widget&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Replace &amp;lt;i&amp;gt;CustomWidget&amp;lt;/i&amp;gt; with the name of your widget&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Copy-paste the following template in the &amp;lt;i&amp;gt;Libs/&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;qMRMLWidgets&lt;/del&gt;/&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Plugins&lt;/del&gt;&amp;lt;/i&amp;gt; directory.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Copy-paste the following template in the &amp;lt;i&amp;gt;Libs/&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;MRML&lt;/ins&gt;/&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Widgets/DesignerPlugins&lt;/ins&gt;&amp;lt;/i&amp;gt; directory.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{|&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{|&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|&amp;lt;pre&amp;gt;#include &amp;quot;qMRMLCustomWidgetPlugin.h&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|&amp;lt;pre&amp;gt;#include &amp;quot;qMRMLCustomWidgetPlugin.h&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l119&quot; &gt;Line 119:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 120:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*If the widget is a container, return &amp;lt;code&amp;gt;true&amp;lt;/code in the method &amp;lt;code&amp;gt;isContainer()&amp;lt;/code&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*If the widget is a container, return &amp;lt;code&amp;gt;true&amp;lt;/code in the method &amp;lt;code&amp;gt;isContainer()&amp;lt;/code&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*You can customize how the widget is instantiated in the designer by reimplementing the method &amp;lt;code&amp;gt;domxml()&amp;lt;/code&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*You can customize how the widget is instantiated in the designer by reimplementing the method &amp;lt;code&amp;gt;domxml()&amp;lt;/code&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Update &amp;lt;i&amp;gt;Libs/&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;qMRMLWidgets&lt;/del&gt;/&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Plugins&lt;/del&gt;/CMakeLists.txt&amp;lt;/i&amp;gt; by adding your widget plugin files.  &lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Update &amp;lt;i&amp;gt;Libs/&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;MRML&lt;/ins&gt;/&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Widgets/DesignerPlugins&lt;/ins&gt;/CMakeLists.txt&amp;lt;/i&amp;gt; by adding your widget plugin files.  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** add the files &amp;lt;i&amp;gt;qMRMLCustomWidgetPlugin.h&amp;lt;/i&amp;gt; and &amp;lt;i&amp;gt;qMRMLCustomWidgetPlugin.cxx&amp;lt;/i&amp;gt; in the variable &amp;lt;code&amp;gt;qMRMLWidgetsPlugin_SRCS&amp;lt;/code&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** add the files &amp;lt;i&amp;gt;qMRMLCustomWidgetPlugin.h&amp;lt;/i&amp;gt; and &amp;lt;i&amp;gt;qMRMLCustomWidgetPlugin.cxx&amp;lt;/i&amp;gt; in the variable &amp;lt;code&amp;gt;qMRMLWidgetsPlugin_SRCS&amp;lt;/code&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** add the file &amp;lt;i&amp;gt;qMRMLCustomWidgetPlugin.h&amp;lt;/i&amp;gt; in the variable &amp;lt;code&amp;gt;qMRMLWidgetsPlugin_MOC_SRCS&amp;lt;/code&amp;gt;  &lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** add the file &amp;lt;i&amp;gt;qMRMLCustomWidgetPlugin.h&amp;lt;/i&amp;gt; in the variable &amp;lt;code&amp;gt;qMRMLWidgetsPlugin_MOC_SRCS&amp;lt;/code&amp;gt;  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Finally add your widget in the method &amp;lt;code&amp;gt;qMRMLWidgetsPlugins::customWidgets()&amp;lt;/code&amp;gt; of the file &amp;lt;i&amp;gt;Libs/&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;qMRMLWidgets&lt;/del&gt;/&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Plugins&lt;/del&gt;/qMRMLWidgetsPlugins.h&amp;lt;/i&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Finally add your widget in the method &amp;lt;code&amp;gt;qMRMLWidgetsPlugins::customWidgets()&amp;lt;/code&amp;gt; of the file &amp;lt;i&amp;gt;Libs/&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;MRML&lt;/ins&gt;/&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Widgets/DesignerPlugins&lt;/ins&gt;/qMRMLWidgetsPlugins.h&amp;lt;/i&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*compile&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*compile&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Congratulations, you just added a custom widget in a plugin that can be read by QDesigner. Read the [[Slicer3:Developers:Projects:QtSlicer:Tutorials:QtDesigner|next tutorial]] to learn how you can use the widget into Qt Designer.&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Congratulations, you just added a custom widget in a plugin that can be read by QDesigner. Read the [[Slicer3:Developers:Projects:QtSlicer:Tutorials:QtDesigner|next tutorial]] to learn how you can use the widget into Qt Designer.&amp;lt;br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''Coding style:'''&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''Coding style:'''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;For a better code readability, make sure you respect the alphabetical order of the files in &amp;lt;i&amp;gt;CMakeLists.txt&amp;lt;/i&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;For a better code readability, make sure you respect the alphabetical order of the files in &amp;lt;i&amp;gt;CMakeLists.txt&amp;lt;/i&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Dmwelch</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/4.1/Developers/Tutorials/WidgetWriting&amp;diff=26561&amp;oldid=prev</id>
		<title>JChris.FillionR at 01:45, 5 June 2012</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/4.1/Developers/Tutorials/WidgetWriting&amp;diff=26561&amp;oldid=prev"/>
		<updated>2012-06-05T01:45:37Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 01:45, 5 June 2012&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot; &gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Back to [[Documentation/{{documentation/version}}/Developers|Developers Information]]&amp;amp;larr;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=Creating a custom widget in Slicer=&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=Creating a custom widget in Slicer=&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Intro==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==Intro==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>JChris.FillionR</name></author>
		
	</entry>
	<entry>
		<id>https://www.slicer.org/w/index.php?title=Documentation/4.1/Developers/Tutorials/WidgetWriting&amp;diff=25469&amp;oldid=prev</id>
		<title>JChris.FillionR: 4.0 -&gt; 4.1</title>
		<link rel="alternate" type="text/html" href="https://www.slicer.org/w/index.php?title=Documentation/4.1/Developers/Tutorials/WidgetWriting&amp;diff=25469&amp;oldid=prev"/>
		<updated>2012-04-12T04:41:43Z</updated>

		<summary type="html">&lt;p&gt;4.0 -&amp;gt; 4.1&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Back to [[Documentation/{{documentation/version}}/Developers|Developers Information]]&amp;amp;larr;&lt;br /&gt;
&lt;br /&gt;
=Creating a custom widget in Slicer=&lt;br /&gt;
==Intro==&lt;br /&gt;
A custom widget is a specialization of another widget or a group of widgets working together. Custom widgets are usually created when you need to add new functionality to existing widgets or groups of widgets. If you simply want a collection of widgets in a special configuration it can be easily done in QtDesigner and probably doesn't require to be a custom widget. &lt;br /&gt;
&lt;br /&gt;
In the following we will assume you are familiar with Qt.&amp;lt;br&amp;gt;&lt;br /&gt;
Here are some useful links:&lt;br /&gt;
*http://doc.trolltech.com/how-to-learn-qt.html&lt;br /&gt;
*http://doc.trolltech.com/object.html&lt;br /&gt;
*http://doc.trolltech.com/properties.html&lt;br /&gt;
&lt;br /&gt;
==Before starting==&lt;br /&gt;
There are 2 locations where custom widgets can be. You first have to decide where your custom widget should go:&lt;br /&gt;
*&amp;lt;i&amp;gt;CTK&amp;lt;/i&amp;gt;: Qt and/or VTK only&lt;br /&gt;
*&amp;lt;i&amp;gt;Slicer3/Libs/qMRMLWidgets&amp;lt;/i&amp;gt;: MRML-aware widgets&lt;br /&gt;
A good practice is to split (as possible) your custom widget in 2: a QT-only widget and a MRML-aware widget where the MRML-aware widgets inherits from the Qt-only widget. An intermediate level can be added for Qt and VTK widgets.&amp;lt;br&amp;gt;&lt;br /&gt;
It is important to keep the widgets basic. If you think someone else can use your custom widget differently, or if someone would need less features than the custom widget currently have, it is probably a good idea to split the widget in 2 widgets linked with an IS-A relationship.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Coding style==&lt;br /&gt;
The name of the custom widgets must follow the pattern: &amp;lt;code&amp;gt;qMRML[customName][baseQtWidget]&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;[baseQtWidget]&amp;lt;/code&amp;gt; is the name of the qt widget your custom widget inherits from (i.e. &amp;lt;code&amp;gt;ComboBox&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Slider&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Dialog&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Widget&amp;lt;/code&amp;gt;...), and &amp;lt;code&amp;gt;[customName]&amp;lt;/code&amp;gt; is a descriptive name. Examples:&lt;br /&gt;
*&amp;lt;code&amp;gt;qMRMLLinearTransformSlider&amp;lt;/code&amp;gt;&lt;br /&gt;
*&amp;lt;code&amp;gt;&amp;lt;s&amp;gt;qMRMLMatrix&amp;lt;/s&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;code&amp;gt;qMRMLMatrixWidget&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Note==&lt;br /&gt;
*When you create your widget, make sure you use the [http://doc.trolltech.com/4.5/properties.html Qt property system], it allow the customization of the widgets in [http://doc.trolltech.com/4.6/designer-manual.html Qt Designer].&lt;br /&gt;
&lt;br /&gt;
==Step by step==&lt;br /&gt;
*Create your widget files (.h and .cxx) in the &amp;lt;i&amp;gt;Lib/qMRMLWidgets&amp;lt;/i&amp;gt; directory.&lt;br /&gt;
**If you use a &amp;lt;i&amp;gt;.ui&amp;lt;/i&amp;gt; file, add it in the &amp;lt;i&amp;gt;Libs/qMRMLWidgets/Resources/UI&amp;lt;/i&amp;gt; directory&lt;br /&gt;
**If you use icon files, add them in the &amp;lt;i&amp;gt;Libs/qMRMLWidgets/Resources/Icons&amp;lt;/i&amp;gt; directory and update the &amp;lt;i&amp;gt;Libs/qMRMLWidgets/Resources/qMRMLWidgets.qrc&amp;lt;/i&amp;gt; file accordingly&lt;br /&gt;
*Update the &amp;lt;i&amp;gt;Libs/qMRMLWidgets/CMakeLists.txt&amp;lt;/i&amp;gt; file with your widget files.&lt;br /&gt;
** add the &amp;lt;i&amp;gt;.h&amp;lt;/i&amp;gt; and &amp;lt;i&amp;gt;.cxx&amp;lt;/i&amp;gt; files in the &amp;lt;code&amp;gt;qMRMLWidgets_SRCS&amp;lt;/code&amp;gt; variable&lt;br /&gt;
** add the &amp;lt;i&amp;gt;.h&amp;lt;/i&amp;gt; file in the &amp;lt;code&amp;gt;qMRMLWidgets_MOC_SRCS&amp;lt;/code&amp;gt; variable&lt;br /&gt;
** if any, add the &amp;lt;i&amp;gt;.ui&amp;lt;/i&amp;gt; file in the &amp;lt;code&amp;gt;qMRMLWidgets_UI_SRCS&amp;lt;/code&amp;gt; variable&lt;br /&gt;
* compile with your favorite compiler.&lt;br /&gt;
Congratulations, you just added a custom widget in Slicer. The widget can now be used anywhere in Slicer.&amp;lt;br&amp;gt;&lt;br /&gt;
However the widget doesn't show up in QDesigner, let's create the associated widget plugin for QDesigner.&lt;br /&gt;
&lt;br /&gt;
=Create a widget for the designer=&lt;br /&gt;
For a general presentation to create custom widgets for Qt Designer, see http://doc.trolltech.com/designer-creating-custom-widgets.html&lt;br /&gt;
==Step by step==&lt;br /&gt;
*Copy paste this template in the &amp;lt;i&amp;gt;Libs/qMRMLWidgets/Plugins&amp;lt;/i&amp;gt; directory.&lt;br /&gt;
{|&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
#ifndef __qMRMLCustomWidgetPlugin_h&lt;br /&gt;
#define __qMRMLCustomWidgetPlugin_h&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;qMRMLWidgetsAbstractPlugin.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
class QMRML_WIDGETS_PLUGIN_EXPORT qMRMLCustomWidgetPlugin : public QObject,&lt;br /&gt;
                                public qMRMLWidgetsAbstractPlugin&lt;br /&gt;
{&lt;br /&gt;
  Q_OBJECT&lt;br /&gt;
&lt;br /&gt;
public:&lt;br /&gt;
  qMRMLCustomWidgetPlugin(QObject *_parent = 0);&lt;br /&gt;
  &lt;br /&gt;
  QWidget *createWidget(QWidget *_parent);&lt;br /&gt;
  QString domXml() const;&lt;br /&gt;
  QString includeFile() const;&lt;br /&gt;
  bool isContainer() const;&lt;br /&gt;
  QString name() const;&lt;br /&gt;
  &lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Rename the file &amp;lt;i&amp;gt;qMRML[name of your widget]Plugin.h&amp;lt;/i&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
*Replace &amp;lt;i&amp;gt;CustomWidget&amp;lt;/i&amp;gt; with the name of your widget&lt;br /&gt;
*Copy-paste the following template in the &amp;lt;i&amp;gt;Libs/qMRMLWidgets/Plugins&amp;lt;/i&amp;gt; directory.&lt;br /&gt;
{|&lt;br /&gt;
|&amp;lt;pre&amp;gt;#include &amp;quot;qMRMLCustomWidgetPlugin.h&amp;quot;&lt;br /&gt;
#include &amp;quot;qMRMLCustomWidget.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
//------------------------------------------------------------------------------&lt;br /&gt;
qMRMLCustomWidgetPlugin::qMRMLCustomWidgetPlugin(QObject *_parent)&lt;br /&gt;
        : QObject(_parent)&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
//------------------------------------------------------------------------------&lt;br /&gt;
QWidget *qMRMLCustomWidgetPlugin::createWidget(QWidget *_parent)&lt;br /&gt;
{&lt;br /&gt;
  qMRMLCustomWidget* _widget = new qMRMLCustomWidget(_parent);&lt;br /&gt;
  return _widget;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
//------------------------------------------------------------------------------&lt;br /&gt;
QString qMRMLCustomWidgetPlugin::domXml() const&lt;br /&gt;
{&lt;br /&gt;
  return &amp;quot;&amp;lt;widget class=\&amp;quot;qMRMLCustomWidget\&amp;quot; \&lt;br /&gt;
          name=\&amp;quot;MRMLCustomWidget\&amp;quot;&amp;gt;\n&amp;quot;&lt;br /&gt;
          &amp;quot;&amp;lt;/widget&amp;gt;\n&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
//------------------------------------------------------------------------------&lt;br /&gt;
QString qMRMLCustomWidgetPlugin::includeFile() const&lt;br /&gt;
{&lt;br /&gt;
  return &amp;quot;qMRMLCustomWidget.h&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
//------------------------------------------------------------------------------&lt;br /&gt;
bool qMRMLCustomWidgetPlugin::isContainer() const&lt;br /&gt;
{&lt;br /&gt;
  return false;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
//------------------------------------------------------------------------------&lt;br /&gt;
QString qMRMLCustomWidgetPlugin::name() const&lt;br /&gt;
{&lt;br /&gt;
  return &amp;quot;qMRMLCustomWidget&amp;quot;;&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rename the file qMRML[name of your widget]Plugin.cxx&lt;br /&gt;
|}&lt;br /&gt;
*Replace &amp;lt;i&amp;gt;CustomWidget&amp;lt;/i&amp;gt; by the name of your widget &lt;br /&gt;
*If the widget is a container, return &amp;lt;code&amp;gt;true&amp;lt;/code in the method &amp;lt;code&amp;gt;isContainer()&amp;lt;/code&amp;gt;.&lt;br /&gt;
*You can customize how the widget is instantiated in the designer by reimplementing the method &amp;lt;code&amp;gt;domxml()&amp;lt;/code&amp;gt;.&lt;br /&gt;
*Update &amp;lt;i&amp;gt;Libs/qMRMLWidgets/Plugins/CMakeLists.txt&amp;lt;/i&amp;gt; by adding your widget plugin files. &lt;br /&gt;
** add the files &amp;lt;i&amp;gt;qMRMLCustomWidgetPlugin.h&amp;lt;/i&amp;gt; and &amp;lt;i&amp;gt;qMRMLCustomWidgetPlugin.cxx&amp;lt;/i&amp;gt; in the variable &amp;lt;code&amp;gt;qMRMLWidgetsPlugin_SRCS&amp;lt;/code&amp;gt;&lt;br /&gt;
** add the file &amp;lt;i&amp;gt;qMRMLCustomWidgetPlugin.h&amp;lt;/i&amp;gt; in the variable &amp;lt;code&amp;gt;qMRMLWidgetsPlugin_MOC_SRCS&amp;lt;/code&amp;gt; &lt;br /&gt;
*Finally add your widget in the method &amp;lt;code&amp;gt;qMRMLWidgetsPlugins::customWidgets()&amp;lt;/code&amp;gt; of the file &amp;lt;i&amp;gt;Libs/qMRMLWidgets/Plugins/qMRMLWidgetsPlugins.h&amp;lt;/i&amp;gt;&lt;br /&gt;
*compile&lt;br /&gt;
Congratulations, you just added a custom widget in a plugin that can be read by QDesigner. Read the [[Slicer3:Developers:Projects:QtSlicer:Tutorials:QtDesigner|next tutorial]] to learn how you can use the widget into Qt Designer.&amp;lt;br&amp;gt;&lt;br /&gt;
'''Coding style:'''&lt;br /&gt;
For a better code readability, make sure you respect the alphabetical order of the files in &amp;lt;i&amp;gt;CMakeLists.txt&amp;lt;/i&amp;gt;.&lt;/div&gt;</summary>
		<author><name>JChris.FillionR</name></author>
		
	</entry>
</feed>