No.
Let's assume that you want the custom tooltip be displayed for a button.
Then you need to subclass QPushButton and override its event() function, where you put the code I've shown you earlier.
The custom tooltip should be a member of this subclass.

BTW, for what widget(s) you want a custom tooltip to be displayed?

Regards