| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153 |
- // qsettings.sip generated by MetaSIP
- //
- // This file is part of the QtCore Python extension module.
- //
- // Copyright (c) 2026 Riverbank Computing Limited <info@riverbankcomputing.com>
- //
- // This file is part of PyQt6.
- //
- // This file may be used under the terms of the GNU General Public License
- // version 3.0 as published by the Free Software Foundation and appearing in
- // the file LICENSE included in the packaging of this file. Please review the
- // following information to ensure the GNU General Public License version 3.0
- // requirements will be met: http://www.gnu.org/copyleft/gpl.html.
- //
- // If you do not wish to use this file under the terms of the GPL version 3.0
- // then you may purchase a commercial license. For more information contact
- // info@riverbankcomputing.com.
- //
- // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
- // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- class QSettings : public QObject
- {
- %TypeHeaderCode
- #include <qsettings.h>
- %End
- public:
- enum Status
- {
- NoError,
- AccessError,
- FormatError,
- };
- enum Format
- {
- NativeFormat,
- IniFormat,
- InvalidFormat,
- };
- enum Scope
- {
- UserScope,
- SystemScope,
- };
- QSettings(const QString &organization, const QString &application = QString(), QObject *parent /TransferThis/ = 0) /ReleaseGIL/;
- QSettings(QSettings::Scope scope, const QString &organization, const QString &application = QString(), QObject *parent /TransferThis/ = 0) /ReleaseGIL/;
- QSettings(QSettings::Format format, QSettings::Scope scope, const QString &organization, const QString &application = QString(), QObject *parent /TransferThis/ = 0) /ReleaseGIL/;
- QSettings(const QString &fileName, QSettings::Format format, QObject *parent /TransferThis/ = 0) /ReleaseGIL/;
- QSettings(QSettings::Scope scope, QObject *parent /TransferThis/ = 0) /ReleaseGIL/;
- explicit QSettings(QObject *parent /TransferThis/ = 0) /ReleaseGIL/;
- virtual ~QSettings() /ReleaseGIL/;
- void clear() /ReleaseGIL/;
- void sync() /ReleaseGIL/;
- QSettings::Status status() const;
- %If (Qt_6_4_0 -)
- void beginGroup(QAnyStringView prefix);
- %End
- %If (- Qt_6_4_0)
- void beginGroup(const QString &prefix);
- %End
- void endGroup();
- QString group() const;
- %If (Qt_6_4_0 -)
- int beginReadArray(QAnyStringView prefix);
- %End
- %If (- Qt_6_4_0)
- int beginReadArray(const QString &prefix);
- %End
- %If (Qt_6_4_0 -)
- void beginWriteArray(QAnyStringView prefix, int size = -1);
- %End
- %If (- Qt_6_4_0)
- void beginWriteArray(const QString &prefix, int size = -1);
- %End
- void endArray();
- void setArrayIndex(int i);
- QStringList allKeys() const /ReleaseGIL/;
- QStringList childKeys() const /ReleaseGIL/;
- QStringList childGroups() const /ReleaseGIL/;
- bool isWritable() const;
- %If (Qt_6_4_0 -)
- void setValue(QAnyStringView key, const QVariant &value) /ReleaseGIL/;
- %End
- %If (- Qt_6_4_0)
- void setValue(const QString &key, const QVariant &value) /ReleaseGIL/;
- %End
- %If (Qt_6_4_0 -)
- SIP_PYOBJECT value(const QAnyStringView &key, const QVariant &defaultValue = QVariant(), SIP_PYOBJECT type /TypeHint="type", TypeHintValue="None"/ = 0) const /ReleaseGIL/;
- %MethodCode
- QVariant value;
-
- // QSettings has an internal mutex so release the GIL to avoid the possibility
- // of deadlocks.
- Py_BEGIN_ALLOW_THREADS
- value = sipCpp->value(*a0, *a1);
- Py_END_ALLOW_THREADS
-
- sipRes = pyqt6_from_qvariant_by_type(value, a2);
-
- sipIsErr = !sipRes;
- %End
- %End
- %If (- Qt_6_4_0)
- SIP_PYOBJECT value(const QString &key, const QVariant &defaultValue = QVariant(), SIP_PYOBJECT type /TypeHint="type", TypeHintValue="None"/ = 0) const /ReleaseGIL/;
- %MethodCode
- QVariant value;
-
- // QSettings has an internal mutex so release the GIL to avoid the possibility
- // of deadlocks.
- Py_BEGIN_ALLOW_THREADS
- value = sipCpp->value(*a0, *a1);
- Py_END_ALLOW_THREADS
-
- sipRes = pyqt6_from_qvariant_by_type(value, a2);
-
- sipIsErr = !sipRes;
- %End
- %End
- %If (Qt_6_4_0 -)
- void remove(QAnyStringView key) /ReleaseGIL/;
- %End
- %If (- Qt_6_4_0)
- void remove(const QString &key) /ReleaseGIL/;
- %End
- %If (Qt_6_4_0 -)
- bool contains(QAnyStringView key) const /ReleaseGIL/;
- %End
- %If (- Qt_6_4_0)
- bool contains(const QString &key) const /ReleaseGIL/;
- %End
- void setFallbacksEnabled(bool b);
- bool fallbacksEnabled() const;
- QString fileName() const;
- static void setPath(QSettings::Format format, QSettings::Scope scope, const QString &path) /ReleaseGIL/;
- QSettings::Format format() const;
- QSettings::Scope scope() const;
- QString organizationName() const;
- QString applicationName() const;
- static void setDefaultFormat(QSettings::Format format);
- static QSettings::Format defaultFormat();
- bool isAtomicSyncRequired() const;
- void setAtomicSyncRequired(bool enable);
- protected:
- virtual bool event(QEvent *event);
- };
|