I removed completly my python 3.10 installation (in C:\Python310\),
restarted the system,
deleted completly the C:\Python310 directory,
downloaded a fresh python-3.10.4-amd64.exe from python.org,
installed as administrator (my user is administrator anyway),
added from pip the pyside6-essentials wheel:
C:\Python310>pip list
Package Version
---------- -------
pip 22.0.4
setuptools 58.1.0
C:\Python310>pip install pyside6-essentials
Collecting pyside6-essentials
Downloading PySide6_Essentials-6.3.0-cp36-abi3-win_amd64.whl (70.7 MB)
---------------------------------------- 70.7/70.7 MB 3.0 MB/s eta
0:00:00
Collecting shiboken6==6.3.0
Downloading shiboken6-6.3.0-cp36-abi3-win_amd64.whl (1.6 MB)
---------------------------------------- 1.6/1.6 MB 3.2 MB/s eta
0:00:00
Installing collected packages: shiboken6, pyside6-essentials
Successfully installed pyside6-essentials-6.3.0 shiboken6-6.3.0
BUT running my script from VSCode i get exactly the same error:
Exception has occurred: AttributeError
'PySide6.QtWidgets.QGridLayout' object has no attribute
'setContentsMargins'
File "C:\PyWare\pyDBManager\Bug\DBManagerMainWindowBad.py", line 132,
in setupUi
self.gridLayout.setContentsMargins(0, 0, 0, 0)
File "C:\PyWare\pyDBManager\Bug\pyDBManager.py", line 56, in __init__
self.ui.setupUi(self)
File "C:\PyWare\pyDBManager\Bug\pyDBManager.py", line 161, in <module>
window = MainWindow()
I tried even with python 3.8.9 with pyside6 6.2.4 (i have 3 python
version installed in C:\Python34, C:\Python38 and C:\Python310)
i get the same error...
But the B version works SO i give up using snake_cas and true_property
Thanks anyway
Il 25/04/2022 18:34 David Ching ha scritto:
From: Paolo De Stefani <pa...@paolodestefani.it>
Sent: Sunday, April 24, 2022 8:25 AM
...
AttributeError: 'PySide6.QtWidgets.QHBoxLayout' object has no
attribute
'isEmpty'
...
AttributeError: 'PySide6.QtWidgets.QHBoxLayout' object has no
attribute
'setContentsMargins'. Did you mean: 'getContentsMargins'?
...
AttributeError: 'PySide6.QtWidgets.QSpacerItem' object has no
attribute
'hasHeightForWidth'. Did you mean: 'heightForWidth'?
...
AttributeError: 'PySide6.QtWidgets.QGridLayout' object has no
attribute
'setContentsMargins'. Did you mean: 'getContentsMargins'?
So it looks like i can't use a H/V/Grid layout and spacer too ...
What's wrong ???
Paolo, I would re-install Pyside. Or even your entire Python
distribution.
Something seems wrong with your installation because your "bad" file
works
perfectly fine on my system. In particular, all these missing
attributes in
the layout and spacer classes seem to indicate a mismatch of some
binaries
in your installation.
It does seem the .ui files were processed by the correct uic utility,
given
the comments in the generated .py files from that. But the runtime Qt
DLL's
just aren't supporting the required attributes somehow.
Hope this helps,
David
--
Paolo De Stefani
_______________________________________________
PySide mailing list
PySide@qt-project.org
https://lists.qt-project.org/listinfo/pyside