MCPcopy Create free account
hub / github.com/OpenMS/OpenMS / closeEvent

Method closeEvent

src/openms_gui/source/VISUAL/PlotWidget.cpp:259–276  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

257 }
258
259 void PlotWidget::closeEvent(QCloseEvent* e)
260 {
261 for (UInt l = 0; l < canvas()->getLayerCount(); ++l)
262 {
263 //modified => ask if it should be saved
264 const LayerDataBase& layer = canvas()->getLayer(l);
265 if (layer.modified)
266 {
267 QMessageBox::StandardButton result = QMessageBox::question(this, "Save?", (String("Do you want to save your changes to layer '") + layer.getName() + "'?").toQString(), QMessageBox::Ok | QMessageBox::Discard);
268 if (result == QMessageBox::Ok)
269 {
270 canvas()->activateLayer(l);
271 canvas()->saveCurrentLayer(false);
272 }
273 }
274 }
275 e->accept();
276 }
277
278 void PlotWidget::dragEnterEvent(QDragEnterEvent* event)
279 {

Callers

nothing calls this directly

Calls 8

getLayerCountMethod · 0.80
getLayerMethod · 0.80
saveCurrentLayerMethod · 0.80
canvasFunction · 0.50
StringClass · 0.50
toQStringMethod · 0.45
getNameMethod · 0.45
activateLayerMethod · 0.45

Tested by

no test coverage detected