Class SBGUIToolTip#
The SBGUIToolTip class provides a custom tooltip widget with rich-text and clickable link support.
#include "SBGUIToolTip.hpp"
Inherits the following classes: QWidget
Public Types#
Type | Name |
---|---|
typedef std::function< void(const QString &href)> | LinkHandler Type for a global link handler (receives the full href, e.g. "action://UUID" or "https://..."). |
typedef std::function< void(const QString &href)> | LinkHoverHandler |
Public Functions#
Type | Name |
---|---|
SBGUIToolTip (QWidget * parent=nullptr) |
|
QLabel * | getLabel () const Access internal label (useful if you also show manual tooltips). |
void | setHtml (QString htmlOrPlain) |
void | showAt (const QPoint & globalAnchor) |
Public Static Functions#
Type | Name |
---|---|
void | activateLink (const QString & href) |
void | hoverLink (const QString & href) |
void | installFor (QWidget * target) |
void | installFor (QApplication * app) |
void | setGlobalLinkHandler (LinkHandler handler) Sets a global link handler used by tooltips installed via installFor(&app). |
void | setGlobalLinkHoverHandler (LinkHoverHandler handler) |
void | setUseOverrideCursorOnLinks (bool enable) Enables/disables using an override cursor (PointingHand) when hovering links. |
Protected Functions#
Type | Name |
---|---|
void | enterEvent (QEnterEvent * e) override |
bool | eventFilter (QObject * obj, QEvent * event) override |
void | leaveEvent (QEvent * e) override |
void | paintEvent (QPaintEvent * e) override |
Public Types Documentation#
typedef LinkHandler#
Type for a global link handler (receives the full href, e.g. "action://UUID" or "https://...").
typedef LinkHoverHandler#
Public Functions Documentation#
function SBGUIToolTip#
function getLabel#
Access internal label (useful if you also show manual tooltips).
function setHtml#
function showAt#
Public Static Functions Documentation#
function activateLink#
function hoverLink#
function installFor [1/2]#
function installFor [2/2]#
function setGlobalLinkHandler#
Sets a global link handler used by tooltips installed via installFor(&app).
If set, every link click in any tooltip calls this callback. You can route "action://..." here. If unset, http(s) links will open with QDesktopServices.
function setGlobalLinkHoverHandler#
function setUseOverrideCursorOnLinks#
Enables/disables using an override cursor (PointingHand) when hovering links.
Recommended 'true' on Windows so links in QMenu/QMenuBar/QToolBar show the correct cursor.