diff options
author | Tor Arne Vestbø <tor.arne.vestbo@nokia.com> | 2009-11-05 16:02:27 (GMT) |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@nokia.com> | 2009-11-05 16:16:54 (GMT) |
commit | 7efc64e6a8dbf670bbc46243664d44df7acc5892 (patch) | |
tree | c2246eae9326f307d570687f78d769e0a22d54b6 /src/gui/kernel/qevent_p.h | |
parent | 1e964556d61b2f4c7a8a0d251940e17c22790980 (diff) | |
download | Qt-7efc64e6a8dbf670bbc46243664d44df7acc5892.zip Qt-7efc64e6a8dbf670bbc46243664d44df7acc5892.tar.gz Qt-7efc64e6a8dbf670bbc46243664d44df7acc5892.tar.bz2 |
Add support for GetURL events on Mac OS X
GetURL events are delivered by Launch Services to the application if the
application is registered as the default handler for the given protocol,
and the user for example issues 'open http://foo.com/' in the console or
clicks a link in another application.
The GetURL event is converted to a QFileOpenEvent, which now has both a
QUrl constructor and a url() method. These two new methods work in sync
with the file() method, so a QFileOpenEvent constructed from a QUrl will
return a valid file name from file() if the URL was a local file.
The boolean argument to AEInstallEventHandler decides whether the handler
is to be added to the system event dispatch table or the application's
event dispatch table. Previously we added it to the system table, but
this did not work for the GetURL event. We now use the application event
table, which works for all three of the events we register on Carbon.
Reviewed-by: Prasanth Ullattil <prasanth.ullattil@nokia.com>
Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
Diffstat (limited to 'src/gui/kernel/qevent_p.h')
-rw-r--r-- | src/gui/kernel/qevent_p.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/gui/kernel/qevent_p.h b/src/gui/kernel/qevent_p.h index 6e6ab01..4aaaa8b 100644 --- a/src/gui/kernel/qevent_p.h +++ b/src/gui/kernel/qevent_p.h @@ -43,6 +43,7 @@ #define QEVENT_P_H #include <QtCore/qglobal.h> +#include <QtCore/qurl.h> #include <QtGui/qevent.h> QT_BEGIN_NAMESPACE @@ -164,6 +165,18 @@ public: QMap<Qt::GestureType, QWidget *> targetWidgets; }; + +class QFileOpenEventPrivate +{ +public: + inline QFileOpenEventPrivate(const QUrl &url) + : url(url) + { + } + + QUrl url; +}; + QT_END_NAMESPACE #endif // QEVENT_P_H |