Adding event for mac open event

This commit is contained in:
Matt Keeter 2014-03-14 10:31:43 -04:00
parent a9ea3928e4
commit 0dc400a7e1
2 changed files with 18 additions and 6 deletions

View file

@ -1,3 +1,6 @@
#include <QDebug>
#include <QFileOpenEvent>
#include "app.h" #include "app.h"
#include "window.h" #include "window.h"
@ -6,3 +9,15 @@ App::App(int argc, char *argv[]) :
{ {
window->show(); window->show();
} }
bool App::event(QEvent* e)
{
if (e->type() == QEvent::FileOpen)
{
qDebug() << static_cast<QFileOpenEvent*>(e)->file();
}
else
{
return QApplication::event(e);
}
}

View file

@ -10,13 +10,10 @@ class App : public QApplication
Q_OBJECT Q_OBJECT
public: public:
explicit App(int argc, char *argv[]); explicit App(int argc, char *argv[]);
protected:
signals: bool event(QEvent* e);
public slots:
private: private:
Window* window; Window* const window;
}; };