summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qproperty.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2020-07-07 21:34:57 +0200
committerLars Knoll <lars.knoll@qt.io>2020-07-10 15:07:02 +0200
commit0d1208f0f08727c55de9eed8e0ceef092080b927 (patch)
tree2aa935c4c8917320f84fceb43af1716c72e26329 /src/corelib/kernel/qproperty.h
parent4e400369c08db251cd489fec1229398c224d02b4 (diff)
Cleanup QPropertyBindingError
Remove location(). The method would always return an empty value. If you need the location, the binding itself has it. Remove setDescription() and require that the description gets passed in the constructor. Never create a d pointer if type is NoError, so we can quickly check for it inline. Change-Id: I7eb8a94786281069d6ea2d82567c09aa50c52ef6 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/corelib/kernel/qproperty.h')
-rw-r--r--src/corelib/kernel/qproperty.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/corelib/kernel/qproperty.h b/src/corelib/kernel/qproperty.h
index 994eb24cea..986c6afbc9 100644
--- a/src/corelib/kernel/qproperty.h
+++ b/src/corelib/kernel/qproperty.h
@@ -99,17 +99,18 @@ public:
UnknownError
};
- QPropertyBindingError(Type type = NoError);
+ QPropertyBindingError();
+ QPropertyBindingError(Type type, const QString &description = QString());
+
QPropertyBindingError(const QPropertyBindingError &other);
QPropertyBindingError &operator=(const QPropertyBindingError &other);
QPropertyBindingError(QPropertyBindingError &&other);
QPropertyBindingError &operator=(QPropertyBindingError &&other);
~QPropertyBindingError();
+ bool hasError() const { return d.get() != nullptr; }
Type type() const;
- void setDescription(const QString &description);
QString description() const;
- QPropertyBindingSourceLocation location() const;
private:
QSharedDataPointer<QPropertyBindingErrorPrivate> d;