[PySide] tooltip background colour

Frank Rueter | OHUfx frank at ohufx.com
Tue Nov 19 08:50:48 CET 2013


Hi all,

I have a few custom widget with tooltips, one of which has such a dark 
background when run in context of it's host application that it's 
unreadable.
What is the best way to control a tooltip's window/background color?
I'm getting a bit lost amongst color roles and groups :/

This is what I was trying as a test but to no avail:

app = QtGui.QApplication([])
w = QtGui.QWidget()
w.setToolTip('test')

palette = w.palette()
palette.setColor(QtGui.QPalette.ColorGroup.Inactive,
     QtGui.QPalette.ColorRole.ToolTipBase,
     QtGui.QColor(255,0,0))

w.setPalette(palette)


w.show()
sys.exit(app.exec_())







Cheers,
frank



More information about the PySide mailing list