X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSUIT%2FSUIT_ViewWindow.cxx;h=0a40235768c90dc2d25424a90919714d9b031921;hb=da0829dff07ea351cd385c493e2f63bf15640234;hp=b063cbb8be07b65b3ea0dac166bd314fa2878c2a;hpb=5ab4e9f868874916c91b51f12aa8beacf09f4125;p=modules%2Fgui.git diff --git a/src/SUIT/SUIT_ViewWindow.cxx b/src/SUIT/SUIT_ViewWindow.cxx index b063cbb8b..0a4023576 100755 --- a/src/SUIT/SUIT_ViewWindow.cxx +++ b/src/SUIT/SUIT_ViewWindow.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -6,7 +6,7 @@ // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2.1 of the License. +// version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -403,7 +403,7 @@ void SUIT_ViewWindow::updateSyncViews() SUIT_Application* app = SUIT_Session::session()->activeApplication(); if ( app ) { SUIT_Desktop* d = app->desktop(); - QList allViews = qFindChildren( d ); + QList allViews = d->findChildren(); foreach( SUIT_ViewWindow* vw, allViews ) { if ( !vw || vw == this ) continue; // skip invalid views and this one SUIT_CameraProperties otherProps = vw->cameraProperties(); @@ -473,7 +473,7 @@ void SUIT_ViewWindow::synchronizeView( SUIT_ViewWindow* viewWindow, int id ) SUIT_Desktop* d = app->desktop(); if ( !d ) return; - QList allViews = qFindChildren( d ); + QList allViews = d->findChildren(); foreach( SUIT_ViewWindow* vw, allViews ) { if ( !vw->cameraProperties().isValid() ) continue; // omit views not supporting camera properties @@ -542,3 +542,15 @@ void SUIT_ViewWindow::synchronizeView( SUIT_ViewWindow* viewWindow, int id ) } } } + +void SUIT_ViewWindow::setVisible( bool on ) +{ + // This is a workaround to avoid showing view window as a top-level window + // before re-parenting it to workstack (issue #23467). + // See SUIT_Desktop::childEvent(). + QApplication::sendPostedEvents( 0, QEvent::ChildRemoved ); + QApplication::sendPostedEvents( 0, QEvent::ChildAdded ); + QApplication::sendPostedEvents( 0, QEvent::ChildPolished ); + if ( !property( "blockShow" ).toBool() ) + QMainWindow::setVisible( on ); +}