[][src]Struct qt_gui::QFileOpenEvent

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

The QFileOpenEvent class provides an event that will be sent when there is a request to open a file or a URL.

C++ class: QFileOpenEvent.

C++ documentation:

The QFileOpenEvent class provides an event that will be sent when there is a request to open a file or a URL.

File open events will be sent to the QApplication::instance() when the operating system requests that a file or URL should be opened. This is a high-level event that can be caused by different user actions depending on the user's desktop environment; for example, double clicking on an file icon in the Finder on macOS.

This event is only used to notify the application of a request. It may be safely ignored.

Note: This class is currently supported for macOS only.

Methods

impl QFileOpenEvent[src]

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

The QFileOpenEvent class provides an event that will be sent when there is a request to open a file or a URL.

Calls C++ function: QFileOpenEvent& QFileOpenEvent::operator=(const QFileOpenEvent& other).

C++ documentation:

The QFileOpenEvent class provides an event that will be sent when there is a request to open a file or a URL.

File open events will be sent to the QApplication::instance() when the operating system requests that a file or URL should be opened. This is a high-level event that can be caused by different user actions depending on the user's desktop environment; for example, double clicking on an file icon in the Finder on macOS.

This event is only used to notify the application of a request. It may be safely ignored.

Note: This class is currently supported for macOS only.

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

Returns the file that is being opened.

Calls C++ function: QString QFileOpenEvent::file() const.

C++ documentation:

Returns the file that is being opened.

pub unsafe fn from_q_string(
    file: impl CastInto<Ref<QString>>
) -> CppBox<QFileOpenEvent>
[src]

Calls C++ function: [constructor] void QFileOpenEvent::QFileOpenEvent(const QString& file).

pub unsafe fn from_q_url(
    url: impl CastInto<Ref<QUrl>>
) -> CppBox<QFileOpenEvent>
[src]

Calls C++ function: [constructor] void QFileOpenEvent::QFileOpenEvent(const QUrl& url).

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

The QFileOpenEvent class provides an event that will be sent when there is a request to open a file or a URL.

Calls C++ function: [constructor] void QFileOpenEvent::QFileOpenEvent(const QFileOpenEvent& other).

C++ documentation:

The QFileOpenEvent class provides an event that will be sent when there is a request to open a file or a URL.

File open events will be sent to the QApplication::instance() when the operating system requests that a file or URL should be opened. This is a high-level event that can be caused by different user actions depending on the user's desktop environment; for example, double clicking on an file icon in the Finder on macOS.

This event is only used to notify the application of a request. It may be safely ignored.

Note: This class is currently supported for macOS only.

pub unsafe fn open_file(
    &self,
    file: impl CastInto<Ref<QFile>>,
    flags: QFlags<OpenModeFlag>
) -> bool
[src]

Opens a QFile on the file referenced by this event in the mode specified by flags. Returns true if successful; otherwise returns false.

Calls C++ function: bool QFileOpenEvent::openFile(QFile& file, QFlags<QIODevice::OpenModeFlag> flags) const.

C++ documentation:

Opens a QFile on the file referenced by this event in the mode specified by flags. Returns true if successful; otherwise returns false.

This is necessary as some files cannot be opened by name, but require specific information stored in this event.

This function was introduced in Qt 4.8.

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

Returns the url that is being opened.

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

C++ documentation:

Returns the url that is being opened.

This function was introduced in Qt 4.6.

Trait Implementations

impl CppDeletable for QFileOpenEvent[src]

unsafe fn delete(&self)[src]

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

impl Deref for QFileOpenEvent[src]

type Target = QEvent

The resulting type after dereferencing.

fn deref(&self) -> &QEvent[src]

Calls C++ function: QEvent* static_cast<QEvent*>(QFileOpenEvent* ptr).

impl DynamicCast<QFileOpenEvent> for QEvent[src]

unsafe fn dynamic_cast(ptr: Ptr<QEvent>) -> Ptr<QFileOpenEvent>[src]

Calls C++ function: QFileOpenEvent* dynamic_cast<QFileOpenEvent*>(QEvent* ptr).

impl StaticDowncast<QFileOpenEvent> for QEvent[src]

unsafe fn static_downcast(ptr: Ptr<QEvent>) -> Ptr<QFileOpenEvent>[src]

Calls C++ function: QFileOpenEvent* static_cast<QFileOpenEvent*>(QEvent* ptr).

impl StaticUpcast<QEvent> for QFileOpenEvent[src]

unsafe fn static_upcast(ptr: Ptr<QFileOpenEvent>) -> Ptr<QEvent>[src]

Calls C++ function: QEvent* static_cast<QEvent*>(QFileOpenEvent* ptr).

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.