QPropertyBindingError Class
| Intestazione: | #include <QPropertyBindingError> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Core) target_link_libraries(mytarget PRIVATE Qt6::Core) |
| qmake: | QT += core |
| Da: | Qt 6.0 |
Tipi pubblici
| enum | Type { NoError, BindingLoop, EvaluationError, UnknownError } |
Funzioni pubbliche
| 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) |
Descrizione dettagliata
QPropertyBindingError viene utilizzato dal sistema delle proprietà per segnalare gli errori verificatisi durante la valutazione di un binding. Utilizzare type() per verificare quale errore si sia verificato e description() per estrarre un messaggio di errore che potrebbe contenere ulteriori dettagli. Se non si è verificato alcun errore, QPropertyBindingError ha tipo QPropertyBindingError::NoError e hasError() restituisce false.
extern QProperty<int> prop;
QPropertyBindingError error = prop.binding().error();
if (error.hasError())
qDebug() << error.description();Documentazione sui tipi di iscrizione
enum QPropertyBindingError::Type
Questa enumerazione specifica quale errore si è verificato.
| Costante | Valore | Descrizione |
|---|---|---|
QPropertyBindingError::NoError | 0 | Non si è verificato alcun errore durante la valutazione del binding. |
QPropertyBindingError::BindingLoop | 1 | La valutazione del binding è stata interrotta perché una proprietà dipendeva dal proprio valore. |
QPropertyBindingError::EvaluationError | 2 | La valutazione del binding è stata interrotta per un motivo diverso da un ciclo di binding. Ad esempio, questo valore viene utilizzato nel motore QML quando si verifica un'eccezione durante la valutazione di un binding. |
QPropertyBindingError::UnknownError | 3 | Un tipo di errore generico utilizzato quando nessuno degli altri valori è appropriato. La chiamata a ` description()` potrebbe fornire ulteriori dettagli. |
Documentazione delle funzioni membro
QPropertyBindingError::QPropertyBindingError()
Nei costrutti predefiniti, il metodo `hasError()` di `QPropertyBindingError` restituirà `false`, il metodo `type` restituirà ` NoError ` e il metodo ` description()` restituirà una stringa vuota.
QPropertyBindingError::QPropertyBindingError(QPropertyBindingError::Type type, const QString &description = QString())
Crea un oggetto `QPropertyBindingError` di tipo ` type ` con la descrizione ` description `.
QPropertyBindingError::QPropertyBindingError(const QPropertyBindingError &other)
Copia la classe QPropertyBindingError da other.
QPropertyBindingError::QPropertyBindingError(QPropertyBindingError &&other)
Sposta il costrutto `QPropertyBindingError` da ` other`. ` other ` rimarrà nel suo stato predefinito.
[noexcept] QPropertyBindingError::~QPropertyBindingError()
Distrugge l'QPropertyBindingError.
QString QPropertyBindingError::description() const
Restituisce un messaggio di errore descrittivo relativo all'QPropertyBindingError, se è stato impostato.
QPropertyBindingError::Type QPropertyBindingError::type() const
Restituisce il tipo dell'QPropertyBindingError.
Vedi anche QPropertyBindingError::Type.
QPropertyBindingError &QPropertyBindingError::operator=(QPropertyBindingError &&other)
L'operazione di spostamento-assegnazione assegna other a questo QPropertyBindingError. other rimarrà nel suo stato predefinito.
QPropertyBindingError &QPropertyBindingError::operator=(const QPropertyBindingError &other)
Copia il file other in questa cartella: 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.