Class that manages the widgets inside a QDockWidget. More...

#include <DockWindowManager.h>

Public Member Functions

QDockWidget * addDockWindow (const char *name, QWidget *widget, Qt::DockWidgetArea pos=Qt::AllDockWidgetAreas)
 Adds a QDockWidget to the main window and sets widget as its widget. More...
 
QWidgetgetDockWindow (const char *name) const
 Returns the widget with name name added with addDockWindow. More...
 
QList< QWidget * > getDockWindows () const
 Returns a list of all widgets which set to a QDockWidget. More...
 

Static Public Member Functions

static void destruct ()
 
static DockWindowManagerinstance ()
 Creates the only instance of the DockWindowManager. More...
 

without deleting it.

Removes the specified dock window with name

bool registerDockWindow (const char *name, QWidget *widget)
 Appends a new widget with name to the list of available dock widgets. More...
 
QWidgetunregisterDockWindow (const char *name)
 
void setup (DockWindowItems *)
 Sets up the dock windows of the activated workbench. More...
 
QWidgetremoveDockWindow (const char *name)
 Removes and destroys the QDockWidget and returns the widget with name name added with addDockWindow. More...
 
void removeDockWindow (QWidget *dock)
 Removes and destroys the QDockWidget that contains dock. More...
 
void saveState ()
 
void retranslate ()
 Sets the window title for the dockable windows. More...
 

Detailed Description

Class that manages the widgets inside a QDockWidget.

Author
Werner Mayer

Member Function Documentation

◆ addDockWindow()

QDockWidget * DockWindowManager::addDockWindow ( const char *  name,
QWidget widget,
Qt::DockWidgetArea  pos = Qt::AllDockWidgetAreas 
)

Adds a QDockWidget to the main window and sets widget as its widget.

Adds a new dock window to the main window and embeds the given widget.

References Gui::getMainWindow().

Referenced by Gui::Dialog::DlgDisplayPropertiesImp::DlgDisplayPropertiesImp(), Gui::Dialog::DockablePlacement::DockablePlacement(), MeshGui::DockEvaluateMeshImp::DockEvaluateMeshImp(), and setup().

◆ destruct()

void DockWindowManager::destruct ( )
static

◆ getDockWindow()

QWidget * DockWindowManager::getDockWindow ( const char *  name) const

Returns the widget with name name added with addDockWindow.

Returns the widget inside the dock window by name.

Note
The returned widget is not the QDockWidget instance returned from addDockWindow. If you want to access the QDockWidget you get it with parentWidget() of the returned widget.

If it does not exist 0 is returned.

Referenced by Gui::Dialog::DlgGeneralImp::saveSettings(), and Gui::ControlSingleton::showDialog().

◆ getDockWindows()

QList< QWidget * > DockWindowManager::getDockWindows ( ) const

Returns a list of all widgets which set to a QDockWidget.

Returns a list of all widgets inside the dock windows.

◆ instance()

◆ registerDockWindow()

bool DockWindowManager::registerDockWindow ( const char *  name,
QWidget widget 
)

Appends a new widget with name to the list of available dock widgets.

The caller must make sure that the name is unique. If a widget with this name is already registered nothing is done but false is returned, otherwise it is appended and true is returned.

As default the following widgets are already registered:

  • Std_TreeView
  • Std_PropertyView
  • Std_ReportView
  • Std_ToolBox
  • Std_ComboView
  • Std_SelectionView

To avoid name clashes the caller should use names of the form module_widgettype, i. e. if a analyse dialog for the mesh module is added the name must then be Mesh_AnalyzeDialog.

To make use of dock windows when a workbench gets loaded the method setupDockWindows() must reimplemented in a subclass of Gui::Workbench.

Referenced by Gui::MainWindow::MainWindow(), and SandboxGui::Workbench::Workbench().

◆ removeDockWindow() [1/2]

QWidget * DockWindowManager::removeDockWindow ( const char *  name)

◆ removeDockWindow() [2/2]

void DockWindowManager::removeDockWindow ( QWidget widget)

Removes and destroys the QDockWidget that contains dock.

Method provided for convenience.

dock does not get destroyed.

Does basically the same as the method above unless that it accepts a pointer.

References Gui::getMainWindow().

◆ retranslate()

void DockWindowManager::retranslate ( )

Sets the window title for the dockable windows.

Referenced by Gui::Workbench::retranslate().

◆ saveState()

◆ setup()

◆ unregisterDockWindow()

QWidget * DockWindowManager::unregisterDockWindow ( const char *  name)

The documentation for this class was generated from the following files:
  • src/Gui/DockWindowManager.h
  • src/Gui/DockWindowManager.cpp