From: Matt Keeter Date: Fri, 14 Mar 2014 14:31:43 +0000 (-0400) Subject: Adding event for mac open event X-Git-Tag: v0.9.0~19 X-Git-Url: https://git.sur5r.net/?p=fstl;a=commitdiff_plain;h=0dc400a7e189dae2543149d12b1ebe4585e34a05 Adding event for mac open event --- diff --git a/src/app.cpp b/src/app.cpp index c8dba62..e29fe76 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -1,3 +1,6 @@ +#include +#include + #include "app.h" #include "window.h" @@ -6,3 +9,15 @@ App::App(int argc, char *argv[]) : { window->show(); } + +bool App::event(QEvent* e) +{ + if (e->type() == QEvent::FileOpen) + { + qDebug() << static_cast(e)->file(); + } + else + { + return QApplication::event(e); + } +} diff --git a/src/app.h b/src/app.h index 2b440ed..7a7672e 100644 --- a/src/app.h +++ b/src/app.h @@ -10,13 +10,10 @@ class App : public QApplication Q_OBJECT public: explicit App(int argc, char *argv[]); - -signals: - -public slots: - +protected: + bool event(QEvent* e); private: - Window* window; + Window* const window; };