MCPcopy Create free account
hub / github.com/Kitware/ParaView / eventFilter

Method eventFilter

Qt/Python/pqPythonScriptEditor.cxx:90–114  ·  view source on GitHub ↗

-----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

88
89//-----------------------------------------------------------------------------
90bool pqPythonScriptEditor::eventFilter(QObject* watched, QEvent* event)
91{
92 if (watched == this->parentWidget() && event->type() == QEvent::Close)
93 {
94 QCloseEvent* closeEvent = static_cast<QCloseEvent*>(event);
95
96 // if the python editor is closed when the main window is closing, force it to show
97 if (!this->isVisible())
98 {
99 this->show();
100 }
101
102 // prompt the user to save any open files if not already saved
103 if (this->TabWidget->saveOnClose())
104 {
105 pqApplicationCore::instance()->settings()->saveState(*this, "PythonScriptEditor");
106 closeEvent->accept();
107 }
108 else
109 {
110 closeEvent->ignore();
111 }
112 }
113 return QWidget::eventFilter(watched, event);
114}
115
116//-----------------------------------------------------------------------------
117void pqPythonScriptEditor::open(const QString& filename)

Callers

nothing calls this directly

Calls 9

instanceFunction · 0.85
parentWidgetMethod · 0.80
typeMethod · 0.45
isVisibleMethod · 0.45
showMethod · 0.45
saveOnCloseMethod · 0.45
saveStateMethod · 0.45
settingsMethod · 0.45
acceptMethod · 0.45

Tested by

no test coverage detected