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
Forum Updated to NodeBB v4.3 + New Features

Loading images of qt designer in python

Scheduled Pinned Locked Moved Unsolved Qt for Python
4 Posts 3 Posters 372 Views 1 Watching
  • 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 6 Jan 2025, 22:16 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 6 Jan 2025, 23:52 last edited by Mizmas 19 days ago
      #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 7 Jan 2025, 00:28 last edited by
        #3

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

        J 1 Reply Last reply 7 Jan 2025, 08:03
        0
        • J jack_8390
          7 Jan 2025, 00:28

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

          J Offline
          J Offline
          jsulm
          Lifetime Qt Champion
          wrote on 7 Jan 2025, 08:03 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

          1/4

          6 Jan 2025, 22:16

          • Login

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