MCPcopy Create free account
hub / github.com/cpvrlab/ImagePlay / zoomAllViewers

Method zoomAllViewers

ImagePlay/src/ImageViewerWindow.cpp:447–484  ·  view source on GitHub ↗

----------------------------------------------------------------------------- ! ImageViewerWindow::zoomAllViewers */

Source from the content-addressed store, hash-verified

445ImageViewerWindow::zoomAllViewers
446*/
447void ImageViewerWindow::zoomAllViewers(ZoomAction action)
448{
449 qDebug() << "ImageViewerWindow::zoomAllViewers";
450 _currentZoomMode = action;
451
452 if(_ignoreZoomEvents || _imageViewers1.count() == 0)
453 return;
454
455 _ignoreZoomEvents = true;
456
457 // apply zoom to all viewers
458 QMapIterator<int, IPImageViewer*> it(_imageViewers1);
459 int zoomFactor = 0;
460 while (it.hasNext())
461 {
462 it.next();
463
464 if(action == ImageViewerWindow::ZOOM_IN)
465 it.value()->zoomIn();
466 else if(action == ImageViewerWindow::ZOOM_OUT)
467 it.value()->zoomOut();
468 else if(action == ImageViewerWindow::ZOOM_FIT)
469 it.value()->zoomFit();
470 else if(action == ImageViewerWindow::ZOOM_RESET)
471 it.value()->zoomReset();
472
473 zoomFactor = it.value()->zoomFactor();
474 }
475
476 // store the current zoom for new windows
477 _currentZoomFactor = static_cast< double >( zoomFactor ) / 100.0;
478
479 on_horizontalScrollBarChanged(((IPImageViewer*)ui->tabWidget->currentWidget())->horizontalScrollBar()->value());
480 on_verticalScrollBarChanged(((IPImageViewer*)ui->tabWidget->currentWidget())->verticalScrollBar()->value());
481
482 _ignoreZoomEvents = false;
483 on_zoomChanged(zoomFactor);
484}
485
486//-----------------------------------------------------------------------------
487/*!

Callers

nothing calls this directly

Calls 9

zoomFitMethod · 0.80
zoomResetMethod · 0.80
zoomFactorMethod · 0.80
horizontalScrollBarMethod · 0.80
verticalScrollBarMethod · 0.80
nextMethod · 0.45
zoomInMethod · 0.45
valueMethod · 0.45
zoomOutMethod · 0.45

Tested by

no test coverage detected