<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.labrps.com/index.php?action=history&amp;feed=atom&amp;title=Interface_creation</id>
	<title>Interface creation - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.labrps.com/index.php?action=history&amp;feed=atom&amp;title=Interface_creation"/>
	<link rel="alternate" type="text/html" href="https://wiki.labrps.com/index.php?title=Interface_creation&amp;action=history"/>
	<updated>2026-04-29T14:26:43Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.38.2</generator>
	<entry>
		<id>https://wiki.labrps.com/index.php?title=Interface_creation&amp;diff=2168&amp;oldid=prev</id>
		<title>LabRPS: Created page with &quot;{{Docnav |PySide |Dialog creation }}  {{TOCright}}  == Introduction ==   Power users have the possibility of creating interfaces to help them produce complex tools for their custom addons, such as macros or full workbenches.  Interfaces are created using PySide, which is a library for using Qt with Python.  600px {{Capti...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.labrps.com/index.php?title=Interface_creation&amp;diff=2168&amp;oldid=prev"/>
		<updated>2024-10-30T01:16:58Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{Docnav |&lt;a href=&quot;/PySide&quot; title=&quot;PySide&quot;&gt;PySide&lt;/a&gt; |&lt;a href=&quot;/Dialog_creation&quot; title=&quot;Dialog creation&quot;&gt;Dialog creation&lt;/a&gt; }}  {{TOCright}}  == Introduction ==   Power users have the possibility of &lt;a href=&quot;/Interface_creation&quot; title=&quot;Interface creation&quot;&gt;creating interfaces&lt;/a&gt; to help them produce complex tools for their custom &lt;a href=&quot;/Addon&quot; title=&quot;Addon&quot;&gt;addons&lt;/a&gt;, such as &lt;a href=&quot;/Macros&quot; title=&quot;Macros&quot;&gt;macros&lt;/a&gt; or full &lt;a href=&quot;/Workbenches&quot; title=&quot;Workbenches&quot;&gt;workbenches&lt;/a&gt;.  Interfaces are created using &lt;a href=&quot;/PySide&quot; title=&quot;PySide&quot;&gt;PySide&lt;/a&gt;, which is a library for using Qt with &lt;a href=&quot;/Python&quot; title=&quot;Python&quot;&gt;Python&lt;/a&gt;.  &lt;a href=&quot;/File:LabRPS_creating_interfaces.svg&quot; title=&quot;File:LabRPS creating interfaces.svg&quot;&gt;600px&lt;/a&gt; {{Capti...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Docnav&lt;br /&gt;
|[[PySide|PySide]]&lt;br /&gt;
|[[Dialog_creation|Dialog creation]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{TOCright}}&lt;br /&gt;
&lt;br /&gt;
== Introduction == &lt;br /&gt;
&lt;br /&gt;
Power users have the possibility of [[Interface_creation|creating interfaces]] to help them produce complex tools for their custom [[Addon|addons]], such as [[Macros|macros]] or full [[Workbenches|workbenches]].&lt;br /&gt;
&lt;br /&gt;
Interfaces are created using [[PySide|PySide]], which is a library for using Qt with [[Python|Python]].&lt;br /&gt;
&lt;br /&gt;
[[File:LabRPS_creating_interfaces.svg|600px]]&lt;br /&gt;
{{Caption|Two general methods to create interfaces, by including the interface in the Python file, or by using {{incode|.ui}} files.}}&lt;br /&gt;
&lt;br /&gt;
== Description == &lt;br /&gt;
&lt;br /&gt;
There are typically two ways of creating interfaces with PySide.&lt;br /&gt;
&lt;br /&gt;
=== Interface in a .ui file === &lt;br /&gt;
&lt;br /&gt;
In this method the interface is defined in a {{incode|.ui}} file (an XML document that defines the structure of the interface), which is then imported into [[Python|Python]] code that uses it. This is the recommended approach.&lt;br /&gt;
* It allows the programmer to work with the graphical interface separately from the logic that will use it.&lt;br /&gt;
* It allows anybody to look at the interface alone, that is, the {{incode|.ui}} file, without having to run Python code.&lt;br /&gt;
* The {{incode|.ui}} file may be designed by anybody without programming knowledge.&lt;br /&gt;
* The {{incode|.ui}} interface can be used in a standalone window (modal), or in an embedded window (non-modal); therefore, this method is ideal to create custom [[Task_panel|task panels]].&lt;br /&gt;
* Since the {{incode|.ui}} file just describes the &amp;quot;appearance&amp;quot; of the interface, it does not need to be tied to a particular programming language; it may be used both in [[Python|Python]] and C++ code.&lt;br /&gt;
&lt;br /&gt;
=== Interface completely in Python code === &lt;br /&gt;
&lt;br /&gt;
In this method the entire interface is defined by several Python calls.&lt;br /&gt;
* This is an older way of working with interfaces.&lt;br /&gt;
* This method produces very verbose code because many details of the interface need to be specified by hand.&lt;br /&gt;
* It is not simple to separate the interface from the logic that uses that code, meaning that a user would need to run the [[Python|Python]] file in the correct context in order to see how the interface would look.&lt;br /&gt;
* This method has the advantage that several interfaces may be contained within a single document, at the expense of making the file very large.&lt;br /&gt;
* This method is recommended only for small interfaces that don&amp;#039;t define more than a few widgets, for example in [[Macros|macros]].&lt;br /&gt;
&lt;br /&gt;
For examples on this method see [[Dialog_creation|Interface creation completely in Python]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Docnav&lt;br /&gt;
|[[PySide|PySide]]&lt;br /&gt;
|[[Dialog_creation|Dialog creation]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Powerdocnavi}}&lt;br /&gt;
[[Category:Developer Documentation]]&lt;br /&gt;
[[Category:Python Code]]&lt;/div&gt;</summary>
		<author><name>LabRPS</name></author>
	</entry>
</feed>