diff options
author | Lars Knoll <lars.knoll@qt.io> | 2020-07-07 21:34:57 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2020-07-10 15:07:02 +0200 |
commit | 0d1208f0f08727c55de9eed8e0ceef092080b927 (patch) | |
tree | 2aa935c4c8917320f84fceb43af1716c72e26329 /src/corelib/kernel/qproperty.cpp | |
parent | 4e400369c08db251cd489fec1229398c224d02b4 (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.cpp')
-rw-r--r-- | src/corelib/kernel/qproperty.cpp | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/src/corelib/kernel/qproperty.cpp b/src/corelib/kernel/qproperty.cpp index beba05c01e..92c9afc6d8 100644 --- a/src/corelib/kernel/qproperty.cpp +++ b/src/corelib/kernel/qproperty.cpp @@ -384,11 +384,16 @@ void QPropertyObserverPointer::observeProperty(QPropertyBasePointer property) property.addObserver(ptr); } -QPropertyBindingError::QPropertyBindingError(Type type) +QPropertyBindingError::QPropertyBindingError() +{ +} + +QPropertyBindingError::QPropertyBindingError(Type type, const QString &description) { if (type != NoError) { d = new QPropertyBindingErrorPrivate; d->type = type; + d->description = description; } } @@ -425,13 +430,6 @@ QPropertyBindingError::Type QPropertyBindingError::type() const return d->type; } -void QPropertyBindingError::setDescription(const QString &description) -{ - if (!d) - d = new QPropertyBindingErrorPrivate; - d->description = description; -} - QString QPropertyBindingError::description() const { if (!d) @@ -439,13 +437,6 @@ QString QPropertyBindingError::description() const return d->description; } -QPropertyBindingSourceLocation QPropertyBindingError::location() const -{ - if (!d) - return QPropertyBindingSourceLocation(); - return d->location; -} - /*! \class QProperty \inmodule QtCore |