[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: [PyQt] Multi-process QSettings and PyQt 5
From: Damon Lynch <damonlynch () gmail ! com>
Date: 2015-04-23 16:46:22
Message-ID: 553921DE.8050200 () gmail ! com
[Download RAW message or body]
Hi everyone,
I have developed some code to use QSettings where it's easy to update
values like prefs.value = new_value, with the values being grouped so
that they're human readable too (GPL3+):
http://bazaar.launchpad.net/~dlynch3/rapid/zeromq_pyqt/view/head:/rapid/preferences.py#L136
I'm sure I'm far from the first person to do something very similar to
this. I'm still new to Qt so hopefully it's okay.
I read this in the QT5 docs: "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)."
Does the file locking and syncing work robustly using PyQt 5? Are there
any gotchas I should be aware of? In my case I'd like it that my
single-instance only application will have a couple of processes that
read and write the settings. The main GUI process will do the majority
of reading and writing, and a secondary process will read various values
and write two of them. Hopefully that's a relatively easy use case and
there is nothing to worry about.
Best,
Damon
--
http://www.damonlynch.net
_______________________________________________
PyQt mailing list PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic