头: | #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();
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. |
Default constructs QPropertyBindingError. hasError() will return false, type will return
NoError
and
description
() will return an empty string.
Constructs a QPropertyBindingError of type type with description as its description.
Copy-constructs QPropertyBindingError from other .
Move-constructs QPropertyBindingError from other . other will be left in its default state.
[noexcept]
QPropertyBindingError::
~QPropertyBindingError
()
Returns a descriptive error message for the QPropertyBindingError if it has been set.
Returns the type of the QPropertyBindingError .
另请参阅 QPropertyBindingError::Type .
拷贝 other 到此 QPropertyBindingError .
移动赋值 other 到此 QPropertyBindingError . other will be left in its default state.