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 a script as administrator in Qt
Forum Update on Monday, May 27th 2025

How to run a script as administrator in Qt

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 451 Views
  • 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.
  • Vinod KuntojiV Offline
    Vinod KuntojiV Offline
    Vinod Kuntoji
    wrote on last edited by
    #1

    How to run a script as administrator in Qt

    C++, Qt, Qt Quick Developer,
    PthinkS, Bangalore

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      There is no built-in API for this, you need to use native method for each platform.

      (Z(:^

      1 Reply Last reply
      1
      • Vinod KuntojiV Offline
        Vinod KuntojiV Offline
        Vinod Kuntoji
        wrote on last edited by
        #3

        @sierdzio , Can you give one example?

        C++, Qt, Qt Quick Developer,
        PthinkS, Bangalore

        J.HilkJ 1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          Some hints on how to achieve this on Windows https://forum.qt.io/topic/64378/call-another-application-with-administrator-priviliges/14

          On Linux you should probably take a look at GtkSudo or KdeSudo https://askubuntu.com/questions/425620/sudo-gksudo-kdesudo-and-their-differences

          macOS - I have no idea.

          (Z(:^

          1 Reply Last reply
          5
          • Vinod KuntojiV Vinod Kuntoji

            @sierdzio , Can you give one example?

            J.HilkJ Offline
            J.HilkJ Offline
            J.Hilk
            Moderators
            wrote on last edited by J.Hilk
            #5

            @Vinod-Kuntoji for macOS, I never did it yet, So I can't help,

            But I may point you to some informative websides

            https://developer.apple.com/library/archive/documentation/Security/Conceptual/SecureCodingGuide/Articles/AccessControl.html

            And if you set yourself up as root user, you shouldn't need extra privileges.
            https://support.apple.com/en-us/HT204012
            But that's an rather extrem solution....


            Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


            Q: What's that?
            A: It's blue light.
            Q: What does it do?
            A: It turns blue.

            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