[PyQt] Bug Report in PyQt5/uic/uiparser.py

Tony Fuller goldstar611 at hotmail.com
Wed Feb 7 02:54:50 GMT 2018


A quick grep for objectName() reveals more affected files.


~/Downloads/PyQt5_gpl-5.10 $ grep -RIni "objectName()" .
./pyuic/uic/properties.py:488:        if widget.objectName() ==
self.uiname:
./pyuic/uic/uiparser.py:109:                              item.objectNa
me()))
./pyuic/uic/uiparser.py:117:                                    layout.
objectName()))
./pyuic/uic/uiparser.py:123:                                    widget.
objectName()))
./pyuic/uic/uiparser.py:839:                DEBUG("add action %s to
%s", action_name, widget.objectName())
./pyuic/uic/uiparser.py:856:            DEBUG("%s is buddy of %s",
buddy, widget.objectName())
./pyuic/uic/uiparser.py:861:                      buddy,
widget.objectName())
./examples/graphicsview/embeddeddialogs/embeddeddialogs.py:170:        
    if self.style().objectName().lower() == styleName.lower():

On Mon, 2018-02-05 at 06:59 -0600, Gold Star wrote:
> I would like to report a bug in the uiparser.py file, part of
> PyQt5.uic.
> 
> I am loading a custom widget from a .ui file using the following
> lines:
> <widget class="MyQGLWidget" name="GLWidget" native="true">
> ...
> </widget>
> 
> and later in the .ui file:
>  <customwidgets>
>   <customwidget>
>    <class>MyQGLWidget</class>
>    <extends>QWidget</extends>
>    <header>qtopengl.h</header>
>   </customwidget>
>  </customwidgets>
> 
> 
> In my qtopengl.py file is the custom class of
> MyGLWidget(QtOpenGL.QGLWidget).
> 
> Now when I run this example, I get an error that "str type is not
> callable" and the backtrace contains uiparser.py as the problem and I
> can see the calls to DEBUG() have "widget.objectName()".
> 
> A quick chmod 777 of the file, and a find and replace all from
> "widget.objectName()" to "widget.objectName" to drop the parenthesis
> lets my QMainWindow load perfectly.
> 
> Is this the best way to report the bug? Thanks


More information about the PyQt mailing list