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. Linux application looks ugly when launched with sudo
QtWS25 Last Chance

Linux application looks ugly when launched with sudo

Scheduled Pinned Locked Moved General and Desktop
8 Posts 5 Posters 5.8k 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.
  • U Offline
    U Offline
    usamytch
    wrote on last edited by
    #1

    Good day, colleagues!

    I'm writing Linux application that needs root privelleges. The problem is when I launch it from normal user, it looks nice, but when I launch it with sudo it looks ugly (wrong style, fonts, etc).

    Could you explain such behaviour?

    1 Reply Last reply
    0
    • V Offline
      V Offline
      vinb
      wrote on last edited by
      #2

      Strange,
      But mayby thats because root has different windowmanager settings.
      Do you work with stylesheets?

      1 Reply Last reply
      0
      • U Offline
        U Offline
        usamytch
        wrote on last edited by
        #3

        No, I've just create simple window in Qt Designer.

        normal execution:

        !http://img13.imageshack.us/img13/47/screenshotnormal.png!

        sudo execution:

        !http://img42.imageshack.us/img42/8599/screenshotsudo.png!

        1 Reply Last reply
        0
        • V Offline
          V Offline
          vinb
          wrote on last edited by
          #4

          Thats what i tought,
          your 'sudo' window is in motif style.
          try "this":http://doc.qt.nokia.com/4.7/qplastiquestyle.html

          1 Reply Last reply
          0
          • S Offline
            S Offline
            secretNinja
            wrote on last edited by
            #5

            Maybe this "link":http://helpforlinux.blogspot.com/2009/01/make-sudo-applications-beautiful.html could help.

            1 Reply Last reply
            0
            • Z Offline
              Z Offline
              ZapB
              wrote on last edited by
              #6

              Try running qtconfig via sudo and changing the default widget style to plastique or oxygen or whatever takes your fancy.

              Nokia Certified Qt Specialist
              Interested in hearing about Qt related work

              1 Reply Last reply
              0
              • D Offline
                D Offline
                diegosarmentero
                wrote on last edited by
                #7

                Executing an application with "sudo", takes the default theme, so not style configuration is applied.
                You can customize the root theme, but is a solution per machine, or maybe you can set the style of the application through code with Qt.

                Diego Sarmentero
                Blog: http://diegosarmentero.com.ar
                Twitter: http://twitter.com/diegosarmentero

                1 Reply Last reply
                0
                • U Offline
                  U Offline
                  usamytch
                  wrote on last edited by
                  #8

                  Thank you all, sudo qtconfig did the trick!

                  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