Results 1 to 6 of 6

Thread: Doubts regarding QLockFile and QSettings

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,349
    Qt products
    Qt5
    Platforms
    Windows
    Thanks
    318
    Thanked 872 Times in 859 Posts

    Default Re: Doubts regarding QLockFile and QSettings

    From the QSettings documentation:

    Accessing Settings from Multiple Threads or Processes Simultaneously

    QSettings is reentrant. This means that you can use distinct QSettings object in different threads simultaneously. This guarantee stands even when the QSettings objects refer to the same files on disk (or to the same entries in the system registry). If a setting is modified through one QSettings object, the change will immediately be visible in any other QSettings objects that operate on the same location and that live in the same process.

    QSettings can safely be used from different processes (which can be different instances of your application running at the same time or different applications altogether) to read and write to the same system locations. It uses advisory file locking and a smart merging algorithm to ensure data integrity. Note that sync() imports changes made by other processes (in addition to writing the changes from this QSettings).
    Even though you are using QSettings instances within the same thread, these comments still apply.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  2. #2
    Join Date
    Aug 2016
    Posts
    3
    Qt products
    Qt5 Qt/Embedded

    Smile Re: Doubts regarding QLockFile and QSettings

    Thank you. This removes the suspect.

    The main problem still remains. As I mentioned, upon application reset and device reboot, the lock files are still present in the file location.
    Will try with setStaleLockTime(0), removeStaleLockFile() etc and see if any of these helps.

Similar Threads

  1. QTransform doubts .
    By tonnot in forum Newbie
    Replies: 4
    Last Post: 26th July 2011, 20:36
  2. Replies: 1
    Last Post: 14th January 2011, 11:57
  3. Doubts about STL libraries
    By tonnot in forum General Discussion
    Replies: 2
    Last Post: 22nd September 2010, 11:34
  4. doubts regarding QT
    By sudheer168 in forum Qt Programming
    Replies: 1
    Last Post: 23rd September 2009, 09:02
  5. some doubts qtablewidget
    By mmm286 in forum Qt Programming
    Replies: 1
    Last Post: 2nd August 2009, 20:36

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
  •  
Qt is a trademark of The Qt Company.