diff options
Diffstat (limited to 'src/qml/qml/qqmlcontext.h')
-rw-r--r-- | src/qml/qml/qqmlcontext.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/qml/qml/qqmlcontext.h b/src/qml/qml/qqmlcontext.h index b2b95b7573..7ed70c7619 100644 --- a/src/qml/qml/qqmlcontext.h +++ b/src/qml/qml/qqmlcontext.h @@ -42,6 +42,8 @@ #include <QtCore/qurl.h> #include <QtCore/qobject.h> +#include <QtCore/qlist.h> +#include <QtCore/qpair.h> #include <QtQml/qjsvalue.h> #include <QtCore/qmetatype.h> #include <QtCore/qvariant.h> @@ -62,9 +64,11 @@ class Q_QML_EXPORT QQmlContext : public QObject Q_DECLARE_PRIVATE(QQmlContext) public: + struct PropertyPair { QString name; QVariant value; }; + QQmlContext(QQmlEngine *parent, QObject *objParent = nullptr); QQmlContext(QQmlContext *parent, QObject *objParent = nullptr); - virtual ~QQmlContext(); + ~QQmlContext() override; bool isValid() const; @@ -77,6 +81,7 @@ public: QVariant contextProperty(const QString &) const; void setContextProperty(const QString &, QObject *); void setContextProperty(const QString &, const QVariant &); + void setContextProperties(const QVector<PropertyPair> &properties); // ### Qt 6: no need for a mutable object, this should become a const QObject pointer QString nameForObject(QObject *) const; |