bool Window::event(QEvent *mEvent){ if (mEvent->type()==QEvent::Close) { close(); return true; } return QMainWindow::event(mEvent);}