Struct qt_gui::QFileOpenEvent
source · #[repr(C)]pub struct QFileOpenEvent { /* private fields */ }
Expand description
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
.
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.
Implementations§
source§impl QFileOpenEvent
impl QFileOpenEvent
sourcepub unsafe fn copy_from(
&self,
other: impl CastInto<Ref<QFileOpenEvent>>
) -> Ref<QFileOpenEvent>
pub unsafe fn copy_from( &self, other: impl CastInto<Ref<QFileOpenEvent>> ) -> Ref<QFileOpenEvent>
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)
.
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.
sourcepub unsafe fn file(&self) -> CppBox<QString>
pub unsafe fn file(&self) -> CppBox<QString>
Returns the file that is being opened.
Calls C++ function: QString QFileOpenEvent::file() const
.
Returns the file that is being opened.
sourcepub unsafe fn from_q_string(
file: impl CastInto<Ref<QString>>
) -> CppBox<QFileOpenEvent>
pub unsafe fn from_q_string( file: impl CastInto<Ref<QString>> ) -> CppBox<QFileOpenEvent>
Calls C++ function: [constructor] void QFileOpenEvent::QFileOpenEvent(const QString& file)
.
sourcepub unsafe fn from_q_url(
url: impl CastInto<Ref<QUrl>>
) -> CppBox<QFileOpenEvent>
pub unsafe fn from_q_url( url: impl CastInto<Ref<QUrl>> ) -> CppBox<QFileOpenEvent>
Calls C++ function: [constructor] void QFileOpenEvent::QFileOpenEvent(const QUrl& url)
.
sourcepub unsafe fn new_copy(
other: impl CastInto<Ref<QFileOpenEvent>>
) -> CppBox<QFileOpenEvent>
pub unsafe fn new_copy( other: impl CastInto<Ref<QFileOpenEvent>> ) -> CppBox<QFileOpenEvent>
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)
.
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.
sourcepub unsafe fn open_file(
&self,
file: impl CastInto<Ref<QFile>>,
flags: QFlags<OpenModeFlag>
) -> bool
pub unsafe fn open_file( &self, file: impl CastInto<Ref<QFile>>, flags: QFlags<OpenModeFlag> ) -> bool
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
.
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.
Methods from Deref<Target = QEvent>§
sourcepub unsafe fn accept(&self)
pub unsafe fn accept(&self)
Sets the accept flag of the event object, the equivalent of calling setAccepted(true).
Calls C++ function: void QEvent::accept()
.
Sets the accept flag of the event object, the equivalent of calling setAccepted(true).
Setting the accept parameter indicates that the event receiver wants the event. Unwanted events might be propagated to the parent widget.
See also ignore().
sourcepub unsafe fn copy_from(&self, other: impl CastInto<Ref<QEvent>>) -> Ref<QEvent>
pub unsafe fn copy_from(&self, other: impl CastInto<Ref<QEvent>>) -> Ref<QEvent>
Calls C++ function: QEvent& QEvent::operator=(const QEvent& other)
.
sourcepub unsafe fn ignore(&self)
pub unsafe fn ignore(&self)
Clears the accept flag parameter of the event object, the equivalent of calling setAccepted(false).
Calls C++ function: void QEvent::ignore()
.
Clears the accept flag parameter of the event object, the equivalent of calling setAccepted(false).
Clearing the accept parameter indicates that the event receiver does not want the event. Unwanted events might be propagated to the parent widget.
See also accept().
sourcepub unsafe fn is_accepted(&self) -> bool
pub unsafe fn is_accepted(&self) -> bool
the accept flag of the event object
Calls C++ function: bool QEvent::isAccepted() const
.
the accept flag of the event object
Setting the accept parameter indicates that the event receiver wants the event. Unwanted events might be propagated to the parent widget. By default, isAccepted() is set to true, but don't rely on this as subclasses may choose to clear it in their constructor.
For convenience, the accept flag can also be set with accept(), and cleared with ignore().
Access functions:
bool | isAccepted() const |
void | setAccepted(bool accepted) |
sourcepub unsafe fn set_accepted(&self, accepted: bool)
pub unsafe fn set_accepted(&self, accepted: bool)
the accept flag of the event object
Calls C++ function: void QEvent::setAccepted(bool accepted)
.
the accept flag of the event object
Setting the accept parameter indicates that the event receiver wants the event. Unwanted events might be propagated to the parent widget. By default, isAccepted() is set to true, but don't rely on this as subclasses may choose to clear it in their constructor.
For convenience, the accept flag can also be set with accept(), and cleared with ignore().
Access functions:
bool | isAccepted() const |
void | setAccepted(bool accepted) |
sourcepub unsafe fn spontaneous(&self) -> bool
pub unsafe fn spontaneous(&self) -> bool
Returns true
if the event originated outside the application (a system event); otherwise returns false
.
Calls C++ function: bool QEvent::spontaneous() const
.
Returns true
if the event originated outside the application (a system event); otherwise returns false
.
The return value of this function is not defined for paint events.
Trait Implementations§
source§impl CppDeletable for QFileOpenEvent
impl CppDeletable for QFileOpenEvent
source§impl Deref for QFileOpenEvent
impl Deref for QFileOpenEvent
source§impl DynamicCast<QFileOpenEvent> for QEvent
impl DynamicCast<QFileOpenEvent> for QEvent
source§unsafe fn dynamic_cast(ptr: Ptr<QEvent>) -> Ptr<QFileOpenEvent>
unsafe fn dynamic_cast(ptr: Ptr<QEvent>) -> Ptr<QFileOpenEvent>
Calls C++ function: QFileOpenEvent* dynamic_cast<QFileOpenEvent*>(QEvent* ptr)
.
source§impl StaticDowncast<QFileOpenEvent> for QEvent
impl StaticDowncast<QFileOpenEvent> for QEvent
source§unsafe fn static_downcast(ptr: Ptr<QEvent>) -> Ptr<QFileOpenEvent>
unsafe fn static_downcast(ptr: Ptr<QEvent>) -> Ptr<QFileOpenEvent>
Calls C++ function: QFileOpenEvent* static_cast<QFileOpenEvent*>(QEvent* ptr)
.
source§impl StaticUpcast<QEvent> for QFileOpenEvent
impl StaticUpcast<QEvent> for QFileOpenEvent
source§unsafe fn static_upcast(ptr: Ptr<QFileOpenEvent>) -> Ptr<QEvent>
unsafe fn static_upcast(ptr: Ptr<QFileOpenEvent>) -> Ptr<QEvent>
Calls C++ function: QEvent* static_cast<QEvent*>(QFileOpenEvent* ptr)
.