Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. Loading images of qt designer in python
QtWS25 Last Chance

Loading images of qt designer in python

Scheduled Pinned Locked Moved Unsolved Qt for Python
4 Posts 3 Posters 271 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jack_8390
    wrote on last edited by
    #1

    Hi all,

    I have successfully loaded and inserted the images in qt designer, but why I cannot see the image (but shows a file logo) when I run my code in python?43c04898-4d5c-443e-801e-25d1cd684246-image.png

    1 Reply Last reply
    0
    • M Offline
      M Offline
      Mizmas
      wrote on last edited by Mizmas
      #2

      Are you using pyqt or pyside? The workflow with pyqt6 for me is like this:

      1. Create a .qrc file in your resource/icon directory, setup prefixes and add your files.
        Screenshot_3.png
      2. Add the resources in the stylesheet and save your .ui file.
      3. Then you can create a .py file from your .qrc file with pyside6 using:
      pyside6-rcc -o desiredNewPythonFileName.py yourQrcFileName.qrc
      
      1. Open new .py file and change from PySide6 import QtCore to from PyQt6 import QtCore
      2. Import the new .py file to your project with import YourFileName
      1 Reply Last reply
      2
      • J Offline
        J Offline
        jack_8390
        wrote on last edited by
        #3

        I am using the PyQt 6 already? Should I also follow this step? Thank you

        jsulmJ 1 Reply Last reply
        0
        • J jack_8390

          I am using the PyQt 6 already? Should I also follow this step? Thank you

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @jack_8390 "The workflow with pyqt6 for me is like this" - so yes

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved