Results 1 to 3 of 3

Thread: Tell tthe program to get stuff from the Current dir...

  1. #1
    Join Date
    Jan 2012
    Posts
    15
    Qt products
    Qt3
    Platforms
    Windows

    Default Tell tthe program to get stuff from the Current dir...

    Hi, I am trying to get the program to use the files inside the current dir, but instead I have to tell it to use stuff from an specific location...
    For example i want to use qwebkit to load a html file with information about my program, so the user can edit it and the program can get the changes...

    I could use resources but those would be included inside the program, making it impossible to edit them...
    So I want the user to have a chance to edit some files that the program uses but I can only do that in an specific dir... ex: the program will get a file inside c:/programfolder, so i will have to create that folder inside c in every computer... which is not what i am looking for...


    How could I tell the program to get the files from the current dir the .exe is on....

  2. #2
    Join Date
    Nov 2006
    Location
    indonesia
    Posts
    55
    Thanked 11 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Tell tthe program to get stuff from the Current dir...

    Hi,
    Why you dont create your program to automatic CREATE a directory at specific location (if directory not exist) and USE that directory (if directory exist). I think this method is more simple. You can add this code when user open your program.
    You can use :
    Qt Code:
    1. if (!QDir.exist(yourdirlocation))
    2. QDir.mkdir(yourdirlocation)
    To copy to clipboard, switch view to plain text mode 
    You can create that directory in C or at same location with your exe directory.
    Thank you.

    Best regards,

    myta

  3. #3
    Join Date
    Dec 2010
    Location
    Russia
    Posts
    83
    Thanks
    1
    Thanked 12 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Tell tthe program to get stuff from the Current dir...

    Use QDir QDir::current () [static] function.

    http://doc.qt.nokia.com/4.7/qdir.html#current

Similar Threads

  1. Is it necessary to setDomainName and other stuff ?
    By Alir3z4 in forum General Discussion
    Replies: 1
    Last Post: 1st December 2011, 22:07
  2. Replies: 0
    Last Post: 19th July 2010, 00:18
  3. Phonon stuff
    By stevey in forum Qt Programming
    Replies: 3
    Last Post: 31st August 2009, 12:26
  4. Get Hot New Stuff!!!!
    By Mystical Groovy in forum KDE Forum
    Replies: 4
    Last Post: 16th December 2008, 00:21
  5. Export Qt stuff from DLL goes wrong
    By RThaden in forum Qt Programming
    Replies: 1
    Last Post: 29th March 2008, 22:09

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.