Results 1 to 3 of 3

Thread: QDir::currentPath() and start program at login - Windows

  1. #1
    Join Date
    Oct 2008
    Posts
    306
    Thanks
    6
    Thanked 9 Times in 8 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default QDir::currentPath() and start program at login - Windows

    I have to access several files(images, etc..) that are on sub-folders of my installed program. But when putting the program to launch at startup it seems that QDir::currentPath() isn't where the executable is, but rather somewhere else where the shortcut is.
    Should I use the Windows Registry to set my app's path? I yes, how can I access it with QT?

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: QDir::currentPath() and start program at login - Windows

    To get the dir of your executable you have to use QCoreApplication::applicationDirPath(). Have also a look at the wiki: [WIKI]Current_working_directory[/WIKI]

  3. #3
    Join Date
    Oct 2008
    Posts
    306
    Thanks
    6
    Thanked 9 Times in 8 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QDir::currentPath() and start program at login - Windows

    Thank you very much.

Similar Threads

  1. QProcess Problem: Program doesnt start
    By musaulker in forum Newbie
    Replies: 5
    Last Post: 30th April 2020, 23:07
  2. a program to start another program.
    By zakis in forum Qt Programming
    Replies: 4
    Last Post: 17th December 2009, 19:25
  3. add a program to start menu
    By kpmsivachand in forum KDE Forum
    Replies: 1
    Last Post: 26th January 2009, 20:19
  4. How to hide mainwindow at program start up
    By palmer in forum Qt Programming
    Replies: 4
    Last Post: 13th September 2008, 14:35
  5. QProcess start a console program
    By Shawn in forum Qt Programming
    Replies: 2
    Last Post: 9th November 2007, 12:38

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.