Some questions about build?

  • Hi,
    I have a qt project that i am developing in ArchLinux.

    In my project, there are text file and sqlite database file as well.

    To use this program, i am inserting some sentences into my txt file and i am adding these sentences into database according to my process.

    For example; I am editing txt file outside the program by using text editor. Then I am running program to process these sentences. But when I build my project, there are object output files.

    Here is the question.
    What if I publish this program public, how can i edit that txt file? Is it stupid thing to put that file into same directory with qt project?

    How can i deal with this situation?


  • Lifetime Qt Champion

    If you publish your app then you should use standard directories for documents/configuration (and NOT the directory where your app or Qt is installed!).
    Should the user be able to edit that text file?
    Does this file contain some predefined content?
    If it does your app could generate this file if it is not there and write this predefined content into the file.
    If user should be able to edit the file directly then you should store the file somewhere in its home directory ("My Documents" on Windows /home/USENAME on Linux). Else you can treat the file like a configuration file.
    See here how to get paths to standard directories:

Log in to reply