MCPcopy Create free account
hub / github.com/computationalpathologygroup/ASAP / close

Method close

ASAP/PathologyViewer.cpp:454–506  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

452}
453
454void PathologyViewer::close() {
455 if (this->window()) {
456 QMenu* viewMenu = this->window()->findChild<QMenu*>("menuView");
457 _settings->beginGroup("ASAP");
458 if (viewMenu) {
459 QList<QAction*> actions = viewMenu->actions();
460 for (QList<QAction*>::iterator it = actions.begin(); it != actions.end(); ++it) {
461 if ((*it)->text() == "Toggle scale bar" && _scaleBar) {
462 _settings->setValue("scaleBarToggled", (*it)->isChecked());
463 }
464 else if ((*it)->text() == "Toggle mini-map" && _map) {
465 _settings->setValue("miniMapToggled", (*it)->isChecked());
466 }
467 else if ((*it)->text() == "Toggle coverage view" && _map) {
468 _settings->setValue("coverageViewToggled", (*it)->isChecked());
469 }
470 }
471 }
472 _settings->endGroup();
473 }
474 if (_prefetchthread) {
475 _prefetchthread->deleteLater();
476 _prefetchthread = NULL;
477 }
478 scene()->clear();
479 if (_manager) {
480 _manager->clear();
481 delete _manager;
482 _manager = NULL;
483 }
484 if (_cache) {
485 _cache->clear();
486 delete _cache;
487 _cache = NULL;
488 }
489 _img = NULL;
490 if (_ioThread) {
491 _ioThread->shutdown();
492 _ioThread->deleteLater();
493 _ioThread = NULL;
494 }
495 if (_map) {
496 _map->setHidden(true);
497 _map->deleteLater();
498 _map = NULL;
499 }
500 if (_scaleBar) {
501 _scaleBar->setHidden(true);
502 _scaleBar->deleteLater();
503 _scaleBar = NULL;
504 }
505 setEnabled(false);
506}
507
508void PathologyViewer::togglePan(bool pan, const QPoint& startPos) {
509 if (pan) {

Callers 7

copyFileFunction · 0.45
readDataFromImageMethod · 0.45
initializeTypeMethod · 0.45
processMethod · 0.45
FilterDockWidgetMethod · 0.45

Calls 3

setValueMethod · 0.80
shutdownMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected