<?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[pyside2-uic (5.14) problem with custom classes]]></title><description><![CDATA[<p dir="auto">Hello Everyone,</p>
<p dir="auto">Yesterday I updated pyside2 from 5.11 to 5.14 using pip.</p>
<p dir="auto">When I tried to generate *.py files from the *.ui files I stumbled into a problem. It seems that the latest version is not handling properly the custom classes.</p>
<p dir="auto">For instance if I have a simple ui file (the file that contains the custom class is named 'power_table.py'):</p>
<pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;ui version="4.0"&gt;
 &lt;class&gt;TableViewer&lt;/class&gt;
 &lt;widget class="QDialog" name="TableViewer"&gt;
  &lt;property name="geometry"&gt;
   &lt;rect&gt;
    &lt;x&gt;0&lt;/x&gt;
    &lt;y&gt;0&lt;/y&gt;
    &lt;width&gt;964&lt;/width&gt;
    &lt;height&gt;300&lt;/height&gt;
   &lt;/rect&gt;
  &lt;/property&gt;
  &lt;property name="windowTitle"&gt;
   &lt;string&gt;Table Viewer&lt;/string&gt;
  &lt;/property&gt;
  &lt;layout class="QGridLayout" name="gridLayout"&gt;
   &lt;item row="0" column="1"&gt;
    &lt;widget class="QDialogButtonBox" name="buttonBox"&gt;
     &lt;property name="orientation"&gt;
      &lt;enum&gt;Qt::Vertical&lt;/enum&gt;
     &lt;/property&gt;
     &lt;property name="standardButtons"&gt;
      &lt;set&gt;QDialogButtonBox::Cancel|QDialogButtonBox::Ok&lt;/set&gt;
     &lt;/property&gt;
    &lt;/widget&gt;
   &lt;/item&gt;
   &lt;item row="0" column="0"&gt;
    &lt;widget class="PowerTableView" name="view_widget" native="true"/&gt;
   &lt;/item&gt;
  &lt;/layout&gt;
 &lt;/widget&gt;
 &lt;customwidgets&gt;
  &lt;customwidget&gt;
   &lt;class&gt;PowerTableView&lt;/class&gt;
   &lt;extends&gt;QWidget&lt;/extends&gt;
   &lt;header&gt;power_table&lt;/header&gt;
  &lt;/customwidget&gt;
 &lt;/customwidgets&gt;
 &lt;resources/&gt;
 &lt;connections&gt;
  &lt;connection&gt;
   &lt;sender&gt;buttonBox&lt;/sender&gt;
   &lt;signal&gt;accepted()&lt;/signal&gt;
   &lt;receiver&gt;TableViewer&lt;/receiver&gt;
   &lt;slot&gt;accept()&lt;/slot&gt;
   &lt;hints&gt;
    &lt;hint type="sourcelabel"&gt;
     &lt;x&gt;248&lt;/x&gt;
     &lt;y&gt;254&lt;/y&gt;
    &lt;/hint&gt;
    &lt;hint type="destinationlabel"&gt;
     &lt;x&gt;157&lt;/x&gt;
     &lt;y&gt;274&lt;/y&gt;
    &lt;/hint&gt;
   &lt;/hints&gt;
  &lt;/connection&gt;
  &lt;connection&gt;
   &lt;sender&gt;buttonBox&lt;/sender&gt;
   &lt;signal&gt;rejected()&lt;/signal&gt;
   &lt;receiver&gt;TableViewer&lt;/receiver&gt;
   &lt;slot&gt;reject()&lt;/slot&gt;
   &lt;hints&gt;
    &lt;hint type="sourcelabel"&gt;
     &lt;x&gt;316&lt;/x&gt;
     &lt;y&gt;260&lt;/y&gt;
    &lt;/hint&gt;
    &lt;hint type="destinationlabel"&gt;
     &lt;x&gt;286&lt;/x&gt;
     &lt;y&gt;274&lt;/y&gt;
    &lt;/hint&gt;
   &lt;/hints&gt;
  &lt;/connection&gt;
 &lt;/connections&gt;
&lt;/ui&gt;

</code></pre>
<p dir="auto">and use pyside2-uic (v5.14) for generating the repective .py file I get:</p>
<pre><code>from PySide2.QtCore import (QCoreApplication, QMetaObject, QObject, QPoint,
    QRect, QSize, QUrl, Qt)
from PySide2.QtGui import (QBrush, QColor, QConicalGradient, QFont,
    QFontDatabase, QIcon, QLinearGradient, QPalette, QPainter, QPixmap,
    QRadialGradient)
from PySide2.QtWidgets import *

import PowerTableView

class Ui_TableViewer(object):
    def setupUi(self, TableViewer):
        if TableViewer.objectName():
            TableViewer.setObjectName(u"TableViewer")
        TableViewer.resize(964, 300)
        self.gridLayout = QGridLayout(TableViewer)
        self.gridLayout.setObjectName(u"gridLayout")
        self.buttonBox = QDialogButtonBox(TableViewer)
        self.buttonBox.setObjectName(u"buttonBox")
        self.buttonBox.setOrientation(Qt.Vertical)
        self.buttonBox.setStandardButtons(QDialogButtonBox.Cancel|QDialogButtonBox.Ok)

        self.gridLayout.addWidget(self.buttonBox, 0, 1, 1, 1)

        self.view_widget = PowerTableView(TableViewer)
        self.view_widget.setObjectName(u"view_widget")

        self.gridLayout.addWidget(self.view_widget, 0, 0, 1, 1)


        self.retranslateUi(TableViewer)
        self.buttonBox.accepted.connect(TableViewer.accept)
        self.buttonBox.rejected.connect(TableViewer.reject)

        QMetaObject.connectSlotsByName(TableViewer)
    # setupUi

    def retranslateUi(self, TableViewer):
        TableViewer.setWindowTitle(QCoreApplication.translate("TableViewer", u"Table Viewer", None))
    # retranslateUi
</code></pre>
<p dir="auto">but when I use 5.11 version I get:</p>
<pre><code>from PySide2 import QtCore, QtGui, QtWidgets

class Ui_TableViewer(object):
    def setupUi(self, TableViewer):
        TableViewer.setObjectName("TableViewer")
        TableViewer.resize(964, 300)
        self.gridLayout = QtWidgets.QGridLayout(TableViewer)
        self.gridLayout.setObjectName("gridLayout")
        self.buttonBox = QtWidgets.QDialogButtonBox(TableViewer)
        self.buttonBox.setOrientation(QtCore.Qt.Vertical)
        self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
        self.buttonBox.setObjectName("buttonBox")
        self.gridLayout.addWidget(self.buttonBox, 0, 1, 1, 1)
        self.view_widget = PowerTableView(TableViewer)
        self.view_widget.setObjectName("view_widget")
        self.gridLayout.addWidget(self.view_widget, 0, 0, 1, 1)

        self.retranslateUi(TableViewer)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), TableViewer.accept)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), TableViewer.reject)
        QtCore.QMetaObject.connectSlotsByName(TableViewer)

    def retranslateUi(self, TableViewer):
        TableViewer.setWindowTitle(QtWidgets.QApplication.translate("TableViewer", "Table Viewer", None, -1))

from power_table import PowerTableView
</code></pre>
<p dir="auto">Any ideas?</p>
]]></description><link>https://forum.qt.io/topic/110226/pyside2-uic-5-14-problem-with-custom-classes</link><generator>RSS for Node</generator><lastBuildDate>Sat, 07 Mar 2026 00:28:47 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/110226.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 31 Dec 2019 14:37:53 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to pyside2-uic (5.14) problem with custom classes on Thu, 02 Jan 2020 16:31:23 GMT]]></title><description><![CDATA[<p dir="auto">You may have found a bug :-)<br />
Please check the <a href="https://bugreports.qt.io" target="_blank" rel="noopener noreferrer nofollow ugc">bug report system</a> to see if it's something known and if not please open a new report with your findings.</p>
]]></description><link>https://forum.qt.io/post/570113</link><guid isPermaLink="true">https://forum.qt.io/post/570113</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Thu, 02 Jan 2020 16:31:23 GMT</pubDate></item><item><title><![CDATA[Reply to pyside2-uic (5.14) problem with custom classes on Thu, 02 Jan 2020 13:08:41 GMT]]></title><description><![CDATA[<p dir="auto">Ok SGaist,</p>
<p dir="auto">I can confirm that everything works fine until version 5.13.2, that is, the one previous to 5.14 (on pip at least)</p>
]]></description><link>https://forum.qt.io/post/570068</link><guid isPermaLink="true">https://forum.qt.io/post/570068</guid><dc:creator><![CDATA[dhabbyc]]></dc:creator><pubDate>Thu, 02 Jan 2020 13:08:41 GMT</pubDate></item><item><title><![CDATA[Reply to pyside2-uic (5.14) problem with custom classes on Thu, 02 Jan 2020 12:52:48 GMT]]></title><description><![CDATA[<p dir="auto">Hello SGaist!</p>
<p dir="auto">I will check with whatever is available on pip from version 5.11.</p>
<p dir="auto">Thanks!</p>
]]></description><link>https://forum.qt.io/post/570066</link><guid isPermaLink="true">https://forum.qt.io/post/570066</guid><dc:creator><![CDATA[dhabbyc]]></dc:creator><pubDate>Thu, 02 Jan 2020 12:52:48 GMT</pubDate></item><item><title><![CDATA[Reply to pyside2-uic (5.14) problem with custom classes on Tue, 31 Dec 2019 22:04:27 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">Indeed, it looks like something is wrong. Can you check with previous versions of PySide2 to see where exactly it changed ?</p>
]]></description><link>https://forum.qt.io/post/569877</link><guid isPermaLink="true">https://forum.qt.io/post/569877</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Tue, 31 Dec 2019 22:04:27 GMT</pubDate></item></channel></rss>