Nesta página

QPropertyBindingError Class

Cabeçalho: #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 }

Funções 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)

Descrição detalhada

QPropertyBindingError é usado pelo sistema de propriedades para relatar erros que ocorreram durante a avaliação de uma ligação. Use type() para consultar qual erro ocorreu e description() para extrair uma mensagem de erro que pode conter mais detalhes. Se não houver erro, QPropertyBindingError terá o tipo QPropertyBindingError::NoError e hasError() retornará false.

extern QProperty<int> prop;

QPropertyBindingError error = prop.binding().error();
if (error.hasError())
     qDebug() << error.description();

Documentação sobre tipos de membros

enum QPropertyBindingError::Type

Esta enumeração especifica qual erro ocorreu.

ConstanteValorDescrição
QPropertyBindingError::NoError0Não ocorreu nenhum erro durante a avaliação da ligação.
QPropertyBindingError::BindingLoop1A avaliação da ligação foi interrompida porque uma propriedade dependia de seu próprio valor.
QPropertyBindingError::EvaluationError2A avaliação da ligação foi interrompida por qualquer outro motivo que não seja um ciclo de ligação. Por exemplo, esse valor é usado no mecanismo QML quando ocorre uma exceção durante a avaliação de uma ligação.
QPropertyBindingError::UnknownError3Um tipo de erro genérico usado quando nenhum dos outros valores é adequado. Chamar ` description()` pode fornecer detalhes.

Documentação da função de membro

QPropertyBindingError::QPropertyBindingError()

Em construções padrão, o método `hasError()` de `QPropertyBindingError` retornará `false`, o método `type` retornará ` NoError ` e o método ` description()` retornará uma string vazia.

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

Cria um objeto `QPropertyBindingError` do tipo ` type `, com a descrição ` description `.

QPropertyBindingError::QPropertyBindingError(const QPropertyBindingError &other)

Cria uma instância de `QPropertyBindingError` a partir de ` other`.

QPropertyBindingError::QPropertyBindingError(QPropertyBindingError &&other)

Mover a construção `QPropertyBindingError` de other. other permanecerá em seu estado padrão.

[noexcept] QPropertyBindingError::~QPropertyBindingError()

Destrói o “ QPropertyBindingError ”.

QString QPropertyBindingError::description() const

Retorna uma mensagem de erro descritiva para o ` QPropertyBindingError `, caso ele tenha sido definido.

QPropertyBindingError::Type QPropertyBindingError::type() const

Retorna o tipo do ` QPropertyBindingError`.

Veja também QPropertyBindingError::Type.

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

A operação move-assigns atribui other a este QPropertyBindingError. other permanecerá em seu estado padrão.

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

Copia other para este endereço 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.