Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Cannot add html links to QSystemTrayIcon

Cannot add html links to QSystemTrayIcon

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 1.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • kalmaK Offline
    kalmaK Offline
    kalma
    wrote on last edited by
    #1

    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);
    }
    @

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      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.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • kalmaK Offline
        kalmaK Offline
        kalma
        wrote on last edited by
        #3

        Hi SGaist!

        Thanks for the quick response, I will do what you recommend, though its strange that it can't be done.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          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.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved