bool IQmolApplication::event(QEvent* event) { bool accepted(false); switch (event->type()) { case QEvent::FileOpen: { QString file(static_cast<QFileOpenEvent*>(event)->file()); queueOpenFiles(QStringList(file)); accepted = true; } break; case QEvent::Close: { disconnect(this, SIGNAL(lastWindowClosed()), this, SLOT(maybeQuit())); accepted = QApplication::event(event); } break; case QEvent::User: { QString file(static_cast<FileOpenEvent*>(event)->file()); open(file); accepted = true; } break; default: accepted = QApplication::event(event); break; } return accepted; }
bool IQmolApplication::event(QEvent* event) { bool accepted(false); switch (event->type()) { case QEvent::FileOpen: { QString file(static_cast<QFileOpenEvent*>(event)->file()); queueOpenFiles(QStringList(file)); accepted = true; } break; case QEvent::User: { QString file(static_cast<FileOpenEvent*>(event)->file()); open(file); accepted = true; } break; default: accepted = QApplication::event(event); break; } return accepted; }