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. AttributeError: type object ‘QPalette’ has no attribute ‘placeholderText’
Forum Updated to NodeBB v4.3 + New Features

AttributeError: type object ‘QPalette’ has no attribute ‘placeholderText’

Scheduled Pinned Locked Moved Solved Qt for Python
3 Posts 3 Posters 3.6k 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.
  • A Offline
    A Offline
    Alessio753
    wrote on last edited by
    #1

    Hello,
    I developed a simple Qt application with graphical user-interface in python(python 3.8.6). I using the following Qt version
    Qt creator 4.13.2
    based on QT 5.15.1 (MSVC 2019, 64bit)
    built on Oct 1 2020 01:14:56
    Now I want to run my application on raspberry pi 3 model B with the Raspberry Pi OS (32-bit) Relased: 2020-08-20.
    I installed on Raspberry board python 3.7.3 using the command:
    sudo apt install python3 idle3
    and the pyqt5 using the command:
    sudo apt-get install python3-pyqt5
    I also updated the all the pakages.
    Then I tried to run the project with Thonny 3.2.6 Linux Python 3.7.3(32 bit) Tk 8.6.9
    But I obtained the following error :
    AttributeError: type object ‘QPalette’ has no attribute ‘placeholderText’
    This error raised from the following python instruction :
    palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.PlaceholderText, brush)

    How I can fix this?
    Thanks in advance for any replies.

    jsulmJ JonBJ 2 Replies Last reply
    0
    • A Alessio753

      Hello,
      I developed a simple Qt application with graphical user-interface in python(python 3.8.6). I using the following Qt version
      Qt creator 4.13.2
      based on QT 5.15.1 (MSVC 2019, 64bit)
      built on Oct 1 2020 01:14:56
      Now I want to run my application on raspberry pi 3 model B with the Raspberry Pi OS (32-bit) Relased: 2020-08-20.
      I installed on Raspberry board python 3.7.3 using the command:
      sudo apt install python3 idle3
      and the pyqt5 using the command:
      sudo apt-get install python3-pyqt5
      I also updated the all the pakages.
      Then I tried to run the project with Thonny 3.2.6 Linux Python 3.7.3(32 bit) Tk 8.6.9
      But I obtained the following error :
      AttributeError: type object ‘QPalette’ has no attribute ‘placeholderText’
      This error raised from the following python instruction :
      palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.PlaceholderText, brush)

      How I can fix this?
      Thanks in advance for any replies.

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

      @Alessio753 What Qt version do you use? Documentation says: "This function was introduced in Qt 5.12."
      Please note that "Qt creator 4.13.2
      based on QT 5.15.1 (MSVC 2019, 64bit)" does not say which Qt version you're using!

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

      1 Reply Last reply
      2
      • A Alessio753

        Hello,
        I developed a simple Qt application with graphical user-interface in python(python 3.8.6). I using the following Qt version
        Qt creator 4.13.2
        based on QT 5.15.1 (MSVC 2019, 64bit)
        built on Oct 1 2020 01:14:56
        Now I want to run my application on raspberry pi 3 model B with the Raspberry Pi OS (32-bit) Relased: 2020-08-20.
        I installed on Raspberry board python 3.7.3 using the command:
        sudo apt install python3 idle3
        and the pyqt5 using the command:
        sudo apt-get install python3-pyqt5
        I also updated the all the pakages.
        Then I tried to run the project with Thonny 3.2.6 Linux Python 3.7.3(32 bit) Tk 8.6.9
        But I obtained the following error :
        AttributeError: type object ‘QPalette’ has no attribute ‘placeholderText’
        This error raised from the following python instruction :
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.PlaceholderText, brush)

        How I can fix this?
        Thanks in advance for any replies.

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

        @Alessio753
        In addition to needing know what version of Qt you are using as per @jsulm, you also need to supply which version of PyQt you are using, as that will also require to be at >= 5.12 in order to have the binding for the underlying Qt function.

        1 Reply Last reply
        1

        • Login

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