[−][src]Struct qt_qml::QQmlError
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
.
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
.
Returns the error column number.
See also setColumn().
pub unsafe fn copy_from(
&self,
arg1: impl CastInto<Ref<QQmlError>>
) -> Ref<QQmlError>
[src]
&self,
arg1: impl CastInto<Ref<QQmlError>>
) -> Ref<QQmlError>
Assigns other to this error object.
Calls C++ function: QQmlError& QQmlError::operator=(const QQmlError& arg1)
.
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
.
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
.
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
.
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
.
pub unsafe fn new() -> CppBox<QQmlError>
[src]
Creates an empty error object.
Calls C++ function: [constructor] void QQmlError::QQmlError()
.
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)
.
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
.
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)
.
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)
.
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)
.
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)
.
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)
.
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)
.
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
.
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
.
Returns the url for the file that caused this error.
See also setUrl().
Trait Implementations
impl CppDeletable for QQmlError
[src]
Auto Trait Implementations
impl RefUnwindSafe for QQmlError
impl Send for QQmlError
impl Sync for QQmlError
impl Unpin for QQmlError
impl UnwindSafe for QQmlError
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> CastInto<U> for T where
U: CastFrom<T>,
[src]
U: CastFrom<T>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> StaticUpcast<T> for T
[src]
unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,