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

QQmlError Class

The https:// class encapsulates a QML error.

This class was introduced in Qt 5.0.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

QQmlError Class▲

  • Header: QQmlError

  • Since: Qt 5.0

  • CMake:

    find_package(Qt6 REQUIRED COMPONENTS Qml)

    target_link_libraries(mytarget PRIVATE Qt6::Qml)

  • qmake: QT += qml

Detailed Description▲

https:// includes a textual description of the error, as well as location information (the file, line, and column). The https://() method creates a single-line, human-readable string containing all of this information, for example:

 
Sélectionnez
file:///home/user/test.qml:7:8: Invalid property assignment: double expected

You can use https://(), https://(), or https://() to output errors to the console. This method will attempt to open the file indicated by the error and include additional contextual information.

 
Sélectionnez
file:///home/user/test.qml:7:8: Invalid property assignment: double expected
        y: "hello"
           ^

See Also▲

See also QQuickView::errors(), https://()

Member Function Documentation▲

 

QQmlError::QQmlError()▲

Creates an empty error object.

QQmlError::QQmlError(const QQmlError &other)▲

Creates a copy of other.

int QQmlError::column() const▲

Returns the error column number.

See Also▲

See also https://()

QString QQmlError::description() const▲

Returns the error description.

See Also▲

See also https://()

bool QQmlError::isValid() const▲

Returns true if this error is valid, otherwise false.

int QQmlError::line() const▲

Returns the error line number.

See Also▲

See also https://()

[since 5.9] QtMsgType QQmlError::messageType() const▲

Returns the message type.

This function was introduced in Qt 5.9.

See Also▲

See also https://()

QObject *QQmlError::object() const▲

Returns the nearest object where this error occurred. Exceptions in bound property expressions set this to the object to which the property belongs. It will be 0 for all other exceptions.

See Also▲

See also https://()

void QQmlError::setColumn(int column)▲

Sets the error column number.

See Also▲

See also https://()

void QQmlError::setDescription(const QString &description)▲

Sets the error description.

See Also▲

See also https://()

void QQmlError::setLine(int line)▲

Sets the error line number.

See Also▲

See also https://()

[since 5.9] void QQmlError::setMessageType(QtMsgType messageType)▲

Sets the messageType for this message. The message type determines which https:// handlers are responsible for receiving the message.

This function was introduced in Qt 5.9.

See Also▲

See also https://()

void QQmlError::setObject(QObject *object)▲

Sets the nearest object where this error occurred.

See Also▲

See also https://()

void QQmlError::setUrl(const QUrl &url)▲

Sets the url for the file that caused this error.

See Also▲

See also https://()

QString QQmlError::toString() const▲

Returns the error as a human readable string.

QUrl QQmlError::url() const▲

Returns the url for the file that caused this error.

See Also▲

See also https://()

QQmlError &QQmlError::operator=(const QQmlError &other)▲

Assigns other to this error object.

Related Non-Members▲

 

QDebug operator<<(QDebug debug, const QQmlError &error)▲

Outputs a human readable version of error to debug.

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

Ce document est disponible sous la licence https:// telle que publiée par la Free Software Foundation.