Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qqmlsettings_p.h
Go to the documentation of this file.
1// Copyright (C) 2022 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
4#ifndef QQMLSETTINGS_P_H
5#define QQMLSETTINGS_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtCore/qobject.h>
19#include <QtCore/qvariant.h>
20#include <QtCore/qurl.h>
21#include <QtQml/qqml.h>
22#include <QtQml/qqmlparserstatus.h>
23#include <QtQmlCore/private/qqmlcoreglobal_p.h>
24
26
28
29class Q_QMLCORE_EXPORT QQmlSettings : public QObject, public QQmlParserStatus
30{
33 Q_DECLARE_PRIVATE(QQmlSettings)
34 QML_NAMED_ELEMENT(Settings)
36
37 Q_PROPERTY(QString category READ category WRITE setCategory NOTIFY categoryChanged FINAL)
38 Q_PROPERTY(QUrl location READ location WRITE setLocation NOTIFY locationChanged FINAL)
39
40public:
41 explicit QQmlSettings(QObject *parent = nullptr);
42 ~QQmlSettings() override;
43
44 QString category() const;
45 void setCategory(const QString &category);
46
47 QUrl location() const;
48 void setLocation(const QUrl &location);
49
50 Q_INVOKABLE QVariant value(const QString &key, const QVariant &defaultValue = {}) const;
51 Q_INVOKABLE void setValue(const QString &key, const QVariant &value);
52 Q_INVOKABLE void sync();
53
56 void locationChanged(const QUrl &arg);
57
58protected:
59 void timerEvent(QTimerEvent *event) override;
60
61 void classBegin() override;
62 void componentComplete() override;
63
64private:
65 QScopedPointer<QQmlSettingsPrivate> d_ptr;
66
67 Q_PRIVATE_SLOT(d_func(), void _q_propertyChanged())
68};
69
71
72#endif // QQMLSETTINGS_P_H
\inmodule QtCore
Definition qobject.h:103
The QQmlParserStatus class provides updates on the QML parser state.
void locationChanged(const QUrl &arg)
void categoryChanged(const QString &arg)
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\inmodule QtCore
Definition qcoreevent.h:366
\inmodule QtCore
Definition qurl.h:94
\inmodule QtCore
Definition qvariant.h:65
const QLoggingCategory & category()
[1]
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLint location
GLuint64 key
struct _cl_event * event
#define QML_NAMED_ELEMENT(NAME)
#define QML_ADDED_IN_VERSION(MAJOR, MINOR)
SSL_CTX int void * arg
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_INVOKABLE
#define Q_INTERFACES(x)
#define Q_PRIVATE_SLOT(d, signature)
#define Q_SIGNALS
#define explicit
settings setValue("DataPump/bgcolor", color)