Qt 4.8
|
The QFileOpenEvent class provides an event that will be sent when there is a request to open a file or a URL. More...
#include <qevent.h>
Public Functions | |
QString | file () const |
Returns the file that is being opened. More... | |
bool | openFile (QFile &file, QIODevice::OpenMode flags) const |
Opens a QFile on the file referenced by this event in the mode specified by flags. More... | |
QFileOpenEvent (const QString &file) | |
Constructs a file open event for the given file. More... | |
QFileOpenEvent (const QUrl &url) | |
Constructs a file open event for the given url. More... | |
QUrl | url () const |
Returns the url that is being opened. More... | |
~QFileOpenEvent () | |
Public Functions inherited from QEvent | |
void | accept () |
Sets the accept flag of the event object, the equivalent of calling setAccepted(true). More... | |
void | ignore () |
Clears the accept flag parameter of the event object, the equivalent of calling setAccepted(false). More... | |
bool | isAccepted () const |
QEvent (Type type) | |
Contructs an event object of type type. More... | |
void | setAccepted (bool accepted) |
bool | spontaneous () const |
Returns true if the event originated outside the application (a system event); otherwise returns false. More... | |
Type | type () const |
Returns the event type. More... | |
virtual | ~QEvent () |
Destroys the event. More... | |
Properties | |
QString | f |
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 Mac OS X.
This event is only used to notify the application of a request. It may be safely ignored.
QFileOpenEvent::QFileOpenEvent | ( | const QString & | file | ) |
Constructs a file open event for the given file.
Definition at line 3458 of file qevent.cpp.
Referenced by QFileOpenEvent().
QFileOpenEvent::QFileOpenEvent | ( | const QUrl & | url | ) |
Constructs a file open event for the given url.
Definition at line 3472 of file qevent.cpp.
QFileOpenEvent::~QFileOpenEvent | ( | ) |
Definition at line 3497 of file qevent.cpp.
|
inline |
bool QFileOpenEvent::openFile | ( | QFile & | file, |
QIODevice::OpenMode | 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. For example, if this QFileOpenEvent contains a request to open a Symbian data caged file, the QFile could only be opened from the Symbian RFile used in the construction of this event.
Definition at line 3542 of file qevent.cpp.
QUrl QFileOpenEvent::url | ( | ) | const |
Returns the url that is being opened.
Definition at line 3521 of file qevent.cpp.
|
private |
Definition at line 658 of file qevent.h.
Referenced by openFile(), and QFileOpenEvent().