Cannot add html links to QSystemTrayIcon
-
Qt 5.3.0, Win7
Hi,
How can I add active html links to tray icon, the code below only shows the whole literal string i.e. the viewable string and the anchor string itself, what is wrong?@
QSystemTrayIcon *icon = new QSystemTrayIcon(QIcon(":/icons/google.png"), this);
if(icon->isSystemTrayAvailable()){
icon->show();
icon->showMessage(tr("Search"), tr("Search in Google <a href='https://www.google.com'>www.google.com</a>") ,QSystemTrayIcon::Information, 2000);
}
@ -
Hi,
AFAIK, it's not possible. However you can use the messageClicked signal to do something like opening the default web browser when a user clicks on the message.
-
Hi SGaist!
Thanks for the quick response, I will do what you recommend, though its strange that it can't be done.
-
Not especially strange, Qt uses your OS notification service/framework when available so if this one doesn't support html, there's nothing it can do for you.