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. How to run qt program tray display with root
Forum Updated to NodeBB v4.3 + New Features

How to run qt program tray display with root

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 591 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.
  • L Offline
    L Offline
    leisureg
    wrote on last edited by
    #1

    I can run qt program in ordinary user to display the tray, but cannot run with root permission to display the tray

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

      Hi and welcome to the forums
      Why not?
      What happens?
      Does it say error?
      What OS are you on?
      What tray are you talking about?

      1 Reply Last reply
      0
      • L Offline
        L Offline
        leisureg
        wrote on last edited by
        #3

        @leisureg said in How to run qt program tray display with root:

        tray

        Command line display:QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
        tray error

        I am using ubuntu18.04
        I want it to appear like a power source in the upper right corner of the operating system
        0_1554360096693_2323c7c5-1d5b-4f87-ba84-aef7c97cee11-image.png

            if (!QSystemTrayIcon::isSystemTrayAvailable())
            {
                    qDebug() << "tray error" << endl;
            }
        

        sudo run it will into qDebug,but general authority don't

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

          Hi and welcome to devnet,

          From what I remember, by default access to the X server is disabled for root for security reasons. You have to explicitly allow it.

          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
          2

          • Login

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