Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. why my app cant display image ?
Forum Updated to NodeBB v4.3 + New Features

why my app cant display image ?

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 4 Posters 422 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.
  • I Offline
    I Offline
    inkybear
    wrote on last edited by
    #1

    PyQt6, window 10, Python 3.10.4
    I use code from this https://www.geeksforgeeks.org/pyqt5-how-to-add-image-in-window/ and change it to PyQt6, but why i cant display image with .png ?
    efbd0b56-2583-4196-9d9a-fdaf83f7e33d-image.png

    JonBJ 1 Reply Last reply
    0
    • I inkybear

      PyQt6, window 10, Python 3.10.4
      I use code from this https://www.geeksforgeeks.org/pyqt5-how-to-add-image-in-window/ and change it to PyQt6, but why i cant display image with .png ?
      efbd0b56-2583-4196-9d9a-fdaf83f7e33d-image.png

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by JonB
      #2

      @inkybear said in why my app cant display image ?:

      with .png ?

      Because the file is .jpg?

      Please post code as text (with Code tags) rather than screen shots.

      I 1 Reply Last reply
      1
      • JonBJ JonB

        @inkybear said in why my app cant display image ?:

        with .png ?

        Because the file is .jpg?

        Please post code as text (with Code tags) rather than screen shots.

        I Offline
        I Offline
        inkybear
        wrote on last edited by
        #3

        @JonB its the same with .jpg or .png, its still not display anything

        SGaistS C 2 Replies Last reply
        0
        • I inkybear

          @JonB its the same with .jpg or .png, its still not display anything

          SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @inkybear hi,

          Your image path is wrong, use a forward slash. A single backward slash in a string is the start of an escape sequence.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          3
          • I inkybear

            @JonB its the same with .jpg or .png, its still not display anything

            C Offline
            C Offline
            ChrisW67
            wrote on last edited by
            #5

            @inkybear Hello.

            Further to @SGaist's advice: The path you have provided is relative to the current working directory of the application, which may not be where you think it is.

            1 Reply Last reply
            2

            • Login

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