MCPcopy Create free account
hub / github.com/Gecode/gecode / timerEvent

Method timerEvent

gecode/gist/treecanvas.cpp:517–535  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

515 }
516
517 void
518 TreeCanvas::timerEvent(QTimerEvent* e) {
519 if (e->timerId() == layoutDoneTimerId) {
520 if (!smoothScrollAndZoom) {
521 scaleTree(targetScale);
522 } else {
523 zoomTimeLine.stop();
524 int zoomCurrent = static_cast<int>(scale*100);
525 int targetZoom = targetScale;
526 targetZoom = std::min(std::max(targetZoom, LayoutConfig::minScale),
527 LayoutConfig::maxAutoZoomScale);
528 zoomTimeLine.setFrameRange(zoomCurrent,targetZoom);
529 zoomTimeLine.start();
530 }
531 QWidget::update();
532 killTimer(layoutDoneTimerId);
533 layoutDoneTimerId = 0;
534 }
535 }
536
537 void
538 TreeCanvas::zoomToFit(void) {

Callers

nothing calls this directly

Calls 5

updateFunction · 0.85
minFunction · 0.50
maxFunction · 0.50
stopMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected