Adding event for mac open event
This commit is contained in:
parent
a9ea3928e4
commit
0dc400a7e1
2 changed files with 18 additions and 6 deletions
15
src/app.cpp
15
src/app.cpp
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue