Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qqmlsettings_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QQMLSETTINGS_P_H
6#define QQMLSETTINGS_P_H
7
9
10//
11// W A R N I N G
12// -------------
13//
14// This file is not part of the Qt API. It exists purely as an
15// implementation detail. This header file may change from version to
16// version without notice, or even be removed.
17//
18// We mean it.
19//
20
21#include <QtQml/qqml.h>
22#include <QtCore/qobject.h>
23#include <QtCore/qscopedpointer.h>
24#include <QtQml/qqmlparserstatus.h>
25
26QT_BEGIN_NAMESPACE
27
28class QQmlSettingsLabsPrivate;
29
30class Q_LABSSETTINGS_EXPORT QQmlSettingsLabs : public QObject, public QQmlParserStatus
31{
32 Q_OBJECT
33 Q_INTERFACES(QQmlParserStatus)
34 Q_PROPERTY(QString category READ category WRITE setCategory FINAL)
35 Q_PROPERTY(QString fileName READ fileName WRITE setFileName FINAL)
36 QML_NAMED_ELEMENT(Settings)
37 QML_ADDED_IN_VERSION(1, 0)
38
39public:
40 explicit QQmlSettingsLabs(QObject *parent = nullptr);
41 ~QQmlSettingsLabs();
42
43 QString category() const;
44 void setCategory(const QString &category);
45
46 QString fileName() const;
47 void setFileName(const QString &fileName);
48
49 Q_INVOKABLE QVariant value(const QString &key, const QVariant &defaultValue = QVariant()) const;
50 Q_INVOKABLE void setValue(const QString &key, const QVariant &value);
51 Q_INVOKABLE void sync();
52
53protected:
54 void timerEvent(QTimerEvent *event) override;
55
56 void classBegin() override;
57 void componentComplete() override;
58
59private:
60 Q_DISABLE_COPY(QQmlSettingsLabs)
61 Q_DECLARE_PRIVATE(QQmlSettingsLabs)
62 QScopedPointer<QQmlSettingsLabsPrivate> d_ptr;
63 Q_PRIVATE_SLOT(d_func(), void _q_propertyChanged())
64};
65
66QT_END_NAMESPACE
67
68#endif // QQMLSETTINGS_P_H
\inmodule QtCore
Definition qhash.h:837
QSettings * instance() const
QPointer< QSettings > settings
QQmlSettingsLabs * q_ptr
QVariant readProperty(const QMetaProperty &property) const
QHash< const char *, QVariant > changedProperties
static constexpr auto settingsWriteDelay
#define qCDebug(category,...)
#define Q_STATIC_LOGGING_CATEGORY(name,...)