[][src]Struct qt_qml::QQmlError

#[repr(C)]pub struct QQmlError { /* fields omitted */ }

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

C++ class: QQmlError.

C++ documentation:

QQmlError includes a textual description of the error, as well as location information (the file, line, and column). The toString() 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 use qDebug(), qInfo(), or qWarning() 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" ^

Methods

impl QQmlError[src]

pub unsafe fn column(&self) -> c_int[src]

Returns the error column number.

Calls C++ function: int QQmlError::column() const.

C++ documentation:

Returns the error column number.

See also setColumn().

pub unsafe fn copy_from(
    &self,
    arg1: impl CastInto<Ref<QQmlError>>
) -> Ref<QQmlError>
[src]

Assigns other to this error object.

Calls C++ function: QQmlError& QQmlError::operator=(const QQmlError& arg1).

C++ documentation:

Assigns other to this error object.

pub unsafe fn description(&self) -> CppBox<QString>[src]

Returns the error description.

Calls C++ function: QString QQmlError::description() const.

C++ documentation:

Returns the error description.

See also setDescription().

pub unsafe fn is_valid(&self) -> bool[src]

Returns true if this error is valid, otherwise false.

Calls C++ function: bool QQmlError::isValid() const.

C++ documentation:

Returns true if this error is valid, otherwise false.

pub unsafe fn line(&self) -> c_int[src]

Returns the error line number.

Calls C++ function: int QQmlError::line() const.

C++ documentation:

Returns the error line number.

See also setLine().

pub unsafe fn message_type(&self) -> QtMsgType[src]

Returns the message type.

Calls C++ function: QtMsgType QQmlError::messageType() const.

C++ documentation:

Returns the message type.

This function was introduced in Qt 5.9.

See also setMessageType().

pub unsafe fn new() -> CppBox<QQmlError>[src]

Creates an empty error object.

Calls C++ function: [constructor] void QQmlError::QQmlError().

C++ documentation:

Creates an empty error object.

pub unsafe fn new_copy(arg1: impl CastInto<Ref<QQmlError>>) -> CppBox<QQmlError>[src]

Creates a copy of other.

Calls C++ function: [constructor] void QQmlError::QQmlError(const QQmlError& arg1).

C++ documentation:

Creates a copy of other.

pub unsafe fn object(&self) -> QPtr<QObject>[src]

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.

Calls C++ function: QObject* QQmlError::object() const.

C++ documentation:

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 setObject().

pub unsafe fn set_column(&self, arg1: c_int)[src]

Sets the error column number.

Calls C++ function: void QQmlError::setColumn(int arg1).

C++ documentation:

Sets the error column number.

See also column().

pub unsafe fn set_description(&self, arg1: impl CastInto<Ref<QString>>)[src]

Sets the error description.

Calls C++ function: void QQmlError::setDescription(const QString& arg1).

C++ documentation:

Sets the error description.

See also description().

pub unsafe fn set_line(&self, arg1: c_int)[src]

Sets the error line number.

Calls C++ function: void QQmlError::setLine(int arg1).

C++ documentation:

Sets the error line number.

See also line().

pub unsafe fn set_message_type(&self, message_type: QtMsgType)[src]

Sets the messageType for this message. The message type determines which QDebug handlers are responsible for receiving the message.

Calls C++ function: void QQmlError::setMessageType(QtMsgType messageType).

C++ documentation:

Sets the messageType for this message. The message type determines which QDebug handlers are responsible for receiving the message.

This function was introduced in Qt 5.9.

See also messageType().

pub unsafe fn set_object(&self, arg1: impl CastInto<Ptr<QObject>>)[src]

Sets the nearest object where this error occurred.

Calls C++ function: void QQmlError::setObject(QObject* arg1).

C++ documentation:

Sets the nearest object where this error occurred.

See also object().

pub unsafe fn set_url(&self, arg1: impl CastInto<Ref<QUrl>>)[src]

Sets the url for the file that caused this error.

Calls C++ function: void QQmlError::setUrl(const QUrl& arg1).

C++ documentation:

Sets the url for the file that caused this error.

See also url().

pub unsafe fn to_string(&self) -> CppBox<QString>[src]

Returns the error as a human readable string.

Calls C++ function: QString QQmlError::toString() const.

C++ documentation:

Returns the error as a human readable string.

pub unsafe fn url(&self) -> CppBox<QUrl>[src]

Returns the url for the file that caused this error.

Calls C++ function: QUrl QQmlError::url() const.

C++ documentation:

Returns the url for the file that caused this error.

See also setUrl().

Trait Implementations

impl CppDeletable for QQmlError[src]

unsafe fn delete(&self)[src]

Calls C++ function: [destructor] void QQmlError::~QQmlError().

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> CastInto<U> for T where
    U: CastFrom<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> StaticUpcast<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.