// synchronize target view with source view
viewWindow->getViewPort()->synchronize( otherViewWindow->getViewPort() );
viewWindow->toolMgr()->action( SynchronizeId )->setData( otherViewWindow->getId() );
- otherViewWindow->toolMgr()->action( SynchronizeId )->setData( viewWindow->getId() );
- if ( !otherViewWindow->toolMgr()->action( SynchronizeId )->isChecked() ) {
- bool blocked = otherViewWindow->toolMgr()->action( SynchronizeId )->blockSignals( true );
- otherViewWindow->toolMgr()->action( SynchronizeId )->setChecked( true );
- otherViewWindow->toolMgr()->action( SynchronizeId )->blockSignals( blocked );
+ QAction* anOtherAcion = otherViewWindow->toolMgr()->action( SynchronizeId );
+ if (anOtherAcion) {
+ anOtherAcion->setData( viewWindow->getId() );
+ if ( !anOtherAcion->isChecked() ) {
+ bool blocked = anOtherAcion->blockSignals( true );
+ anOtherAcion->setChecked( true );
+ anOtherAcion->blockSignals( blocked );
+ }
}
}
}
viewWindow->getViewPort()->disconnect( SIGNAL( vpTransformed( OCCViewer_ViewPort* ) ), otherViewWindow->getViewPort(), SLOT( synchronize( OCCViewer_ViewPort* ) ) );
viewWindow->getViewPort()->synchronize( otherViewWindow->getViewPort() );
viewWindow->toolMgr()->action( SynchronizeId )->setData( otherViewWindow->getId() );
- if ( otherViewWindow->toolMgr()->action( SynchronizeId )->data().toInt() == viewWindow->getId() && otherViewWindow->toolMgr()->action( SynchronizeId )->isChecked() ) {
- bool blocked = otherViewWindow->toolMgr()->action( SynchronizeId )->blockSignals( true );
- otherViewWindow->toolMgr()->action( SynchronizeId )->setChecked( false );
- otherViewWindow->toolMgr()->action( SynchronizeId )->blockSignals( blocked );
+ QAction* anOtherAcion = otherViewWindow->toolMgr()->action( SynchronizeId );
+ if (anOtherAcion) {
+ if ( anOtherAcion->data().toInt() == viewWindow->getId() && anOtherAcion->isChecked() ) {
+ bool blocked = anOtherAcion->blockSignals( true );
+ anOtherAcion->setChecked( false );
+ anOtherAcion->blockSignals( blocked );
+ }
}
}
}