Results 1 to 4 of 4

Thread: Find Directory where OS is installed

  1. #1
    Join Date
    Jul 2010
    Posts
    25
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Find Directory where OS is installed

    Hi,
    Could anyone please help me find theDirectory where the OS is installed using Qt 4.7.4.
    The OS is Windows7.
    Appreciate your help.
    Thanks in advance.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Find Directory where OS is installed

    You can try with
    Qt Code:
    1. qgetenv("SystemRoot")
    To copy to clipboard, switch view to plain text mode 

    or
    Qt Code:
    1. qgetenv("WinDir")
    To copy to clipboard, switch view to plain text mode 
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Jan 2012
    Location
    Argentina
    Posts
    167
    Thanks
    33
    Thanked 10 Times in 10 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Find Directory where OS is installed

    Try using QDir..check the documentation. There is a function (actually a few) that can provide you with useful information like:

    QDir QString Return Value
    current() currentPath() The application's working directory
    home() homePath() The user's home directory
    root() rootPath() The root directory
    temp() tempPath() The system's temporary directory

    hope it helps

  4. #4
    Join Date
    Jul 2010
    Posts
    25
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Find Directory where OS is installed

    Thanks. Will try it out.
    Just one more doubt. Can we get a list of the number of directories present?
    I was looking through and got to know that QDir:irs might do the trick, but am not so sure about it.

Similar Threads

  1. QFontDatabase:Cannot find font directory
    By soumya in forum Qt for Embedded and Mobile
    Replies: 9
    Last Post: 10th November 2014, 06:08
  2. How to find Application Data directory?
    By Teuniz in forum Qt Programming
    Replies: 7
    Last Post: 26th July 2013, 14:02
  3. Newbie to linux - installed qt but couldnt find standart libraries
    By hgedek in forum Installation and Deployment
    Replies: 2
    Last Post: 9th October 2011, 17:24
  4. Find the Qt root directory
    By sajis997 in forum Newbie
    Replies: 1
    Last Post: 15th July 2011, 22:52
  5. How to find if Visual Studion 2008 installed
    By sawerset in forum Newbie
    Replies: 1
    Last Post: 7th December 2008, 18:28

Tags for this Thread

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.