From c82bb445ac3727cd4bded0fd45064c6648dc204e Mon Sep 17 00:00:00 2001 From: Thomas Ferreira de Lima Date: Wed, 7 Mar 2018 11:07:29 -0500 Subject: [PATCH] testing file open event --- src/lay/lay/layApplication.cc | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/lay/lay/layApplication.cc b/src/lay/lay/layApplication.cc index ac4f3dea4..bd39e552e 100644 --- a/src/lay/lay/layApplication.cc +++ b/src/lay/lay/layApplication.cc @@ -75,6 +75,11 @@ # include #endif +#if defined(__APPLE__) +# include +# include +#endif + namespace gsi { void make_application_decl (bool non_gui_mode); @@ -1391,6 +1396,20 @@ GuiApplication::force_update_app_menu () #endif } +#if defined(__APPLE__) +bool +GuiApplication::event(QEvent *event) +{ + if (event->type() == QEvent::FileOpen) { + QFileOpenEvent *openEvent = static_cast(event); + qDebug() << "Open file" << openEvent->file(); + } + + return QApplication::event(event); +} +#endif + + int GuiApplication::exec () {