Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Language Bindings
  4. How to set text color of QTextEdit in PyQt5
Forum Updated to NodeBB v4.3 + New Features

How to set text color of QTextEdit in PyQt5

Scheduled Pinned Locked Moved Unsolved Language Bindings
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.
  • Q Offline
    Q Offline
    QtFranchise
    wrote on last edited by
    #1

    Hi, how to set the text color of the QTextEdit in PyQt5. Using style sheet I can only change the background color.

    JonBJ 1 Reply Last reply
    0
    • Q QtFranchise

      Hi, how to set the text color of the QTextEdit in PyQt5. Using style sheet I can only change the background color.

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

      @QtFranchise said in How to set text color of QTextEdit in PyQt5:

      Using style sheet I can only change the background color.

      Is that really the case? Did you try setting the color CSS attribute?

      If that really does not work on a QTextEdit, you will either have to do it in code via a QPalette, or since the QTextEdit accepts HTML/rich text do it in HTML.

      1 Reply Last reply
      0
      • Q Offline
        Q Offline
        QtFranchise
        wrote on last edited by
        #3

        @JonB . Yes Sure

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi,

          What color do you want to change ?
          The text color ?
          The background ?
          Both ?

          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
          0

          • Login

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