Hi all, a question here regarding the manual triggering of a QToolTip using the static method QToolTip::showText().

When I use the following CSS, all tooltips that occur of their own volition (mousing over a button, etc.) are styled, but any tooltips drawn using QToolTip::showText() (i.e. throwing up a tooltip where the user clicks on a certain point in a widget) use the native color scheme. Is it possible to apply CSS to this use of tooltips?

Qt Code:
  1. background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 rgba(99, 165, 209, 255), stop:1 rgba(64, 141, 196, 255));
  2. color: rgb(255,255,255);
  3. opacity:150;
  4. text-align: center;
  5. }
To copy to clipboard, switch view to plain text mode 

And, I'm triggering the tooltip manually by intercepting mousePressEvent in my widget, and then triggering a timer that ultimately calls a slot which does:

Qt Code:
  1. QPoint point = this->mapToGlobal(QPoint(m_curX, m_curY));
  2. QString descText = "...";
  3. QToolTip::showText(point, descText);
To copy to clipboard, switch view to plain text mode 

This is the only tooltip that isn't styled when the CSS is used in the mainwindow.ui file. Any advise would be highly appreciated. Thanks!