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. 'color' of QToolTip stylesheet not working

'color' of QToolTip stylesheet not working

Scheduled Pinned Locked Moved Unsolved Qt for Python
4 Posts 2 Posters 993 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.
  • EbyZeroE Offline
    EbyZeroE Offline
    EbyZero
    wrote on last edited by
    #1

    I am using python 3.11.1 and pyside 6.5.2.
    I wrote a style sheet for my tooltips as following and set this sheet on my main window.

    QToolTip {
        color: red;
    }
    

    But the text of tooltip did not change to red.
    I tested the same style sheet on pyside 6.4.2, it worked.
    Is there a something changed to applying style sheet between 6.5.2 and 6.4.2?

    it's delicious!

    EbyZeroE 1 Reply Last reply
    0
    • EbyZeroE EbyZero

      I am using python 3.11.1 and pyside 6.5.2.
      I wrote a style sheet for my tooltips as following and set this sheet on my main window.

      QToolTip {
          color: red;
      }
      

      But the text of tooltip did not change to red.
      I tested the same style sheet on pyside 6.4.2, it worked.
      Is there a something changed to applying style sheet between 6.5.2 and 6.4.2?

      EbyZeroE Offline
      EbyZeroE Offline
      EbyZero
      wrote on last edited by EbyZero
      #2

      @EbyZero The problem also occurs in widget designer of version 6.5.2, can be checked easily.
      I also checked version 6.5.1 and 6.4.3, and both work well.
      so I use version 6.5.1 now.

      it's delicious!

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

        Hi,

        Can you provide a minimal script to test that ?
        By the way, on which OS are you running ?

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

        EbyZeroE 1 Reply Last reply
        0
        • SGaistS SGaist

          Hi,

          Can you provide a minimal script to test that ?
          By the way, on which OS are you running ?

          EbyZeroE Offline
          EbyZeroE Offline
          EbyZero
          wrote on last edited by
          #4

          @SGaist
          Oh I am using windows 10 pro 22H2 19045.3448 build.
          You can get the problem through a simple example.

          import sys
          from PySide6.QtCore import *
          from PySide6.QtWidgets import *
          from PySide6.QtGui import *
          
          
          class mainwindow(QMainWindow):
              def __init__(self) -> None:
                  super().__init__()
                  layout = QHBoxLayout(self)
                  button = QPushButton("this is a button", self)
                  button.setToolTip("this is a tooltip")
                  button.resize(200, 200)
                  layout.addWidget(button)
                  self.resize(400, 400)
          
                  self.setStyleSheet("QToolTip { color: red; }")
          
          
          if __name__ == "__main__":
              app = QApplication(sys.argv)
              m = mainwindow()
              m.show()
              sys.exit(app.exec())
          

          Or can see it by using widget designer of pyside6.
          In version 6.5.2, you can see that the 'color' of the stylesheet for QToolTip is not working.

          it's delicious!

          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