QPropertyBindingError Class
| Encabezado: | #include <QPropertyBindingError> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Core) target_link_libraries(mytarget PRIVATE Qt6::Core) |
| qmake: | QT += core |
| Desde: | Qt 6.0 |
Tipos públicos
| enum | Type { NoError, BindingLoop, EvaluationError, UnknownError } |
Funciones públicas
| 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=(QPropertyBindingError &&other) |
| QPropertyBindingError & | operator=(const QPropertyBindingError &other) |
Descripción detallada
El sistema de propiedades utiliza `QPropertyBindingError` para informar de los errores que se han producido al evaluar un enlace. Utiliza ` type()` para consultar qué error se ha producido y ` description()` para extraer un mensaje de error que puede contener más detalles. Si no hay ningún error, `QPropertyBindingError` tiene el tipo ` QPropertyBindingError::NoError ` y ` hasError() ` devuelve «false».
extern QProperty<int> prop;
QPropertyBindingError error = prop.binding().error();
if (error.hasError())
qDebug() << error.description();Documentación sobre los tipos de miembros
enum QPropertyBindingError::Type
Esta enumeración especifica qué error se ha producido.
| Constante | Valor | Descripción |
|---|---|---|
QPropertyBindingError::NoError | 0 | No se produjo ningún error al evaluar el enlace. |
QPropertyBindingError::BindingLoop | 1 | La evaluación del enlace se detuvo porque una propiedad dependía de su propio valor. |
QPropertyBindingError::EvaluationError | 2 | La evaluación del enlace se detuvo por cualquier motivo distinto a un bucle de enlace. Por ejemplo, este valor se utiliza en el motor QML cuando se produce una excepción durante la evaluación de un enlace. |
QPropertyBindingError::UnknownError | 3 | Un tipo de error genérico que se utiliza cuando ninguno de los otros valores es adecuado. Llamar a description() podría proporcionar más detalles. |
Documentación de la función miembro
QPropertyBindingError::QPropertyBindingError()
En las construcciones predeterminadas de `QPropertyBindingError`, `hasError()` devolverá «false», `type` devolverá « NoError » y ` description()` devolverá una cadena vacía.
QPropertyBindingError::QPropertyBindingError(QPropertyBindingError::Type type, const QString &description = QString())
Crea un objeto `QPropertyBindingError` de tipo ` type ` con ` description ` como descripción.
QPropertyBindingError::QPropertyBindingError(const QPropertyBindingError &other)
Crea una instancia de `QPropertyBindingError` a partir de other.
QPropertyBindingError::QPropertyBindingError(QPropertyBindingError &&other)
Traslada la clase `QPropertyBindingError` desde ` other`. La clase ` other ` se mantendrá en su estado por defecto.
[noexcept] QPropertyBindingError::~QPropertyBindingError()
Destruye el « QPropertyBindingError ».
QString QPropertyBindingError::description() const
Devuelve un mensaje de error descriptivo para el ` QPropertyBindingError `, si se ha establecido.
QPropertyBindingError::Type QPropertyBindingError::type() const
Devuelve el tipo de « QPropertyBindingError ».
Véase también QPropertyBindingError::Type.
QPropertyBindingError &QPropertyBindingError::operator=(QPropertyBindingError &&other)
La operación «Move» asigna other a este QPropertyBindingError. other se mantendrá en su estado predeterminado.
QPropertyBindingError &QPropertyBindingError::operator=(const QPropertyBindingError &other)
Copia other a esta dirección QPropertyBindingError.
© 2026 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.