头: | #include <QPropertyBindingError> |
CMake: |
find_package(Qt6 COMPONENTS Core REQUIRED)
target_link_libraries(mytarget PRIVATE Qt6::Core) |
qmake: | QT += core |
Since: | Qt 6.0 |
enum | Type { NoError, BindingLoop, EvaluationError, UnknownError } |
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 |
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();
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. |
Move-constructs QPropertyBindingError from other . other will be left in its default state.
Copy-constructs QPropertyBindingError from other .
Constructs a QPropertyBindingError of type type with description as its description.
Default constructs QPropertyBindingError. hasError() will return false, type will return
NoError
and
description
() will return an empty string.
移动赋值 other 到此 QPropertyBindingError . other will be left in its default state.
拷贝 other 到此 QPropertyBindingError .
Returns a descriptive error message for the QPropertyBindingError if it has been set.
Returns the type of the QPropertyBindingError .
另请参阅 QPropertyBindingError::Type .