Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Linux application looks ugly when launched with sudo

    General and Desktop
    5
    8
    5368
    Loading More Posts
    • 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
      usamytch last edited by

      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 Reply Quote 0
      • V
        vinb last edited by

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

        1 Reply Last reply Reply Quote 0
        • U
          usamytch last edited by

          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 Reply Quote 0
          • V
            vinb last edited by

            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 Reply Quote 0
            • S
              secretNinja last edited by

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

              1 Reply Last reply Reply Quote 0
              • Z
                ZapB last edited by

                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 Reply Quote 0
                • D
                  diegosarmentero last edited by

                  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 Reply Quote 0
                  • U
                    usamytch last edited by

                    Thank you all, sudo qtconfig did the trick!

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post