diff options
author | Olivier Goffart <ogoffart@trolltech.com> | 2009-11-06 17:09:27 (GMT) |
---|---|---|
committer | Olivier Goffart <ogoffart@trolltech.com> | 2009-11-06 17:09:27 (GMT) |
commit | 7ee944a14582cd7202b4a8e94adc06e7ae5855a6 (patch) | |
tree | 0684ab4a4e02dc72c2e1f5bc72baaf55f0d0310f /src/gui/kernel/qevent.cpp | |
parent | cd58bc13a4a37543d76a79b3cee7cd95bde0a14b (diff) | |
parent | 12d14efb2e1df3188c7c0001492f24fd193a11a9 (diff) | |
download | Qt-7ee944a14582cd7202b4a8e94adc06e7ae5855a6.zip Qt-7ee944a14582cd7202b4a8e94adc06e7ae5855a6.tar.gz Qt-7ee944a14582cd7202b4a8e94adc06e7ae5855a6.tar.bz2 |
Merge commit 'origin/4.6' into 4.6
Conflicts:
dist/changes-4.6.0
Diffstat (limited to 'src/gui/kernel/qevent.cpp')
-rw-r--r-- | src/gui/kernel/qevent.cpp | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index ad68aea..ff97405 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -2976,13 +2976,13 @@ QShowEvent::~QShowEvent() /*! \class QFileOpenEvent \brief The QFileOpenEvent class provides an event that will be - sent when there is a request to open a file. + sent when there is a request to open a file or a URL. \ingroup events File open events will be sent to the QApplication::instance() - when the operating system requests that a file be opened. This is - a high-level event that can be caused by different user actions + 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. @@ -2999,12 +2999,27 @@ QShowEvent::~QShowEvent() */ QFileOpenEvent::QFileOpenEvent(const QString &file) : QEvent(FileOpen), f(file) -{} +{ + d = reinterpret_cast<QEventPrivate *>(new QFileOpenEventPrivate(QUrl::fromLocalFile(file))); +} + +/*! + \internal + + Constructs a file open event for the given \a url. +*/ +QFileOpenEvent::QFileOpenEvent(const QUrl &url) + : QEvent(FileOpen) +{ + d = reinterpret_cast<QEventPrivate *>(new QFileOpenEventPrivate(url)); + f = url.toLocalFile(); +} /*! \internal */ QFileOpenEvent::~QFileOpenEvent() { + delete reinterpret_cast<QFileOpenEventPrivate *>(d); } /*! @@ -3013,6 +3028,16 @@ QFileOpenEvent::~QFileOpenEvent() Returns the file that is being opened. */ +/*! + \fn QUrl QFileOpenEvent::url() const + + Returns the url that is being opened. +*/ +QUrl QFileOpenEvent::url() const +{ + return reinterpret_cast<const QFileOpenEventPrivate *>(d)->url; +} + #ifndef QT_NO_TOOLBAR /*! \internal |