Search code examples
qtqtablewidgetitem

How to change the background color of qtooltip of a qtablewidget item?


I have a qtablewidget. There are certain cells (qtablewidgetitem) in this table that need to show error message via qtooltip. I wish to change the background color of tooltip of each cell so as to highlight the tooltip message better. How can it be done ?


Solution

  • Probably the best way is the use of style sheets. You can set any text colors/background colors and text style that way.

    Depending on your QT version, see the documentation:

    Qt5 Style Sheet Documentation