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. Main window positioned near Tray Icon
Forum Updated to NodeBB v4.3 + New Features

Main window positioned near Tray Icon

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 3 Posters 528 Views 2 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.
  • E Offline
    E Offline
    erio
    wrote on last edited by
    #1

    Hi, I made a software that runs continuously and use a QTrayIcon, and I made it so clicking it or using the proper context menu it loads the main window.

    Now, I would like this new window to open closer to the icon tray, similar to how JetBrains Toolbox works. Is there a way to do this? The tray may be positioned in different places depending of the taskbar position or on Linux even DE. Is there a way to handle this?

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

      Hi,

      You can use the geometry of the tray icon to position the window by it,

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

      E 1 Reply Last reply
      1
      • M Offline
        M Offline
        mchinand
        wrote on last edited by
        #2

        Maybe instead convert your QMainWindow to a QMenu and using setContextMenu()

        1 Reply Last reply
        0
        • E Offline
          E Offline
          erio
          wrote on last edited by erio
          #3

          @mchinand I need to show a tabbed pane, a toolbar, and a list of things, it's not trivial to repaint a context menu to include those things I think.

          I would prefer to have some way to position the window near it, even if I need to manually query something to pickup this position properly.

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

            Hi,

            You can use the geometry of the tray icon to position the window by it,

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

            E 1 Reply Last reply
            1
            • SGaistS SGaist

              Hi,

              You can use the geometry of the tray icon to position the window by it,

              E Offline
              E Offline
              erio
              wrote on last edited by
              #5

              @SGaist THANK YOU!!!!!!!!!!!!!! That was it!

              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