add context menu to QTableView
don't close main window if a dialog is active window.