Thanks to Wysota and d_stranz! Thank you for your reply.
I use the following code to set the QLabel, and also does not work.
pal.
setColor( label
->backgroundRole
(), pal.
color( QPalette::Inactive,
QPalette::ToolTipBase ) );
pal.
setColor( label
->foregroundRole
(), pal.
color( QPalette::Inactive,
QPalette::ToolTipText ) );
label->setPalette( pal );
QPalette pal = QToolTip::palette();
pal.setColor( label->backgroundRole(), pal.color( QPalette::Inactive, QPalette::ToolTipBase ) );
pal.setColor( label->foregroundRole(), pal.color( QPalette::Inactive, QPalette::ToolTipText ) );
label->setPalette( pal );
To copy to clipboard, switch view to plain text mode
I want to make something like Code Parameters in Qt Creator (See the screenshot below). When the code parameters is displaying, the tooltip is still available when you hover on code.
p3.png
Bookmarks