Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-1992

PySide6 Doesn´t Show Icons once compiled

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • Not Evaluated
    • None
    • 6.3.1
    • PySide
    • None
    • Windows 11 x64
    • Windows

    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.
       
       

      Attachments

        1. image-2022-07-13-13-19-47-953.png
          27 kB
          Aitor Naberan
        2. image-2022-07-13-13-40-12-633.png
          33 kB
          Aitor Naberan
        3. image-2022-07-13-13-40-56-464.png
          56 kB
          Aitor Naberan
        4. image-2022-07-13-13-43-05-524.png
          83 kB
          Aitor Naberan
        5. image-2022-07-13-13-55-10-673.png
          54 kB
          Aitor Naberan
        6. image-2022-07-13-14-02-43-128.png
          33 kB
          Aitor Naberan
        7. image-2022-07-13-14-05-18-623.png
          78 kB
          Aitor Naberan
        8. image-2022-07-13-14-08-27-391.png
          33 kB
          Aitor Naberan
        9. image-2022-07-13-14-09-51-151.png
          54 kB
          Aitor Naberan
        10. image-2022-07-13-14-13-47-091.png
          21 kB
          Aitor Naberan
        11. image-2022-07-14-11-29-00-905.png
          7 kB
          Aitor Naberan
        12. image-2022-07-14-11-29-35-525.png
          9 kB
          Aitor Naberan
        13. main_window_v2.py
          2 kB
          Aitor Naberan
        14. main_window_v2-1.py
          0.2 kB
          Aitor Naberan
        15. main_window_v2-2.py
          0.2 kB
          Aitor Naberan
        16. main_window_v2-3.py
          2 kB
          Aitor Naberan
        17. main_window_v6.py
          2 kB
          Aitor Naberan
        18. main_window_v6-1.py
          2 kB
          Aitor Naberan
        19. main_window_v6-2.py
          0.2 kB
          Aitor Naberan
        20. main_window_v6-3.py
          0.2 kB
          Aitor Naberan
        21. main_window_v6-4.py
          2 kB
          Aitor Naberan
        22. source2.py
          479 kB
          Aitor Naberan
        23. source2-1.py
          479 kB
          Aitor Naberan
        24. source6.py
          479 kB
          Aitor Naberan
        25. source6-1.py
          479 kB
          Aitor Naberan
        26. test_v2.py
          0.4 kB
          Aitor Naberan
        27. test_v2-1.py
          0.4 kB
          Aitor Naberan
        28. test_v6.py
          0.4 kB
          Aitor Naberan
        29. test_v6-1.py
          0.4 kB
          Aitor Naberan
        30. test_v6-2.py
          0.4 kB
          Aitor Naberan
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            crmaurei Cristian Maureira-Fredes
            a.n.e. Aitor Naberan
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes