[PySide] QtDesigner ???

Cristián Maureira-Fredes Cristian.Maureira-Fredes at qt.io
Wed Apr 20 14:09:17 CEST 2022


Hello Paolo,

On 4/20/22 13:55, Paolo De Stefani wrote:
> Hi
> I've just upgraded to 6.3.0 and i'm hitting a weird problem
> In a small program that i created years ago and that i've already ported 
> to pyside6 some months ago with true property and snake case enabled 
> i've decided to change a little bit the user interface
> I did it in QtDisigner BUT now i don't understand why my application 
> don't work
> 
> This is the error:
> 
> Traceback (most recent call last):
>    File "c:\PyWare\pyDBManager\pyDBManager.py", line 1165, in <module>
>      window = MainWindow()
>    File "c:\PyWare\pyDBManager\pyDBManager.py", line 788, in __init__
>      self.setupUi(self)
>    File "c:\PyWare\pyDBManager\Ui\DBManagerMainWindow.py", line 208, in 
> setupUi
>      self.tab_widget_new_db.addTab(self.tab_create_db, "")
> AttributeError: 'PySide6.QtWidgets.QGridLayout' object has no attribute 
> 'isEmpty'
> 
> 
> Is this related to the use of snake_case ?
> DBManagerMainWindow.py is generated from DBManagerMainWindow.ui using 
> c:\Python310\Scripts\pyside6-uic
> QGridLayout HAS an IsEmpty attribute or maybe is_empty ???

Hello!

You can always try this without the whole application:

 >>> from PySide6.QtWidgets import QGridLayout
 >>> dir(QGridLayout)
 >>> [i for i in dir(QGridLayout) if 'empty' in i.lower()]
['isEmpty']
 >>> from __feature__ import snake_case
 >>> [i for i in dir(QGridLayout) if 'empty' in i.lower()]
['is_empty']


is you enable the 'snake_case' from __feature__
the method is called 'is_empty' instead of 'isEmpty'


Let's know if that did the trick!

Cheers


-- 
Dr. Cristian Maureira-Fredes
R&D Manager

The Qt Company GmbH
Erich-Thilo-Str. 10
D-12489 Berlin

Geschäftsführer: Mika Pälsi,
Juha Varelius, Mika Harjuaho
Sitz der Gesellschaft: Berlin,
Registergericht: Amtsgericht
Charlottenburg, HRB 144331 B
--


More information about the PySide mailing list