Details
-
Bug
-
Resolution: Incomplete
-
Not Evaluated
-
None
-
6.3.1
-
None
-
Windows 11 x64
Description
Hi there,
I am getting a strange behaviour with a UI app. I have created a test app with a frame and a push button inside that has an icon attached to it with some style applicated to it. When I compile de ui with pyside6-uic and even after changing location of icons channging u"../xxxxxx.ico" to u*"./xxxx.ico"* and run the app, the icons do not apear on the window. But if I compile the ui with pyside2 it works fine and all icons turn up on the window.
This is my app shown on Qt Designer 5.11
This the result after compiling with pyside6-uic
This the result after compiling with pyside2-uic
Firstly as I mentioned before, I thought it could be a path issue, so I changed the location of the icons directly on the source file, changing two dots to one, u"../xxxxxx.ico" to u"./xxxx.ico" and ran the app again but the icons still didn´t apear on the window.
I changed the source code to use PySide2 libraries and the app worked, the icons came up.
Tests
Logically using a Resource file should have solved my problem but instead, and surprisingly, the situation became exactly the same. I had created two resource files using "pyside6-rcc source.qrc > source6.py" and the second, "pyside2-rcc source.qrc > source2.py".
Steps made:
1.- Each source file had been imported to its compiled file resulting that the PySide2 worked but PySide6 didn´t, as shown with images above.
2.- If I call * from PySide2 the PySide6 ui compiled program "vistas.main_window_v6" changing manually * the libaries to PySide2 and the resource file to source2. The app works fine.
**
3.- Now we do it reverse, * If I call from PySide6 the PySide2 ui compiled program "vistas.main_window_v2" changing manually the libaries to PySide6 and the resource file to source6. I get an error with *setWeight method that I resolve" replacing by "setLegacyWeight"
TypeError: 'PySide6.QtGui.QFont.setWeight' called with wrong argument types:
PySide6.QtGui.QFont.setWeight(int)
Supported signatures:
PySide6.QtGui.QFont.setWeight(PySide6.QtGui.QFont.Weight)
The app still doesn´t work.
4.- I have even tried other options but evertime I use PySide libraries it doesn´t work.
Although it seems to be something simple but I can´t get it fixed.
My Conclusion
PySide6 is not working correctly with icons and images when "ui" is compiled or "I am getting crazy".
Maybe I have gone too extensive, sorry about that.
Regards and thanks.