QPropertyBindingError Class

Header: #include <QPropertyBindingError>
CMake: find_package(Qt6 REQUIRED COMPONENTS Core)
target_link_libraries(mytarget PRIVATE Qt6::Core)
qmake: QT += core
Since: Qt 6.0

Public Types

enum Type { NoError, BindingLoop, EvaluationError, UnknownError }

Public Functions

QPropertyBindingError()
QPropertyBindingError(QPropertyBindingError::Type type, const QString &description = QString())
QPropertyBindingError(const QPropertyBindingError &other)
QPropertyBindingError(QPropertyBindingError &&other)
~QPropertyBindingError()
QString description() const
QPropertyBindingError::Type type() const
QPropertyBindingError &operator=(const QPropertyBindingError &other)
QPropertyBindingError &operator=(QPropertyBindingError &&other)

Detailed Description

QPropertyBindingError is used by the property system to report errors that occurred when a binding was evaluated. Use type() to query which error occurred, and description() to extract an error message which might contain more details. If there is no error, QPropertyBindingError has type QPropertyBindingError::NoError and hasError() returns false.

extern QProperty<int> prop;

QPropertyBindingError error = prop.binding().error();
if (error.hasError())
     qDebug() << error.description();

Member Type Documentation

enum QPropertyBindingError::Type

This enum specifies which error occurred.

ConstantValueDescription
QPropertyBindingError::NoError0No error occurred while evaluating the binding.
QPropertyBindingError::BindingLoop1Binding evaluation was stopped because a property depended on its own value.
QPropertyBindingError::EvaluationError2Binding evaluation was stopped for any other reason than a binding loop. For example, this value is used in the QML engine when an exception occurs while a binding is evaluated.
QPropertyBindingError::UnknownError3A generic error type used when neither of the other values is suitable. Calling description() might provide details.

Member Function Documentation

QPropertyBindingError::QPropertyBindingError()

Default constructs QPropertyBindingError. hasError() will return false, type will return NoError and description() will return an empty string.

QPropertyBindingError::QPropertyBindingError(QPropertyBindingError::Type type, const QString &description = QString())

Constructs a QPropertyBindingError of type type with description as its description.

QPropertyBindingError::QPropertyBindingError(const QPropertyBindingError &other)

Copy-constructs QPropertyBindingError from other.

QPropertyBindingError::QPropertyBindingError(QPropertyBindingError &&other)

Move-constructs QPropertyBindingError from other. other will be left in its default state.

QPropertyBindingError::~QPropertyBindingError()

Destroys the QPropertyBindingError.

QString QPropertyBindingError::description() const

Returns a descriptive error message for the QPropertyBindingError if it has been set.

QPropertyBindingError::Type QPropertyBindingError::type() const

Returns the type of the QPropertyBindingError.

See also QPropertyBindingError::Type.

QPropertyBindingError &QPropertyBindingError::operator=(const QPropertyBindingError &other)

Copies other to this QPropertyBindingError.

QPropertyBindingError &QPropertyBindingError::operator=(QPropertyBindingError &&other)

Move-assigns other to this QPropertyBindingError. other will be left in its default state.

© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.