QPropertyBindingError Class

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

公共类型

enum Type { NoError, BindingLoop, EvaluationError, UnknownError }

公共函数

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 )

详细描述

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();
					

成员类型文档编制

enum QPropertyBindingError:: Type

This enum specifies which error occurred.

常量 描述
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.

成员函数文档编制

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.

[noexcept] QPropertyBindingError:: ~QPropertyBindingError ()

销毁 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 .

另请参阅 QPropertyBindingError::Type .

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

拷贝 other 到此 QPropertyBindingError .

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

移动赋值 other 到此 QPropertyBindingError . other will be left in its default state.