Gui::DockWindowManager Class Reference

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

#include <DockWindowManager.h>

List of all members.

Public Member Functions

QDockWidget * addDockWindow (const char *name, QWidget *widget, Qt::DockWidgetArea pos=Qt::AllDockWidgetAreas)
 Adds a new dock window to the main window and embeds the given widget.
QWidget * getDockWindow (const char *name) const
 Returns the widget inside the dock window by name.
QList< QWidget * > getDockWindows () const
 Returns a list of all widgets inside the dock windows.

Static Public Member Functions

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

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.
void removeDockWindow (QWidget *dock)
 Method provided for convenience.
QWidget * removeDockWindow (const char *name)
void retranslate ()
 Sets the window title for the dockable windows.
void saveState ()
void setup (DockWindowItems *)
 Sets up the dock windows of the activated workbench.

Detailed Description

Class that manages the widgets inside a QDockWidget.

Author:
Werner Mayer

Definition at line 60 of file DockWindowManager.h.


Member Function Documentation

QDockWidget * DockWindowManager::addDockWindow ( const char *  name,
QWidget *  widget,
Qt::DockWidgetArea  pos = Qt::AllDockWidgetAreas 
)
void DockWindowManager::destruct ( void   )  [static]

Definition at line 108 of file DockWindowManager.cpp.

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

Returns the widget inside the dock window by name.

If it does not exist 0 is returned.

Definition at line 168 of file DockWindowManager.cpp.

References Gui::DockWindowManagerP::_dockedWindows.

Referenced by Gui::Dialog::DlgGeneralImp::DlgGeneralImp().

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

Returns a list of all widgets inside the dock windows.

Definition at line 181 of file DockWindowManager.cpp.

References Gui::DockWindowManagerP::_dockedWindows.

DockWindowManager * DockWindowManager::instance ( void   )  [static]
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_CombiView
  • 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.

Definition at line 269 of file DockWindowManager.cpp.

References Gui::DockWindowManagerP::_dockWindows.

Referenced by Gui::MainWindow::MainWindow().

void DockWindowManager::removeDockWindow ( QWidget *  widget  ) 

Method provided for convenience.

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

Definition at line 220 of file DockWindowManager.cpp.

References Gui::DockWindowManagerP::_dockedWindows, and Gui::getMainWindow().

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

Sets the window title for the dockable windows.

Definition at line 243 of file DockWindowManager.cpp.

References Gui::DockWindowManagerP::_dockedWindows.

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

void DockWindowManager::saveState (  ) 
void DockWindowManager::setup ( DockWindowItems items  ) 

The documentation for this class was generated from the following files:

Generated on Wed Nov 23 19:01:59 2011 for FreeCAD by  doxygen 1.6.1