]> git.sur5r.net Git - fstl/commitdiff
Adding event for mac open event
authorMatt Keeter <matt.j.keeter@gmail.com>
Fri, 14 Mar 2014 14:31:43 +0000 (10:31 -0400)
committerMatt Keeter <matt.j.keeter@gmail.com>
Fri, 14 Mar 2014 14:31:43 +0000 (10:31 -0400)
src/app.cpp
src/app.h

index c8dba623295f9aa4868456d5e81e83891ab3d080..e29fe764d55490a49dbbb2ea97951fa693d1d378 100644 (file)
@@ -1,3 +1,6 @@
+#include <QDebug>
+#include <QFileOpenEvent>
+
 #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<QFileOpenEvent*>(e)->file();
+    }
+    else
+    {
+        return QApplication::event(e);
+    }
+}
index 2b440ede598328f5958a466a68e849e598ee9f17..7a7672e7acd384de5a21966a1e7a9756dd16867e 100644 (file)
--- 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;
 
 };