Sur cette page

QPropertyBindingError Class

En-tête : #include <QPropertyBindingError>
CMake : find_package(Qt6 REQUIRED COMPONENTS Core)
target_link_libraries(mytarget PRIVATE Qt6::Core)
qmake : QT += core
Depuis : Qt 6.0

Types publics

enum Type { NoError, BindingLoop, EvaluationError, UnknownError }

Fonctions publiques

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)

Description détaillée

QPropertyBindingError est utilisé par le système de propriétés pour signaler les erreurs survenues lors de l'évaluation d'un lien. Utilisez type() pour déterminer quelle erreur s'est produite, et description() pour extraire un message d'erreur pouvant contenir davantage de détails. S'il n'y a pas d'erreur, QPropertyBindingError est de type QPropertyBindingError::NoError et hasError() renvoie false.

extern QProperty<int> prop;

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

Documentation sur les types de membres

enum QPropertyBindingError::Type

Cette énumération précise la nature de l'erreur survenue.

ConstanteValeurDescription
QPropertyBindingError::NoError0Aucune erreur ne s'est produite lors de l'évaluation de la liaison.
QPropertyBindingError::BindingLoop1L'évaluation de la liaison a été interrompue car une propriété dépendait de sa propre valeur.
QPropertyBindingError::EvaluationError2L'évaluation de la liaison a été interrompue pour une raison autre qu'une boucle de liaison. Par exemple, cette valeur est utilisée dans le moteur QML lorsqu'une exception se produit pendant l'évaluation d'une liaison.
QPropertyBindingError::UnknownError3Type d’erreur générique utilisé lorsque aucune des autres valeurs ne convient. L’appel de la méthode description() peut fournir des détails.

Documentation des fonctions membres

QPropertyBindingError::QPropertyBindingError()

Les constructeurs par défaut de `QPropertyBindingError` : la méthode `hasError()` renverra `false`, la méthode `type()` renverra ` NoError ` et la méthode ` description()` renverra une chaîne vide.

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

Crée un objet `QPropertyBindingError` de type ` type `, dont la description est « description ».

QPropertyBindingError::QPropertyBindingError(const QPropertyBindingError &other)

Copie la classe `QPropertyBindingError` à partir de other.

QPropertyBindingError::QPropertyBindingError(QPropertyBindingError &&other)

Déplacer la construction `QPropertyBindingError` depuis other. other restera dans son état par défaut.

[noexcept] QPropertyBindingError::~QPropertyBindingError()

Supprime l'QPropertyBindingError.

QString QPropertyBindingError::description() const

Renvoie un message d'erreur descriptif pour l'QPropertyBindingError, si celle-ci a été définie.

QPropertyBindingError::Type QPropertyBindingError::type() const

Renvoie le type de l'QPropertyBindingError.

Voir aussi QPropertyBindingError::Type.

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

L'opération « Move » attribue other à cette adresse QPropertyBindingError. other conservera son état par défaut.

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

Copie l'other ion vers cette adresse : 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.