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. Window attached to a system tray icon
Forum Updated to NodeBB v4.3 + New Features

Window attached to a system tray icon

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 1.0k 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.
  • C Offline
    C Offline
    Cesius
    wrote on last edited by
    #1

    Hi everyone,

    Is there any class to create a window attached to a system tray icon in a similar way as Dropbox does it?

    Here you can find an example for "Mac OS X":https://d339l1rkauam1y.cloudfront.net/wp-content/uploads/2013/02/mac.png and another for "Windows":http://i1-news.softpedia-static.com/images/news2/Dropbox-2-0-Introduces-New-Tray-Menu-2.png.

    Thanks!

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

      Hi,

      Looks like a job for a QML dialog otherwise you can also simply try with a decoration less widget.

      Hope it helps

      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
      • raven-worxR Offline
        raven-worxR Offline
        raven-worx
        Moderators
        wrote on last edited by
        #3

        [quote author="Cesius" date="1421794006"]
        Is there any class to create a window attached to a system tray icon in a similar way as Dropbox does it?[/quote]

        Not directly offered via the Qt API.

        But you can try this:
        Use QSystemTrayIcon::setContextMenu() to set a custom QMenu. This QMenu instance actually doesn't need to have a ordinary menu item but a QWidgetAction.
        @
        QWidgetAction* widgetAction = new QWidgetAction;
        widgetAction->setDefaultWidget( widget );
        QMenu* widgetMenu = new QMenu( sysTray );
        widgetMenu->addAction( widgetAction );
        sysTray->setMenu( widgetMenu );
        @

        Haven't tested this code though, but worth a try.

        --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
        If you have a question please use the forum so others can benefit from the solution in the future

        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