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. QLabel has no attribute "setPixmap"
Qt 6.11 is out! See what's new in the release blog

QLabel has no attribute "setPixmap"

Scheduled Pinned Locked Moved Solved Qt for Python
4 Posts 3 Posters 2.1k 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
    Igor86
    wrote on last edited by
    #1

    hello all!

    I have 2 labels on my GUI, and want to display an image... follwoing code:

        if inspection == False:
            self.originalPic.setPixmap(pixmap)
        else:
            self.originalPicInspection.setPixMap(pixmap)
    

    the first one works, the second one (else condition) throws error

    'QLabel' object has no attribute 'setPixMap'
    

    I am not able to figure out what the problem is. It is a label like the other, the name is correct (sinche also the error message says that it is a QLabel,) what could cause this error?

    JonBJ 1 Reply Last reply
    0
    • I Igor86

      hello all!

      I have 2 labels on my GUI, and want to display an image... follwoing code:

          if inspection == False:
              self.originalPic.setPixmap(pixmap)
          else:
              self.originalPicInspection.setPixMap(pixmap)
      

      the first one works, the second one (else condition) throws error

      'QLabel' object has no attribute 'setPixMap'
      

      I am not able to figure out what the problem is. It is a label like the other, the name is correct (sinche also the error message says that it is a QLabel,) what could cause this error?

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

      @Igor86 The error message tells you: look at the spelling.

      JKSHJ 1 Reply Last reply
      2
      • JonBJ JonB

        @Igor86 The error message tells you: look at the spelling.

        JKSHJ Offline
        JKSHJ Offline
        JKSH
        Moderators
        wrote on last edited by
        #3

        @JonB said in QLabel has no attribute "setPixmap":

        look at the spelling.

        (including uppercase vs. lowercase)

        Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

        1 Reply Last reply
        1
        • I Offline
          I Offline
          Igor86
          wrote on last edited by
          #4

          got it.. thank you guys!

          1 Reply Last reply
          3

          • Login

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