Results 1 to 3 of 3

Thread: how to run qt program in root directory(linux)

  1. #1
    Join Date
    Nov 2014
    Location
    Chennai
    Posts
    160
    Thanks
    65
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default how to run qt program in root directory(linux)

    i have created qtwidget program..
    i want to execute this qt program in root directory of linux script.
    can any one give me suggesstion for this
    Thanx in advance

  2. #2
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,536
    Thanked 284 Times in 279 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how to run qt program in root directory(linux)

    Login as root or try command su

  3. #3
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: how to run qt program in root directory(linux)

    Quote Originally Posted by iswaryasenthilkumar View Post
    i want to execute this qt program in root directory of linux script.
    What does that mean?

    You want the root directory to be the program's current work directory?
    Just have the script change to the root directory before you execute the program
    Qt Code:
    1. cd /
    2. /path/to/program
    To copy to clipboard, switch view to plain text mode 
    or have the program change its working directory:
    Qt Code:
    1. QDir::setCurrent(QDir::rootPath());
    To copy to clipboard, switch view to plain text mode 

    The question is: why would you need that?
    Why would your program rely on that?

    Cheers,
    _

  4. The following user says thank you to anda_skoa for this useful post:

    iswaryasenthilkumar (9th January 2015)

Similar Threads

  1. How to get root permission inside qt program?
    By manojpatidar in forum Qt Programming
    Replies: 2
    Last Post: 18th September 2014, 21:59
  2. Executing linux command as root
    By stefan in forum Qt Programming
    Replies: 1
    Last Post: 15th August 2011, 15:07
  3. Find the Qt root directory
    By sajis997 in forum Newbie
    Replies: 1
    Last Post: 15th July 2011, 22:52
  4. Running an application with root privileges at Linux
    By prykHetQuo in forum Qt Programming
    Replies: 5
    Last Post: 25th January 2009, 12:35
  5. Replies: 0
    Last Post: 16th April 2007, 12:18

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.