I also noted that the error message is different if a modify the
generated pyDBManagerMainWIndowBad.py
the original error is:
C:\PyWare\pyDBManager\Bug>python pyDBManager.py
Traceback (most recent call last):
File "C:\PyWare\pyDBManager\Bug\pyDBManager.py", line 161, in <module>
window = MainWindow()
File "C:\PyWare\pyDBManager\Bug\pyDBManager.py", line 56, in __init__
self.ui.setupUi(self)
File "C:\PyWare\pyDBManager\Bug\DBManagerMainWindowBad.py", line 133,
in setupUi
self.gridLayout.setContentsMargins(0, 0, 0, 0)
AttributeError: 'PySide6.QtWidgets.QGridLayout' object has no attribute
'setContentsMargins'. Did you mean: 'getContentsMargins'?
If i add even an import line like import os and run again the script the
error message is:
C:\PyWare\pyDBManager\Bug>python pyDBManager.py
Traceback (most recent call last):
File "C:\PyWare\pyDBManager\Bug\pyDBManager.py", line 161, in <module>
window = MainWindow()
File "C:\PyWare\pyDBManager\Bug\pyDBManager.py", line 56, in __init__
self.ui.setupUi(self)
File "C:\PyWare\pyDBManager\Bug\DBManagerMainWindowBad.py", line 30,
in setupUi
if not DBManagerMainWindow.objectName():
AttributeError: 'MainWindow' object has no attribute 'objectName'. Did
you mean: 'object_name'?
Why this behaviour ???
But looks like direct linked to the snake_case option
Il 26/04/2022 19:52 Paolo De Stefani ha scritto:
C:\PyWare\pyDBManager\Bug>python
Python 3.10.4 (tags/v3.10.4:9d38120, Mar 23 2022, 23:13:41) [MSC
v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
^Z
C:\PyWare\pyDBManager\Bug>python pyDBManager.py
Traceback (most recent call last):
File "C:\PyWare\pyDBManager\Bug\pyDBManager.py", line 161, in
<module>
window = MainWindow()
File "C:\PyWare\pyDBManager\Bug\pyDBManager.py", line 56, in __init__
self.ui.setupUi(self)
File "C:\PyWare\pyDBManager\Bug\DBManagerMainWindowBad.py", line
132, in setupUi
self.gridLayout.setContentsMargins(0, 0, 0, 0)
AttributeError: 'PySide6.QtWidgets.QGridLayout' object has no
attribute 'setContentsMargins'. Did you mean: 'getContentsMargins'?
Definitley NOT a VSCode problem...
I dowloaded processexplorer and modified the
pyDBManagerMainWindowBad.py adding a time.sleep(30) at the beginning
of the setupUi method
I then executed the command python pyDBManager.py and look at the
process explorer dll list BUT i can't see any problem. I attached the
list of DLL for the python process.
Thanks anyway
Il 26/04/2022 02:19 David Ching ha scritto:
Date: Mon, 25 Apr 2022 20:26:45 +0200
From: Paolo De Stefani <pa...@paolodestefani.it>
Subject: Re: [PySide] QtDesigner ???
Message-ID: <6bb50e91a39bb8ec77e88f85d9d4e...@paolodestefani.it>
Content-Type: text/plain; charset=US-ASCII; format=flowed
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:
Paolo, I don't know, I went onto a different machine with Python 3.10
installed and did a "pip install pyside6-essentials", got the same
thing you
did. But unlike you, "python.exe pyDBManager.py" with these lines
worked
fine:
[pyDBManager.py]
#from Ui.DBManagerMainWindowGood import Ui_DBManagerMainWindow
from Ui.DBManagerMainWindowBad import Ui_DBManagerMainWindow
from __feature__ import snake_case, true_property
Are you sure VS Code is running it from the correct environment? If
you can
comment out enough of the non-working version for it to stay running,
you
could run SysInternals Process Explorer and set it's lower pane to
view the
DLL's running in the "python.exe" process -- then you can make sure
the Qt
DLL's are correct.
Thanks,
David
_______________________________________________
PySide mailing list
PySide@qt-project.org
https://lists.qt-project.org/listinfo/pyside
_______________________________________________
PySide mailing list
PySide@qt-project.org
https://lists.qt-project.org/listinfo/pyside
--
Paolo De Stefani
_______________________________________________
PySide mailing list
PySide@qt-project.org
https://lists.qt-project.org/listinfo/pyside