Movatterモバイル変換


[0]ホーム

URL:


We bake cookies in your browser for a better experience. Using this site means that you consent.Read More

Menu

Qt Documentation

QDeclarativeError Class

TheQDeclarativeError class encapsulates a QML error.More...

Header:#include <QDeclarativeError>
Since: Qt 4.7

Public Functions

QDeclarativeError()
QDeclarativeError(const QDeclarativeError & other)
intcolumn() const
QStringdescription() const
boolisValid() const
intline() const
voidsetColumn(int column)
voidsetDescription(const QString & description)
voidsetLine(int line)
voidsetUrl(const QUrl & url)
QStringtoString() const
QUrlurl() const
QDeclarativeError &operator=(const QDeclarativeError & other)

Related Non-Members

QDebugoperator<<(QDebug debug, const QDeclarativeError & error)

Detailed Description

TheQDeclarativeError class encapsulates a QML error.

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

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

You can useqDebug() orqWarning() to output errors to the console. This method will attempt to open the file indicated by the error and include additional contextual information.

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

See alsoQDeclarativeView::errors() andQDeclarativeComponent::errors().

Member Function Documentation

QDeclarativeError::QDeclarativeError()

Creates an empty error object.

QDeclarativeError::QDeclarativeError(constQDeclarativeError & other)

Creates a copy ofother.

int QDeclarativeError::column() const

Returns the error column number.

See alsosetColumn().

QString QDeclarativeError::description() const

Returns the error description.

See alsosetDescription().

bool QDeclarativeError::isValid() const

Returns true if this error is valid, otherwise false.

int QDeclarativeError::line() const

Returns the error line number.

See alsosetLine().

void QDeclarativeError::setColumn(int column)

Sets the errorcolumn number.

See alsocolumn().

void QDeclarativeError::setDescription(constQString & description)

Sets the errordescription.

See alsodescription().

void QDeclarativeError::setLine(int line)

Sets the errorline number.

See alsoline().

void QDeclarativeError::setUrl(constQUrl & url)

Sets theurl for the file that caused this error.

See alsourl().

QString QDeclarativeError::toString() const

Returns the error as a human readable string.

QUrl QDeclarativeError::url() const

Returns the url for the file that caused this error.

See alsosetUrl().

QDeclarativeError & QDeclarativeError::operator=(constQDeclarativeError & other)

Assignsother to this error object.

Related Non-Members

QDebugoperator<<(QDebug debug, constQDeclarativeError & error)

Outputs a human readable version oferror todebug.

© 2016 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 theGNU 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.


[8]ページ先頭

©2009-2025 Movatter.jp