aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/PySide6/qpyqmlpropertyvaluesource.h
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2022-02-28 10:33:36 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2022-02-28 16:27:50 +0100
commitf017d4abe8199e203a5e625738d312932804601d (patch)
tree51932b873bbc7577a1ae7803076c3ada43842f50 /sources/pyside6/PySide6/qpyqmlpropertyvaluesource.h
parent9ef3c0041c489bd9f939c45a571026c3e2227685 (diff)
Implement QQmlPropertyValueSource
As is done with the other interfaces, add a class QPyQmlPropertyValueSource inheriting from QObject and QQmlPropertyValueSource. Store its offset in QQmlPrivate::RegisterType::valueSourceCast if it is found as a base class. [ChangeLog][PySide6] class QPyQmlPropertyValueSource for implementing QML value sources for properties has been added. Task-number: PYSIDE-1709 Change-Id: Icd1bd57972f339f9839ccd8d9bf6ff9e5e16ec62 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/pyside6/PySide6/qpyqmlpropertyvaluesource.h')
-rw-r--r--sources/pyside6/PySide6/qpyqmlpropertyvaluesource.h59
1 files changed, 59 insertions, 0 deletions
diff --git a/sources/pyside6/PySide6/qpyqmlpropertyvaluesource.h b/sources/pyside6/PySide6/qpyqmlpropertyvaluesource.h
new file mode 100644
index 000000000..2d049f1ee
--- /dev/null
+++ b/sources/pyside6/PySide6/qpyqmlpropertyvaluesource.h
@@ -0,0 +1,59 @@
+/****************************************************************************
+**
+** Copyright (C) 2022 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt for Python.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QPYQMLPROPERTYVALUESOURCE_H
+#define QPYQMLPROPERTYVALUESOURCE_H
+
+#include <QtQml/QQmlPropertyValueSource>
+
+#ifdef Q_MOC_RUN
+Q_DECLARE_INTERFACE(QQmlPropertyValueSource, "org.qt-project.Qt.QQmlPropertyValueSource")
+#endif
+
+// Inherit from QObject such that QQmlPropertyValueSource can be found at
+// a fixed offset (RegisterType::valueSourceCast).
+class QPyQmlPropertyValueSource : public QObject, public QQmlPropertyValueSource
+{
+ Q_OBJECT
+ Q_INTERFACES(QQmlPropertyValueSource)
+public:
+ explicit QPyQmlPropertyValueSource(QObject *parent = nullptr) : QObject(parent) {}
+};
+
+#endif // QPYQMLPROPERTYVALUESOURCE_H