1 // PARAVIS : ParaView wrapper SALOME module
3 // Copyright (C) 2010-2024 CEA, EDF
5 // This library is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU Lesser General Public
7 // License as published by the Free Software Foundation; either
8 // version 2.1 of the License, or (at your option) any later version.
10 // This library is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // Lesser General Public License for more details.
15 // You should have received a copy of the GNU Lesser General Public
16 // License along with this library; if not, write to the Free Software
17 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 // File : PVGUI_Module_MenuActions.cxx
22 // Author : Margarita KARPUNINA
25 #include "PVGUI_Module.h"
26 #include "PVViewer_ViewManager.h"
27 #include "PVViewer_GUIElements.h"
29 #include <QtxActionToolMgr.h>
30 #include <LightApp_Application.h>
31 #include <SUIT_Desktop.h>
33 #include <QApplication>
35 #include <QDockWidget>
39 #include <QScrollArea>
40 #include <QVBoxLayout>
42 #include <QToolButton>
44 #include <pqAnimationViewWidget.h>
45 #include <pqAnimationWidget.h>
47 #include <pqApplicationCore.h>
48 #include <pqComparativeVisPanel.h>
49 #include <pqPipelineBrowserWidget.h>
50 #include <pqProxyInformationWidget.h>
51 #include <pqDataInformationWidget.h>
52 #include <pqPVAnimationWidget.h>
53 #include <pqFindDataSelectionDisplayFrame.h>
54 #include <pqMultiBlockInspectorWidget.h>
55 #include <pqProgressWidget.h>
56 #include <pqProgressManager.h>
57 #include <pqPropertiesPanel.h>
58 #include <pqPVApplicationCore.h>
59 #include <pqAnimationManager.h>
61 #include <pqApplicationCore.h>
62 #include <pqPluginManager.h>
63 #include <pqParaViewMenuBuilders.h>
64 #include <pqCollaborationPanel.h>
65 #include <pqMemoryInspectorPanel.h>
66 #include <pqColorMapEditor.h>
67 #include <pqFindDataWidget.h>
68 #include <pqDeleteReaction.h>
70 #include <vtkPVGeneralSettings.h>
71 #include <vtkSMSettings.h>
72 #include <vtkPVConfig.h>
74 class ResizeHelper : public pqPVAnimationWidget
76 // TEMPORARY WORKAROUND AROUND PARAVIEW 3.14 BUG:
77 // WHEN ANIMATION VIEW IS RESIZED, ITS CONTENTS IS NOT PREPERLY RE-ARRANGED
78 // CAUSING SOME CONTROLS TO STAY NON-VISIBLE
79 // THIS BUG IS NATURALLY FIXED BY ADDING
80 // this->updateGeometries();
82 // void pqAnimationWidget::resizeEvent(QResizeEvent* e);
83 // BUT THIS CANNOT BE DONE DIRECTLY, SINCE CORRESPONDING API IS NOT PUBLIC
84 // THE ONLY WAY TO DO THIS BY SENDING SHOW EVENT TO THE WIDGET
87 ResizeHelper( QWidget* parent ) : pqPVAnimationWidget( parent ) {}
89 void resizeEvent(QResizeEvent* e)
91 pqAnimationWidget* w = findChild<pqAnimationWidget*>( "pqAnimationWidget" );
94 QApplication::sendEvent( w, &e );
96 pqPVAnimationWidget::resizeEvent( e );
101 \brief Create dock widgets for ParaView widgets such as object inspector, pipeline browser, etc.
102 ParaView pqMainWindowCore class is fully responsible for these dock widgets' contents.
103 ==> To update this function, see the reference set up of ParaView in Application/Paraview/ParaviewMainWindow.ui
105 void PVGUI_Module::setupDockWidgets()
107 SUIT_Desktop* desk = application()->desktop();
108 PVViewer_GUIElements * guiElements = PVViewer_GUIElements::GetInstance(desk);
110 desk->setCorner(Qt::BottomLeftCorner, Qt::LeftDockWidgetArea);
111 desk->setCorner(Qt::BottomRightCorner, Qt::RightDockWidgetArea);
112 desk->setTabPosition(Qt::LeftDockWidgetArea, QTabWidget::North);
115 QDockWidget* pipelineBrowserDock = new QDockWidget( tr( "TTL_PIPELINE_BROWSER" ), desk );
116 pipelineBrowserDock->setObjectName("pipelineBrowserDock");
117 pipelineBrowserDock->setAllowedAreas( Qt::LeftDockWidgetArea|Qt::NoDockWidgetArea|Qt::RightDockWidgetArea );
118 desk->addDockWidget( Qt::LeftDockWidgetArea, pipelineBrowserDock );
119 pqPipelineBrowserWidget* browser = guiElements->getPipelineBrowserWidget();
120 pipelineBrowserDock->setWidget(browser);
121 myDockWidgets[pipelineBrowserDock] = true;
122 pipelineBrowserDock->hide();
124 // PROPERTIES, DISPLAY and VIEW:
125 // See ParaViewMainWindow.cxx - those three panels can be separated or grouped.
126 vtkSMSettings* settings = vtkSMSettings::GetInstance();
128 // Properties dock (previously called OBJECT_INSPECTOR)
129 QDockWidget* propertiesDock = new QDockWidget( tr( "TTL_OBJECT_INSPECTOR" ), desk );
130 propertiesDock->setObjectName("propertiesDock");
131 propertiesDock->setAllowedAreas( Qt::LeftDockWidgetArea|Qt::RightDockWidgetArea );
132 desk->addDockWidget( Qt::LeftDockWidgetArea, propertiesDock );
134 pqPropertiesPanel* propertiesPanel = guiElements->getPropertiesPanel();
135 propertiesDock->setWidget(propertiesPanel);
136 connect( propertiesPanel, SIGNAL( helpRequested(const QString&, const QString&) ), this, SLOT( showHelpForProxy(const QString&, const QString&) ) );
137 // hook delete to pqDeleteReaction.
138 QAction* tempDeleteAction = new QAction(this);
139 pqDeleteReaction* handler = new pqDeleteReaction(tempDeleteAction);
140 #if PARAVIEW_VERSION_MAJOR==5 && PARAVIEW_VERSION_MINOR<9
141 handler->connect(propertiesPanel, SIGNAL(deleteRequested(pqPipelineSource*)), SLOT(deleteSource(pqPipelineSource*)));
143 handler->connect(propertiesPanel, SIGNAL(deleteRequested(pqProxy*)), SLOT(deleteSource(pqProxy*)));
145 myDockWidgets[propertiesDock] = true;
146 propertiesDock->hide();
148 int propertiesPanelMode = settings->GetSettingAsInt(
149 ".settings.GeneralSettings.PropertiesPanelMode", vtkPVGeneralSettings::ALL_IN_ONE);
152 QDockWidget* displayPropertiesDock = 0;
153 if (propertiesPanelMode == vtkPVGeneralSettings::SEPARATE_DISPLAY_PROPERTIES ||
154 propertiesPanelMode == vtkPVGeneralSettings::ALL_SEPARATE )
156 displayPropertiesDock = new QDockWidget( tr( "TTL_DISPLAY" ), desk );
157 displayPropertiesDock->setObjectName("displayPropertiesDock");
158 displayPropertiesDock->setAllowedAreas( Qt::LeftDockWidgetArea|Qt::RightDockWidgetArea );
159 desk->addDockWidget( Qt::LeftDockWidgetArea, displayPropertiesDock );
161 pqPropertiesPanel* displayPropertiesPanel = new pqPropertiesPanel();
162 displayPropertiesPanel->setObjectName("displayPropertiesPanel");
163 displayPropertiesPanel->setProperty("panelMode", QVariant(2)); // probably to have only the Display part
164 displayPropertiesDock->setWidget(displayPropertiesPanel);
165 myDockWidgets[displayPropertiesDock] = false;
166 displayPropertiesDock->hide();
170 QDockWidget* viewPropertiesDock = 0;
171 if (propertiesPanelMode == vtkPVGeneralSettings::SEPARATE_VIEW_PROPERTIES ||
172 propertiesPanelMode == vtkPVGeneralSettings::ALL_SEPARATE )
174 viewPropertiesDock = new QDockWidget( tr( "TTL_VIEW_PANEL" ), desk );
175 viewPropertiesDock->setObjectName("viewPropertiesDock");
176 viewPropertiesDock->setAllowedAreas( Qt::LeftDockWidgetArea|Qt::RightDockWidgetArea );
177 desk->addDockWidget( Qt::LeftDockWidgetArea, viewPropertiesDock );
179 pqPropertiesPanel* viewPropertiesPanel = new pqPropertiesPanel();
180 viewPropertiesPanel->setObjectName("viewPropertiesPanel");
181 viewPropertiesPanel->setProperty("panelMode", QVariant(4)); // probably to have only the View part
182 viewPropertiesDock->setWidget(viewPropertiesPanel);
183 myDockWidgets[viewPropertiesDock] = false;
184 viewPropertiesDock->hide();
187 switch (propertiesPanelMode)
189 case vtkPVGeneralSettings::SEPARATE_DISPLAY_PROPERTIES:
190 propertiesPanel->setPanelMode(
191 pqPropertiesPanel::SOURCE_PROPERTIES|pqPropertiesPanel::VIEW_PROPERTIES);
194 case vtkPVGeneralSettings::SEPARATE_VIEW_PROPERTIES:
195 propertiesPanel->setPanelMode(
196 pqPropertiesPanel::SOURCE_PROPERTIES|pqPropertiesPanel::DISPLAY_PROPERTIES);
199 case vtkPVGeneralSettings::ALL_SEPARATE:
200 propertiesPanel->setPanelMode(pqPropertiesPanel::SOURCE_PROPERTIES);
203 case vtkPVGeneralSettings::ALL_IN_ONE:
205 propertiesPanel->setPanelMode(
206 pqPropertiesPanel::SOURCE_PROPERTIES|pqPropertiesPanel::VIEW_PROPERTIES|pqPropertiesPanel::DISPLAY_PROPERTIES);
211 QDockWidget* informationDock = new QDockWidget(tr( "TTL_INFORMATION" ), desk);
212 informationDock->setObjectName("informationDock");
214 QWidget* informationWidgetFrame = new QWidget(informationDock);
215 informationWidgetFrame->setObjectName("informationWidgetFrame");
217 QVBoxLayout* verticalLayout_2 = new QVBoxLayout(informationWidgetFrame);
218 verticalLayout_2->setSpacing(0);
219 verticalLayout_2->setContentsMargins(0, 0, 0, 0);
221 QScrollArea* informationScrollArea = new QScrollArea(informationWidgetFrame);
222 informationScrollArea->setObjectName("informationScrollArea") ;
223 informationScrollArea->setWidgetResizable(true);
225 pqProxyInformationWidget* informationWidget = new pqProxyInformationWidget();
226 informationWidget->setObjectName("informationWidget");
227 informationWidget->setGeometry(QRect(0, 0, 77, 214));
228 informationScrollArea->setWidget(informationWidget);
230 verticalLayout_2->addWidget(informationScrollArea);
231 informationDock->setWidget(informationWidgetFrame);
233 myDockWidgets[informationDock] = true;
235 if ( viewPropertiesDock )
236 desk->tabifyDockWidget(propertiesDock, viewPropertiesDock);
237 if ( displayPropertiesDock )
238 desk->tabifyDockWidget(propertiesDock, displayPropertiesDock);
239 desk->tabifyDockWidget(propertiesDock, informationDock);
240 propertiesDock->raise();
243 QDockWidget* statisticsViewDock = new QDockWidget( tr( "TTL_STATISTICS_VIEW" ), desk );
244 statisticsViewDock->setObjectName("statisticsViewDock");
245 statisticsViewDock->setAllowedAreas(Qt::BottomDockWidgetArea|Qt::LeftDockWidgetArea|
246 Qt::NoDockWidgetArea|Qt::RightDockWidgetArea );
247 desk->addDockWidget( Qt::BottomDockWidgetArea, statisticsViewDock );
248 pqDataInformationWidget* aStatWidget = new pqDataInformationWidget(statisticsViewDock);
249 statisticsViewDock->setWidget(aStatWidget);
250 myDockWidgets[statisticsViewDock] = false; // hidden by default
253 QDockWidget* animationViewDock = new QDockWidget( tr( "TTL_ANIMATION_VIEW" ), desk );
254 animationViewDock->setObjectName("animationViewDock");
255 desk->addDockWidget( Qt::BottomDockWidgetArea, animationViewDock );
256 pqPVAnimationWidget* animation_panel = new ResizeHelper(animationViewDock); // [ABN] was resizeHelper
258 // RNV: Emit signal in order to make sure that animation scene is set
259 QMetaObject::invokeMethod( pqPVApplicationCore::instance()->animationManager(),
260 "activeSceneChanged",
261 Q_ARG( pqAnimationScene*, pqPVApplicationCore::instance()->animationManager()->getActiveScene() ) );
263 animationViewDock->setWidget(animation_panel);
264 myDockWidgets[animationViewDock] = false; // hidden by default
266 desk->tabifyDockWidget(animationViewDock, statisticsViewDock);
268 // Selection inspector
269 QDockWidget* selectionDisplayDock = new QDockWidget( tr( "TTL_SELECTION_INSPECTOR" ), desk );
270 selectionDisplayDock->setObjectName("selectionInspectorDock");
271 selectionDisplayDock->setAllowedAreas( Qt::AllDockWidgetAreas );
272 desk->addDockWidget( Qt::LeftDockWidgetArea, selectionDisplayDock );
273 pqFindDataSelectionDisplayFrame* aSelInspector = new pqFindDataSelectionDisplayFrame(selectionDisplayDock);
274 selectionDisplayDock->setWidget(aSelInspector);
275 myDockWidgets[selectionDisplayDock] = false; // hidden by default
277 // Multi-block inspector
278 QDockWidget* multiBlockInspectorPanelDock = new QDockWidget( tr( "TTL_MUTLI_BLOCK_INSPECTOR" ), desk );
279 multiBlockInspectorPanelDock->setObjectName("multiBlockInspectorPanelDock");
280 desk->addDockWidget( Qt::LeftDockWidgetArea, multiBlockInspectorPanelDock );
281 pqMultiBlockInspectorWidget* mbi_panel = new pqMultiBlockInspectorWidget( multiBlockInspectorPanelDock );
282 multiBlockInspectorPanelDock->setWidget(mbi_panel);
283 myDockWidgets[multiBlockInspectorPanelDock] = false; // hidden by default
286 QDockWidget* comparativePanelDock = new QDockWidget( tr( "TTL_COMPARATIVE_VIEW_INSPECTOR" ), desk );
287 comparativePanelDock->setObjectName("comparativePanelDock");
288 desk->addDockWidget( Qt::LeftDockWidgetArea, comparativePanelDock );
289 pqComparativeVisPanel* cv_panel = new pqComparativeVisPanel( comparativePanelDock );
290 comparativePanelDock->setWidget(cv_panel);
291 myDockWidgets[comparativePanelDock] = false; // hidden by default
293 // Collaboration view
294 QDockWidget* collaborationPanelDock = new QDockWidget(tr( "TTL_COLLABORATIVE_DOCK" ), desk);
295 collaborationPanelDock->setObjectName("collaborationPanelDock");
296 pqCollaborationPanel* collaborationPanel = new pqCollaborationPanel();
297 collaborationPanel->setObjectName("collaborationPanel");
298 collaborationPanelDock->setWidget(collaborationPanel);
299 desk->addDockWidget(Qt::RightDockWidgetArea, collaborationPanelDock);
300 myDockWidgets[collaborationPanelDock] = false; // hidden by default
303 QDockWidget* colorMapEditorDock = new QDockWidget( tr( "TTL_COLOR_MAP_EDITOR" ), desk );
304 colorMapEditorDock->setObjectName("colorMapEditorDock");
305 desk->addDockWidget( Qt::LeftDockWidgetArea, colorMapEditorDock );
306 pqColorMapEditor* cmed_panel = new pqColorMapEditor( colorMapEditorDock );
307 colorMapEditorDock->setWidget(cmed_panel);
308 myDockWidgets[colorMapEditorDock] = false; // hidden by default
310 // Provide access to the color-editor panel for the application.
311 pqApplicationCore::instance()->registerManager(
312 "COLOR_EDITOR_PANEL", colorMapEditorDock);
315 QDockWidget* findDataDock = new QDockWidget(tr( "TTL_FIND_DATA" ), desk);
316 findDataDock->setObjectName("findDataDock");
317 pqFindDataWidget* findDataWidget = new pqFindDataWidget();
318 findDataWidget->setObjectName("findDataWidget");
319 findDataDock->setWidget(findDataWidget);
320 desk->addDockWidget(Qt::RightDockWidgetArea, findDataDock);
321 myDockWidgets[findDataDock] = false; // hidden by default
323 // Provide access to the find data panel for the application
324 // (through the menu Edit > Find data).
325 pqApplicationCore::instance()->registerManager("FIND_DATA_PANEL", findDataDock);
327 // Memory inspector dock
328 QDockWidget* memoryInspectorDock = new QDockWidget(tr( "TTL_MEMORY_INSPECTOR" ), desk);
329 memoryInspectorDock->setObjectName("memoryInspectorDock");
331 pqMemoryInspectorPanel* dockWidgetContents = new pqMemoryInspectorPanel();
332 dockWidgetContents->setObjectName("dockWidgetContents");
333 memoryInspectorDock->setWidget(dockWidgetContents);
335 desk->addDockWidget(Qt::RightDockWidgetArea, memoryInspectorDock);
336 myDockWidgets[memoryInspectorDock] = false; // hidden by default
338 // Setup the statusbar ...
339 pqProgressManager* progress_manager =
340 pqApplicationCore::instance()->getProgressManager();
342 // Progress bar/button management
343 pqProgressWidget* aProgress = new pqProgressWidget(desk->statusBar());
344 progress_manager->addNonBlockableObject(aProgress);
345 progress_manager->addNonBlockableObject(aProgress->getAbortButton());
347 QObject::connect( progress_manager, SIGNAL(enableProgress(bool)),
348 aProgress, SLOT(enableProgress(bool)));
350 QObject::connect( progress_manager, SIGNAL(progress(const QString&, int)),
351 aProgress, SLOT(setProgress(const QString&, int)));
353 QObject::connect( progress_manager, SIGNAL(enableAbort(bool)),
354 aProgress, SLOT(enableAbort(bool)));
356 QObject::connect( aProgress, SIGNAL(abortPressed()),
357 progress_manager, SLOT(triggerAbort()));
359 desk->statusBar()->addPermanentWidget(aProgress);
360 aProgress->setEnabled(true);
362 // Set up the dock window corners to give the vertical docks more room.
363 // desk->setCorner(Qt::BottomLeftCorner, Qt::LeftDockWidgetArea);
364 // desk->setCorner(Qt::BottomRightCorner, Qt::RightDockWidgetArea);
366 // Setup the default dock configuration ...
367 statisticsViewDock->hide();
368 comparativePanelDock->hide();
369 animationViewDock->hide();
370 multiBlockInspectorPanelDock->hide();
371 selectionDisplayDock->hide();
372 collaborationPanelDock->hide();
373 memoryInspectorDock->hide();
374 colorMapEditorDock->hide();
378 \brief Save states of dockable ParaView widgets.
380 void PVGUI_Module::saveDockWidgetsState(bool hideWidgets)
382 SUIT_Desktop* desk = application()->desktop();
384 // VSR: 19/06/2011: do not use Paraview's methods, since it conflicts with SALOME GUI architecture
385 // ... the following code is commented...
386 // Save the state of the window ...
387 // pqApplicationCore::instance()->settings()->saveState(*desk, "MainWindow");
389 //for (int i = 0; i < myDockWidgets.size(); ++i)
390 // myDockWidgets.at(i)->setParent(0);
391 // ... and replaced - manually hide dock windows
393 // store dock widgets visibility state and hide'em all
394 QMapIterator<QWidget*, bool> it1( myDockWidgets );
395 while( it1.hasNext() ) {
397 QDockWidget* dw = qobject_cast<QDockWidget*>( it1.key() );
398 myDockWidgets[dw] = dw->isVisible();
400 dw->setVisible( false );
401 dw->toggleViewAction()->setVisible( false );
404 // store toolbar breaks state and remove all tollbar breaks
405 QMapIterator<QWidget*, bool> it2( myToolbarBreaks );
406 while( it2.hasNext() ) {
408 QToolBar* tb = qobject_cast<QToolBar*>( it2.key() );
409 myToolbarBreaks[tb] = desk->toolBarBreak( tb );
410 if ( myToolbarBreaks[tb] && hideWidgets )
411 desk->removeToolBarBreak( tb );
413 // store toolbars visibility state and hide'em all
414 QMapIterator<QWidget*, bool> it3( myToolbars );
415 while( it3.hasNext() ) {
417 QToolBar* tb = qobject_cast<QToolBar*>( it3.key() );
418 myToolbars[tb] = tb->isVisible();
420 tb->setVisible( false );
421 tb->toggleViewAction()->setVisible( false );
427 \brief Restore states of dockable ParaView widgets.
429 void PVGUI_Module::restoreDockWidgetsState()
431 SUIT_Desktop* desk = application()->desktop();
433 // VSR: 19/06/2011: do not use Paraview's methods, since it conflicts with SALOME GUI architecture
434 // ... the following code is commented...
435 //for (int i = 0; i < myDockWidgets.size(); ++i)
436 // myDockWidgets.at(i)->setParent(desk);
438 // Restore the state of the window ...
439 //pqApplicationCore::instance()->settings()->restoreState("MainWindow", *desk);
440 // ... and replaced - manually hide dock windows
442 // restore dock widgets visibility state
443 QMapIterator<QWidget*, bool> it1( myDockWidgets );
444 while( it1.hasNext() ) {
446 QDockWidget* dw = qobject_cast<QDockWidget*>( it1.key() );
447 dw->setVisible( it1.value() );
448 dw->toggleViewAction()->setVisible( true );
451 // restore toolbar breaks state
452 QMapIterator<QWidget*, bool> it2( myToolbarBreaks );
453 while( it2.hasNext() ) {
455 QToolBar* tb = qobject_cast<QToolBar*>( it2.key() );
456 if ( myToolbarBreaks[tb] )
457 desk->insertToolBarBreak( tb );
460 // restore toolbar visibility state
461 QMapIterator<QWidget*, bool> it3( myToolbars );
462 while( it3.hasNext() ) {
464 QToolBar* tb = qobject_cast<QToolBar*>( it3.key() );
465 tb->setVisible( it3.value() );
466 tb->toggleViewAction()->setVisible( true );
473 \brief Store visibility of the common dockable windows (OB, PyConsole, ... etc.)
475 void PVGUI_Module::storeCommonWindowsState() {
476 //rnv: Make behaviour of the dockable windows and toolbars coherent with others
477 // modules: if 'Save position of the windows' or 'Save position of the toolbars'
478 // in the General SALOME preferences are cheked, then properties of the windows and/or toolbars
479 // are stored/restored using standard Qt saveState(...) and restoreState(...) methods.
480 // Otherwise to the windows and toolbars applied default settins stored int the SalomeApp.xml
481 // configuration file.
483 // But in contrast to others modules ParaVis module default settings hide some dockable
484 // windows, so to restore it at the moment of the ParaVis de-activation we call
485 // restoreCommonWindowsState() method, and at the moment of the ParaVis activation we call
488 LightApp_Application* anApp = getApp();
492 int begin = LightApp_Application::WT_ObjectBrowser;
493 int end = LightApp_Application::WT_User;
494 for( int i = begin; i <= end; i++ ) {
495 QWidget* wg = anApp->getWindow(i);
497 QDockWidget* dock = 0;
498 QWidget* w = wg->parentWidget();
499 while ( w && !dock ) {
500 dock = ::qobject_cast<QDockWidget*>( w );
501 w = w->parentWidget();
504 if(!myCommonMap.contains(i)){
505 myCommonMap.insert(i,dock->isVisible());
507 myCommonMap[i] = dock->isVisible();
515 \brief Restore visibility of the common dockable windows (OB, PyConsole, ... etc.)
517 void PVGUI_Module::restoreCommonWindowsState() {
518 LightApp_Application* anApp = getApp();
521 DockWindowMap::const_iterator it = myCommonMap.begin();
522 for( ;it != myCommonMap.end(); it++ ) {
523 QWidget* wg = anApp->getWindow(it.key());
525 QDockWidget* dock = 0;
526 QWidget* w = wg->parentWidget();
527 while ( w && !dock ) {
528 dock = ::qobject_cast<QDockWidget*>( w );
529 w = w->parentWidget();
532 dock->setVisible(it.value());