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. Cannot find enumerations for QLabel
Forum Updated to NodeBB v4.3 + New Features

Cannot find enumerations for QLabel

Scheduled Pinned Locked Moved Solved Qt for Python
3 Posts 2 Posters 462 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.
  • U Offline
    U Offline
    Urchin
    wrote on last edited by
    #1

    I have a shiny new Apple M1 Max with PyCharm CE with Python 3.8.9.

    Background: I have a PyQt5 project on a Raspberry Pi, but I can't seem to find an installable version of PyQt5 for the M1, so I'm biting the bullet and using PyQt6.

    I'm trying to use the 'setFrameStyle' function as in:

    title = QLabel("Station")
            title.setFont(QFont('Arial', 40))
            title.setFrameStyle(QFrame.Panel | QFrame.Raised)
    

    The problem is that it won't run because QFrame doesn't have a property 'Panel'. All the documentation says it's supposed to be there, but I can't find it. PyCharm doesn't show it as an option, and running it generates the error.

    In trying to troubleshoot I figured I'd install PyQt6 on my Raspberry, but I can't seem to get that working, either. If you have suggestions about that, I'm listening.

    eyllanescE 1 Reply Last reply
    0
    • U Urchin

      I have a shiny new Apple M1 Max with PyCharm CE with Python 3.8.9.

      Background: I have a PyQt5 project on a Raspberry Pi, but I can't seem to find an installable version of PyQt5 for the M1, so I'm biting the bullet and using PyQt6.

      I'm trying to use the 'setFrameStyle' function as in:

      title = QLabel("Station")
              title.setFont(QFont('Arial', 40))
              title.setFrameStyle(QFrame.Panel | QFrame.Raised)
      

      The problem is that it won't run because QFrame doesn't have a property 'Panel'. All the documentation says it's supposed to be there, but I can't find it. PyCharm doesn't show it as an option, and running it generates the error.

      In trying to troubleshoot I figured I'd install PyQt6 on my Raspberry, but I can't seem to get that working, either. If you have suggestions about that, I'm listening.

      eyllanescE Offline
      eyllanescE Offline
      eyllanesc
      wrote on last edited by eyllanesc
      #2

      @Urchin

      PyQt5: You say: The problem is that it won't run because QFrame doesn't have a property 'Panel', then see https://doc.qt.io/qt-5/qframe.html#Shape-enum

      PyQt6: Enums are stricter so you should use: title.setFrameStyle(QFrame.Shape.Panel | QFrame.Shape.Raised)

      If you want me to help you develop some work then you can write to my email: e.yllanescucho@gmal.com.

      U 1 Reply Last reply
      2
      • eyllanescE eyllanesc

        @Urchin

        PyQt5: You say: The problem is that it won't run because QFrame doesn't have a property 'Panel', then see https://doc.qt.io/qt-5/qframe.html#Shape-enum

        PyQt6: Enums are stricter so you should use: title.setFrameStyle(QFrame.Shape.Panel | QFrame.Shape.Raised)

        U Offline
        U Offline
        Urchin
        wrote on last edited by
        #3

        @eyllanesc Thank you so much! The documentation confused me when I saw
        QLabel::Panel, which I read as being a direct property of QLabel and not the Shape.

        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