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
qbindingstorage.h
Go to the documentation of this file.
1// Copyright (C) 2021 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 QBINDINGSTORAGE_H
5#define QBINDINGSTORAGE_H
6
7#include <QtCore/qglobal.h>
8#include <QtCore/qnamespace.h>
9
11
12template <typename Class, typename T, auto Offset, auto Setter, auto Signal, auto Getter>
16
17namespace QtPrivate {
18
19class QPropertyBindingData;
20struct BindingEvaluationState;
21struct CompatPropertySafePoint;
22}
23
31
32namespace QtPrivate {
33struct QBindingStatusAccessToken;
34Q_AUTOTEST_EXPORT QBindingStatus *getBindingStatus(QBindingStatusAccessToken);
35}
36
37
39class Q_CORE_EXPORT QBindingStorage
40{
41 mutable QBindingStorageData *d = nullptr;
43
44 template<typename Class, typename T, auto Offset, auto Setter, auto Signal, auto Getter>
46 friend class QObjectPrivate;
48public:
51
52 bool isEmpty() { return !d; }
53 bool isValid() const noexcept { return bindingStatus; }
54
56
58 {
59 if (!bindingStatus || !bindingStatus->currentlyEvaluatingBinding)
60 return;
61 registerDependency_helper(data);
62 }
64 {
65 if (!d)
66 return nullptr;
67 return bindingData_helper(data);
68 }
69
70#if QT_CORE_REMOVED_SINCE(6, 2)
71 void maybeUpdateBindingAndRegister(const QUntypedPropertyData *data) const { registerDependency(data); }
72#endif
73
75 {
76 if (!d && !create)
77 return nullptr;
78 return bindingData_helper(data, create);
79 }
80private:
81 void reinitAfterThreadMove();
82 void clear();
83 void registerDependency_helper(const QUntypedPropertyData *data) const;
84#if QT_CORE_REMOVED_SINCE(6, 2)
85 // ### Unused, but keep for BC
86 void maybeUpdateBindingAndRegister_helper(const QUntypedPropertyData *data) const;
87#endif
88 QtPrivate::QPropertyBindingData *bindingData_helper(const QUntypedPropertyData *data) const;
90};
91
93
94#endif // QBINDINGSTORAGE_H
bool isValid() const noexcept
void registerDependency(const QUntypedPropertyData *data) const
QtPrivate::QPropertyBindingData * bindingData(const QUntypedPropertyData *data) const
QtPrivate::QPropertyBindingData * bindingData(QUntypedPropertyData *data, bool create)
\macro Q_OBJECT_BINDABLE_PROPERTY(containingClass, type, name, signal)
b clear()
Combined button and popup list for selecting options.
\macro QT_NO_KEYWORDS >
Q_AUTOTEST_EXPORT QBindingStatus * getBindingStatus(QBindingStatusAccessToken)
void * HANDLE
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
static Q_CONSTINIT thread_local QBindingStatus bindingStatus
#define Q_AUTOTEST_EXPORT
view create()
Qt::HANDLE threadId
QtPrivate::CompatPropertySafePoint * currentCompatProperty
QPropertyDelayedNotifications * groupUpdateData
QtPrivate::BindingEvaluationState * currentlyEvaluatingBinding