IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

QPropertyBindingError Class

This class was introduced in Qt 6.0.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

QPropertyBindingError Class

  • Header: QPropertyBindingError

  • Since: Qt 6.0

  • CMake:

    find_package(Qt6 REQUIRED COMPONENTS Core)

    target_link_libraries(mytarget PRIVATE Qt6::Core)

  • qmake: QT += core

  • Group: QPropertyBindingError is part of tools

Detailed Description

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.

 
Sélectionnez
extern QProperty<int> prop;

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

Member Type Documentation

 

enum QPropertyBindingError::Type

This enum specifies which error occurred.

Constant

Value

Description

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.

Member Function Documentation

 

QPropertyBindingError::QPropertyBindingError()

Default constructs QPropertyBindingError. hasError() will return false, type will return NoError and description() will return an empty string.

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

Constructs a QPropertyBindingError of type type with description as its description.

QPropertyBindingError::QPropertyBindingError(const QPropertyBindingError &other)

Copy-constructs QPropertyBindingError from other.

QPropertyBindingError::QPropertyBindingError(QPropertyBindingError &&other)

Move-constructs QPropertyBindingError from other. other will be left in its default state.

QPropertyBindingError::~QPropertyBindingError()

Destroys the QPropertyBindingError.

QString QPropertyBindingError::description() const

Returns a descriptive error message for the QPropertyBindingError if it has been set.

QPropertyBindingError::Type QPropertyBindingError::type() const

Returns the type of the QPropertyBindingError.

See Also

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

Copies other to this QPropertyBindingError.

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

Move-assigns other to this QPropertyBindingError. other will be left in its default state.

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+