<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Issue with using &#x27;promote to&#x27; in QtDesigner with PyQt5]]></title><description><![CDATA[<p dir="auto">I've created a object called ImageViewer that inherits from QStackedImage. I wanted to use the 'promote to' function in QtDesigner to change my current QStackedImage to a ImageViewer object. I was a little confused about it asking for a header file in python for a while but eventually I figured it out. It imported correctly and even created a .pyc file which means it imported and compiled it correctly. The problem arises in my code when I try to set up the UI.  A snippet is shown below.</p>
<p dir="auto">qtCreatorFile = "EITDaq2.ui"<br />
Ui_MainWindow, QtBaseClass = uic.loadUiType(qtCreatorFile)</p>
<p dir="auto">class DAQView(QtWidgets.QMainWindow, Ui_MainWindow):</p>
<pre><code>def __init__(self, model):
    # qt required window init stuff (from double inheritance)
    QtWidgets.QMainWindow.__init__(self)
    Ui_MainWindow.__init__(self)
    self.setupUi(self)
</code></pre>
<p dir="auto">On the command 'self.setupUi(self)' I get the error:</p>
<pre><code>self.setupUi(self)
File "&lt;string&gt;", line 257, in setupUi
TypeError: __init__() takes exactly 1 argument (2 given)
</code></pre>
<p dir="auto">It seems like I'm passing it 1 parameter but maybe when I promote the new ImageViewer object into the ui file it makes it into  a sister widget to the main window instead of a child widget so it's like passing in two parameters to the ui builder. I've checked all over the forum and haven't found anything. Much appreciation for any insight.</p>
]]></description><link>https://forum.qt.io/topic/92739/issue-with-using-promote-to-in-qtdesigner-with-pyqt5</link><generator>RSS for Node</generator><lastBuildDate>Thu, 16 Jul 2026 17:12:36 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/92739.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 17 Jul 2018 16:40:27 GMT</pubDate><ttl>60</ttl></channel></rss>