CopperSpice API  1.9.1
QFileOpenEvent Class Reference

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

Inheritance diagram for QFileOpenEvent:
QEvent

Public Methods

QString file () const
 
bool openFile (QFile &file, QIODevice::OpenMode flags) const
 
QUrl url () const
 
- Public Methods inherited from QEvent
 QEvent (const QEvent &other)
 
 QEvent (Type type)
 
virtual ~QEvent ()
 
void accept ()
 
void ignore ()
 
bool isAccepted () const
 
QEvent & operator= (const QEvent &other)
 
void setAccepted (bool accepted)
 
bool spontaneous () const
 
Type type () const
 

Additional Inherited Members

- Public Types inherited from QEvent
enum  Type
 
- Static Public Methods inherited from QEvent
static int registerEventType (int hint=-1)
 

Detailed Description

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.

Note
This class is currently supported for Mac OS X.

Method Documentation

QString QFileOpenEvent::file ( ) const
inline

Returns the file that is being opened.

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 can not be opened by name, but require specific information stored in this event.

QUrl QFileOpenEvent::url ( ) const
inline

Returns the url that is being opened.