Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

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 &&other)
QPropertyBindingError(const QPropertyBindingError &other)
QPropertyBindingError(QPropertyBindingError::Type type, const QString &description = QString())
QPropertyBindingError()
QPropertyBindingError & operator=(QPropertyBindingError &&other)
QPropertyBindingError & operator=(const QPropertyBindingError &other)
~QPropertyBindingError()
QString description() const
QPropertyBindingError::Type type() const

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.

Constant Value Description
QPropertyBindingError::NoError 0 No error occurred while evaluating the binding.
QPropertyBindingError::BindingLoop 1 Binding evaluation was stopped because a property depended on its own value.
QPropertyBindingError::EvaluationError 2 Binding 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::UnknownError 3 A generic error type used when neither of the other values is suitable. Calling description() might provide details.

Member Function Documentation

QPropertyBindingError::QPropertyBindingError(QPropertyBindingError &&other)

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

QPropertyBindingError::QPropertyBindingError(const QPropertyBindingError &other)

Copy-constructs QPropertyBindingError from other.

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

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

QPropertyBindingError::QPropertyBindingError()

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

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

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

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

Copies other to this QPropertyBindingError.

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.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded